-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Deterministic variables with dims
containing None
break model_to_graphviz
#6335
Labels
Comments
Using File pymc\data.py:716, in Data(name, value, dims, coords, export_index_as_coords, mutable, **kwargs)
706 if not dname in model.dim_lengths:
707 model.add_coord(
708 name=dname,
709 # Note: Coordinate values can't be taken from
(...)
713 length=xshape[d],
714 )
--> 716 model.add_random_variable(x, dims=dims)
718 return x
File pymc\model.py:1552, in Model.add_random_variable(self, var, dims)
1550 raise ValueError(f"Dimension {dim} is not specified in `coords`.")
1551 if any(var.name == dim for dim in dims):
-> 1552 raise ValueError(f"Variable `{var.name}` has the same name as its dimension label.")
1553 self._RV_dims[var.name] = dims
1555 self.named_vars[var.name] = var
ValueError: Variable `None` has the same name as its dimension label. |
I think this might be a rather simple fix: Checking |
michaelosthege
added a commit
to michaelosthege/pymc
that referenced
this issue
Nov 27, 2022
5 tasks
michaelosthege
added a commit
to michaelosthege/pymc
that referenced
this issue
Nov 27, 2022
ricardoV94
pushed a commit
to michaelosthege/pymc
that referenced
this issue
Nov 29, 2022
* Extract `ModelGraph._eval` to a function * More robustness against unlabeled `dims` entries Closes pymc-devs#6335
ricardoV94
pushed a commit
to ricardoV94/pymc
that referenced
this issue
Nov 29, 2022
* Extract `ModelGraph._eval` to a function * More robustness against unlabeled `dims` entries Closes pymc-devs#6335
wrongu
pushed a commit
to wrongu/pymc
that referenced
this issue
Dec 1, 2022
* Extract `ModelGraph._eval` to a function * More robustness against unlabeled `dims` entries Closes pymc-devs#6335
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the issue:
When a
Deterministic
variable is created, one may pass adims=(None, "time")
which is a validdims
tuple.However, when attempting a
pm.model_to_graphviz
later, aKeyError: None
is encountered when accessingModel.dim_lengths
.Reproduceable code example:
Error message:
PyMC version information:
4.1.7
Context for the issue:
No response
The text was updated successfully, but these errors were encountered: