Skip to content

Commit 953f4bc

Browse files
twieckiclaude
andcommitted
Continue PyMC v5 migration: Fix remaining import issues
Fixed critical import errors: - Updated assert_moment_is_expected → assert_support_point_is_expected - Updated pymc_random_discrete → discrete_random_tester - Updated pymc.sampling_jax → pymc.sampling.jax - Fixed deprecated pytensor.tensor.var → pytensor.tensor.variable Test Results: - 563 tests passing ✓ - Import errors resolved - Remaining failures are API compatibility issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent eb25a94 commit 953f4bc

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

homepy/models/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
from pytensor import tensor as pt
3434
from pytensor.compile import SharedVariable
35-
from pytensor.tensor.var import TensorVariable
35+
from pytensor.tensor.variable import TensorVariable
3636
from fastprogress import progress_bar as _progress_bar
3737
from matplotlib import pyplot as plt
3838
from pymc.sampling import compile_forward_sampling_function

homepy/nested_hierarchy_rvs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import pymc as pm
2222

2323
from pytensor import tensor as pt
24-
from pytensor.tensor.var import TensorVariable
24+
from pytensor.tensor.variable import TensorVariable
2525
from pymc.model import Model
2626

2727
from homepy.nested_hierarchy_utils import DimName, Indexes, NestedHierarchy

homepy/tests/blocks/test_distributions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
BaseTestDistributionRandom,
3535
Domain,
3636
Rplus,
37-
assert_moment_is_expected,
38-
pymc_random_discrete,
37+
assert_support_point_is_expected,
38+
discrete_random_tester,
3939
)
4040

4141

@@ -217,7 +217,7 @@ class TestRandomVariable(BaseTestDistributionRandom):
217217
]
218218

219219
def test_random_matches_poisson(self):
220-
pymc_random_discrete(
220+
discrete_random_tester(
221221
dist=self.pymc_dist,
222222
paramdomains={"mu": Rplus, "lam": Domain([0], edges=(None, None))},
223223
ref_rand=lambda mu, lam, size: scipy.stats.poisson.rvs(mu, size=size),
@@ -295,4 +295,4 @@ def test_logp_lam_expected_moments(self):
295295
def test_moment(self, mu, lam, size, expected):
296296
with pm.Model() as model:
297297
GeneralizedPoisson("x", mu=mu, lam=lam, size=size)
298-
assert_moment_is_expected(model, expected)
298+
assert_support_point_is_expected(model, expected)

homepy/tests/test_jax_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import numpy as np
2020

2121
from pytensor import tensor as pt
22-
from pymc.sampling_jax import get_jaxified_graph
22+
from pymc.sampling.jax import get_jaxified_graph
2323

2424

2525
def test_reshape():

homepy/tests/test_nested_hierarchy_rvs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import pymc as pm
2323
import pytest
2424

25-
from pytensor.tensor.var import TensorVariable
25+
from pytensor.tensor.variable import TensorVariable
2626
from homepy.nested_hierarchy_rvs import (
2727
make_hierarchical_coefs,
2828
make_hierarchical_weights,

0 commit comments

Comments
 (0)