From be770a6e7dc1ffc21101a667bcf7a6d625b7b52d Mon Sep 17 00:00:00 2001 From: Ricardo Vieira Date: Tue, 25 Jun 2024 19:38:02 +0200 Subject: [PATCH] Test multiple `None` dims work together --- tests/model/test_core.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/model/test_core.py b/tests/model/test_core.py index 95ce3265ebe..0c4773831c4 100644 --- a/tests/model/test_core.py +++ b/tests/model/test_core.py @@ -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: