Skip to content

Commit a942b6e

Browse files
committed
Test case to check the dims in potential
1 parent 72f16ee commit a942b6e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_model.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,16 @@ def test_deterministic():
10621062
assert model["y"] == y
10631063

10641064

1065+
def test_potential_with_dims():
1066+
"""
1067+
Test to check the passing of dims to the potential
1068+
"""
1069+
with pm.Model(coords={"observed": range(10)}) as model:
1070+
x = pm.Normal("x", 0, 1)
1071+
y = pm.Deterministic("y", x**2, dims=("observed",))
1072+
assert model.named_vars_to_dims == {"y": ("observed",)}
1073+
1074+
10651075
def test_empty_model_representation():
10661076
assert pm.Model().str_repr() == ""
10671077

0 commit comments

Comments
 (0)