File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1450,7 +1450,7 @@ def make_obs_var(
1450
1450
observed_rv_var .tag .observations = nonmissing_data
1451
1451
1452
1452
self .create_value_var (observed_rv_var , transform = None , value_var = nonmissing_data )
1453
- self .add_random_variable (observed_rv_var , dims )
1453
+ self .add_random_variable (observed_rv_var )
1454
1454
self .observed_RVs .append (observed_rv_var )
1455
1455
1456
1456
# Create deterministic that combines observed and missing
Original file line number Diff line number Diff line change @@ -1365,6 +1365,18 @@ def test_missing_symmetric(self):
1365
1365
assert x_obs_vv in logp_inputs
1366
1366
assert x_unobs_vv in logp_inputs
1367
1367
1368
+ def test_dims (self ):
1369
+ """Test that we don't propagate dims to the subcomponents of a partially
1370
+ observed RV
1371
+
1372
+ See https://github.com/pymc-devs/pymc/issues/6177
1373
+ """
1374
+ data = np .array ([np .nan ] * 3 + [0 ] * 7 )
1375
+ with pm .Model (coords = {"observed" : range (10 )}) as model :
1376
+ with pytest .warns (ImputationWarning ):
1377
+ x = pm .Normal ("x" , observed = data , dims = ("observed" ,))
1378
+ assert model .RV_dims == {"x" : ("observed" ,)}
1379
+
1368
1380
1369
1381
class TestShared (SeededTest ):
1370
1382
def test_deterministic (self ):
You can’t perform that action at this time.
0 commit comments