Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conda-envs/environment-alternative-backends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies:
- numpyro>=0.8.0
- pandas>=0.24.0
- pip
- pytensor>=2.31.7,<2.32
- pytensor>=2.32.0,<2.33
- python-graphviz
- networkx
- rich>=13.7.1
Expand Down
2 changes: 1 addition & 1 deletion conda-envs/environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
- numpy>=1.25.0
- pandas>=0.24.0
- pip
- pytensor>=2.31.7,<2.32
- pytensor>=2.32.0,<2.33
- python-graphviz
- networkx
- scipy>=1.4.1
Expand Down
2 changes: 1 addition & 1 deletion conda-envs/environment-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
- numpy>=1.25.0
- pandas>=0.24.0
- pip
- pytensor>=2.31.7,<2.32
- pytensor>=2.32.0,<2.33
- python-graphviz
- rich>=13.7.1
- scipy>=1.4.1
Expand Down
2 changes: 1 addition & 1 deletion conda-envs/environment-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
- pandas>=0.24.0
- pip
- polyagamma
- pytensor>=2.31.7,<2.32
- pytensor>=2.32.0,<2.33
- python-graphviz
- networkx
- rich>=13.7.1
Expand Down
2 changes: 1 addition & 1 deletion conda-envs/windows-environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
- numpy>=1.25.0
- pandas>=0.24.0
- pip
- pytensor>=2.31.7,<2.32
- pytensor>=2.32.0,<2.33
- python-graphviz
- networkx
- rich>=13.7.1
Expand Down
2 changes: 1 addition & 1 deletion conda-envs/windows-environment-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
- pandas>=0.24.0
- pip
- polyagamma
- pytensor>=2.31.7,<2.32
- pytensor>=2.32.0,<2.33
- python-graphviz
- networkx
- rich>=13.7.1
Expand Down
2 changes: 1 addition & 1 deletion pymc/distributions/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@ def support_point(rv, size, b, kappa, mu):

def logp(value, b, kappa, mu):
value = value - mu
res = pt.log(b / (kappa + (kappa**-1))) + (
res = pt.log(b / (kappa + pt.reciprocal(kappa))) + (
-value * b * pt.sign(value) * (kappa ** pt.sign(value))
)

Expand Down
4 changes: 2 additions & 2 deletions pymc/logprob/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import pytensor.tensor as pt

from pytensor.graph.rewriting.basic import node_rewriter
from pytensor.tensor.math import _matrix_matrix_matmul
from pytensor.tensor.math import _matmul

from pymc.logprob.abstract import MeasurableBlockwise, MeasurableOp, _logprob, _logprob_helper
from pymc.logprob.rewriting import measurable_ir_rewrites_db
Expand Down Expand Up @@ -55,7 +55,7 @@ def logprob_measurable_matmul(op, values, l, r): # noqa: E741
return x_logp - log_abs_jac_det


@node_rewriter(tracks=[_matrix_matrix_matmul])
@node_rewriter(tracks=[_matmul])
def find_measurable_matmul(fgraph, node):
"""Find measurable matrix-matrix multiplication operations."""
if isinstance(node.op, MeasurableOp):
Expand Down
2 changes: 1 addition & 1 deletion pymc/ode/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def augment_system(ode_func, n_states, n_theta):
Augemted system of differential equations.
"""
# Present state of the system
t_y = pt.vector("y", dtype="float64")
t_y = pt.vector("y", dtype="float64", shape=(n_states,))
t_y.tag.test_value = np.ones((n_states,), dtype="float64")
# Parameter(s). Should be vector to allow for generaliztion to multiparameter
# systems of ODEs. Is m dimensional because it includes all initial conditions as well as ode parameters
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pandas>=0.24.0
polyagamma
pre-commit>=2.8.0
pymc-sphinx-theme>=0.16.0
pytensor>=2.31.7,<2.32
pytensor>=2.32.0,<2.33
pytest-cov>=2.5
pytest>=3.0
rich>=13.7.1
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cachetools>=4.2.1
cloudpickle
numpy>=1.25.0
pandas>=0.24.0
pytensor>=2.31.7,<2.32
pytensor>=2.32.0,<2.33
rich>=13.7.1
scipy>=1.4.1
threadpoolctl>=3.1.0,<4.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/distributions/test_dist_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_check_parameters(conditions, succeeds):
if succeeds:
assert ret.eval()
else:
with pytest.raises(ParameterValueError, match="^parameter check msg$"):
with pytest.raises(ParameterValueError, match="^parameter check msg*"):
ret.eval()


Expand Down
2 changes: 1 addition & 1 deletion tests/distributions/test_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def test_multivariate_shared_mask_separable(self):
obs_logp, unobs_logp = logp_fn()
expected_logp = pm.logp(rv, unobs_data).eval()
np.testing.assert_almost_equal(obs_logp, [])
np.testing.assert_array_equal(unobs_logp, expected_logp)
np.testing.assert_almost_equal(unobs_logp, expected_logp)

# Test that we can update a shared mask
mask.set_value(np.array([False]))
Expand Down
6 changes: 3 additions & 3 deletions tests/logprob/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,10 @@ def test_measurable_power_exponent_with_constant_base():

np.testing.assert_allclose(x_logp_fn_pow(0.1), x_logp_fn_exp2(0.1))

x_rv_neg = pt.pow(-2, pt.random.normal())
x_vv_neg = x_rv_neg.clone()
with pytest.raises(ParameterValueError, match="base >= 0"):
x_rv_neg = pt.pow(-2, pt.random.normal())
x_vv_neg = x_rv_neg.clone()
logp(x_rv_neg, x_vv_neg)
logp(x_rv_neg, x_vv_neg).eval({x_vv_neg: 1.5})


def test_measurable_power_exponent_with_variable_base():
Expand Down
4 changes: 3 additions & 1 deletion tests/ode/test_ode.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,9 @@ def system(y, t, p):
warnings.filterwarnings(
"ignore", "invalid value encountered in log", RuntimeWarning
)
idata = pm.sample(50, tune=0, chains=1)
idata = pm.sample(
50, tune=0, chains=1, progressbar=False, compute_convergence_checks=False
)

assert idata.posterior["R"].shape == (1, 50)
assert idata.posterior["sigma"].shape == (1, 50, 2)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def setup_class(self):
("plain", True): [
r"alpha ~ Normal(0, 10)",
r"sigma ~ HalfNormal(0, 1)",
r"mu ~ Deterministic(f(beta, alpha))",
r"mu ~ Deterministic(f(alpha, beta))",
r"beta ~ Normal(0, 10)",
r"Z ~ MultivariateNormal(f(), f())",
r"nb_with_p_n ~ NegativeBinomial(10, nbp)",
Expand All @@ -149,7 +149,7 @@ def setup_class(self):
r"Censored(Bernoulli(0.5), -1, 1))"
),
r"Y_obs ~ Normal(mu, sigma)",
r"pot ~ Potential(f(beta, alpha))",
r"pot ~ Potential(f(alpha, beta))",
r"pred ~ Deterministic(f(<normal>))",
],
("plain", False): [
Expand All @@ -169,7 +169,7 @@ def setup_class(self):
("latex", True): [
r"$\text{alpha} \sim \operatorname{Normal}(0,~10)$",
r"$\text{sigma} \sim \operatorname{HalfNormal}(0,~1)$",
r"$\text{mu} \sim \operatorname{Deterministic}(f(\text{beta},~\text{alpha}))$",
r"$\text{mu} \sim \operatorname{Deterministic}(f(\text{alpha},~\text{beta}))$",
r"$\text{beta} \sim \operatorname{Normal}(0,~10)$",
r"$\text{Z} \sim \operatorname{MultivariateNormal}(f(),~f())$",
r"$\text{nb\_with\_p\_n} \sim \operatorname{NegativeBinomial}(10,~\text{nbp})$",
Expand All @@ -181,7 +181,7 @@ def setup_class(self):
r"~\operatorname{Censored}(\operatorname{Bernoulli}(0.5),~-1,~1))$"
),
r"$\text{Y\_obs} \sim \operatorname{Normal}(\text{mu},~\text{sigma})$",
r"$\text{pot} \sim \operatorname{Potential}(f(\text{beta},~\text{alpha}))$",
r"$\text{pot} \sim \operatorname{Potential}(f(\text{alpha},~\text{beta}))$",
r"$\text{pred} \sim \operatorname{Deterministic}(f(\text{<normal>}))",
],
("latex", False): [
Expand Down
Loading