Skip to content

Commit

Permalink
Test multiple None dims work together
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoV94 committed Jun 26, 2024
1 parent d4e5db1 commit 9792dff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/model/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,12 +899,14 @@ def test_none_coords_autonumbering(self):
# TODO: Either allow dims without coords everywhere or nowhere
with pm.Model() as m:
m.add_coord(name="a", values=None, length=3)
m.add_coord(name="b", values=range(5))
x = pm.Normal("x", dims=("a", "b"))
m.add_coord(name="b", values=range(-5, 0))
m.add_coord(name="c", values=None, length=7)
x = pm.Normal("x", dims=("a", "b", "c"))
prior = pm.sample_prior_predictive(draws=2).prior
assert prior["x"].shape == (1, 2, 3, 5)
assert prior["x"].shape == (1, 2, 3, 5, 7)
assert list(prior.coords["a"].values) == list(range(3))
assert list(prior.coords["b"].values) == list(range(5))
assert list(prior.coords["b"].values) == list(range(-5, 0))
assert list(prior.coords["c"].values) == list(range(7))

def test_set_data_indirect_resize_without_coords(self):
with pm.Model() as pmodel:
Expand Down

0 comments on commit 9792dff

Please sign in to comment.