Skip to content

Commit 0c8be0a

Browse files
committed
Test on last release of PyMC instead of main
1 parent 66df0dc commit 0c8be0a

File tree

6 files changed

+6
-15
lines changed

6 files changed

+6
-15
lines changed

conda-envs/environment-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ channels:
44
- defaults
55
dependencies:
66
- pip
7+
- pymc>=5.1.2
78
- pytest-cov>=2.5
89
- pytest>=3.0
910
- dask
1011
- xhistogram
1112
- pip:
12-
- "git+https://github.com/pymc-devs/pymc.git@main"
1313
- blackjax

conda-envs/windows-environment-test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ channels:
44
- defaults
55
dependencies:
66
- pip
7+
- pymc>=5.1.2
78
- pytest-cov>=2.5
89
- pytest>=3.0
910
- dask
1011
- xhistogram
11-
- pip:
12-
- "git+https://github.com/pymc-devs/pymc.git@main"

pymc_experimental/marginal_model.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ def _delete_rv_mappings(self, rv: TensorVariable) -> None:
9393
self.rvs_to_initial_values.pop(rv)
9494
else:
9595
self.observed_RVs.remove(rv)
96-
if rv in self.rvs_to_total_sizes:
97-
self.rvs_to_total_sizes.pop(rv)
9896

9997
def _transfer_rv_mappings(self, old_rv: TensorVariable, new_rv: TensorVariable) -> None:
10098
"""Transfer model mappings from old_rv to new_rv"""
@@ -122,8 +120,6 @@ def _transfer_rv_mappings(self, old_rv: TensorVariable, new_rv: TensorVariable)
122120
index = self.observed_RVs.index(old_rv)
123121
self.observed_RVs.pop(index)
124122
self.observed_RVs.insert(index, new_rv)
125-
if old_rv in self.rvs_to_total_sizes:
126-
self.rvs_to_total_sizes[new_rv] = self.rvs_to_total_sizes.pop(old_rv)
127123

128124
def _marginalize(self, user_warnings=False):
129125
fg = FunctionGraph(outputs=self.basic_RVs + self.marginalized_rvs, clone=False)
@@ -212,10 +208,6 @@ def clone(self):
212208
m.values_to_rvs = {i: vars_to_clone[rv] for i, rv in self.values_to_rvs.items()}
213209
m.rvs_to_values = {vars_to_clone[rv]: i for rv, i in self.rvs_to_values.items()}
214210
m.rvs_to_transforms = {vars_to_clone[rv]: i for rv, i in self.rvs_to_transforms.items()}
215-
# Special logic due to bug in pm.Model
216-
m.rvs_to_total_sizes = {
217-
vars_to_clone[rv]: i for rv, i in self.rvs_to_total_sizes.items() if rv in vars_to_clone
218-
}
219211
m.rvs_to_initial_values = {
220212
vars_to_clone[rv]: i for rv, i in self.rvs_to_initial_values.items()
221213
}

pymc_experimental/tests/distributions/test_continuous.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import scipy.stats.distributions as sp
2222

2323
# test support imports from pymc
24-
from pymc.tests.distributions.util import (
24+
from pymc.testing import (
2525
BaseTestDistributionRandom,
2626
Domain,
2727
R,
@@ -30,8 +30,8 @@
3030
check_logcdf,
3131
check_logp,
3232
seeded_scipy_distribution_builder,
33+
select_by_precision,
3334
)
34-
from pymc.tests.helpers import select_by_precision
3535

3636
# the distributions to be tested
3737
from pymc_experimental.distributions import GenExtreme

pymc_experimental/tests/test_marginal_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def test_nested_marginalized_rvs():
170170
sigma = pm.HalfNormal("sigma")
171171

172172
idx = pm.Bernoulli("idx", p=0.75)
173-
dep = pm.Normal("dep", mu=pt.switch(pt.eq(idx, 0), -1000, 1000), sigma=sigma)
173+
dep = pm.Normal("dep", mu=pt.switch(pt.eq(idx, 0), -1000.0, 1000.0), sigma=sigma)
174174

175175
sub_idx = pm.Bernoulli("sub_idx", p=pt.switch(pt.eq(idx, 0), 0.15, 0.95), shape=(5,))
176176
sub_dep = pm.Normal("sub_dep", mu=dep + sub_idx * 100, sigma=sigma, shape=(5,))

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pymc>=5.0.0
1+
pymc>=5.1.2

0 commit comments

Comments
 (0)