Open
Description
Describe the issue:
There is a bug where it is possible to define a coord name which is also the same name as a data variable. So we are missing a check for name collisions. This leads to easy to miss downstream errors.
Reproduceable code example:
import pymc as pm
with pm.Model(coords={"a": [0, 1]}) as m:
a = pm.Data("a", [5, 10])
b = pm.Normal("b", dims="a")
Error message:
Code snippet above should raise an exception, but does not.
PyMC version information:
pymc version: 5.22.0
Context for the issue:
The issue first showed up as a) correct sampling of random variables with pm.sample
, b) re-sampling of random variables when calling pm.sample_posterior_predictive
. So what was being returned was actually prior predictive samples, not posterior predictive samples. @ricardoV94 helped me track down that it was caused by a common label for a coord and a data node.