-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
Description
This snippet hast the effect of shifting the known dims to the "left":
import pymc as pm
with pm.Model(coords={"a": range(5)}) as m:
x = pm.Normal("x", shape=(10, 5), dims=(None, "a"))
pm.sample()
ValueError: conflicting sizes for dimension 'a': length 10 on the data but length 5 on coordinate 'a'
Whereas this wrong specification goes unnoticed:
x = pm.Normal("x", shape=(5, 10), dims=(None, "a"))
Do we need None
dims? It's annoying if we want to create Xarray datasets in multiple places as in #6374
More generally, it seems we don't do any sort of type check. The following are all allowed at creation time. I don't know if that's by design.
import pymc as pm
with pm.Model(coords={"a": range(5)}) as m:
x = pm.Normal("x", shape=(10, 5), dims=("a", ..., 5, pm.Normal.dist()))
pm.sample()