Skip to content

Bump PyMC version requirement #431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- nodefaults
dependencies:
- pymc>=5.20
- pymc>=5.21
- pytest-cov>=2.5
- pytest>=3.0
- dask
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 @@ -10,7 +10,7 @@ dependencies:
- xhistogram
- statsmodels
- numba<=0.60.0
- pymc>=5.20
- pymc>=5.21
- pip:
- blackjax
- scikit-learn
Expand Down
4 changes: 2 additions & 2 deletions pymc_extras/statespace/core/statespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def _insert_random_variables(self):
with pymc_model:
for param_name in self.param_names:
param = getattr(pymc_model, param_name, None)
if param:
if param is not None:
found_params.append(param.name)

missing_params = list(set(self.param_names) - set(found_params))
Expand Down Expand Up @@ -746,7 +746,7 @@ def _insert_data_variables(self):
with pymc_model:
for data_name in data_names:
data = getattr(pymc_model, data_name, None)
if data:
if data is not None:
found_data.append(data.name)

missing_data = list(set(data_names) - set(found_data))
Expand Down
25 changes: 2 additions & 23 deletions pymc_extras/statespace/filters/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,8 @@ class MvNormalSVD(MvNormal):
A JAX MvNormal robust to low-rank covariance matrices
"""

rv_op = MvNormalSVDRV()


try:
import jax.random

from pytensor.link.jax.dispatch.random import jax_sample_fn

@jax_sample_fn.register(MvNormalSVDRV)
def jax_sample_fn_mvnormal_svd(op, node):
def sample_fn(rng, size, dtype, *parameters):
rng_key = rng["jax_state"]
rng_key, sampling_key = jax.random.split(rng_key, 2)
sample = jax.random.multivariate_normal(
sampling_key, *parameters, shape=size, dtype=dtype, method="svd"
)
rng["jax_state"] = rng_key
return (rng, sample)

return sample_fn

except ImportError:
pass
# TODO: Remove this entirely on next PyMC release; method will be exposed directly in MvNormal
rv_op = MvNormalSVDRV(method="svd")


class LinearGaussianStateSpaceRV(SymbolicRandomVariable):
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ filterwarnings =[

# Warning coming from blackjax
'ignore:jax\.tree_map is deprecated:DeprecationWarning',

# Ignore PyMC use of numpy.core
'ignore:numpy\.core\.numeric is deprecated:DeprecationWarning',
]

[tool.coverage.report]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pymc>=5.20
pymc>=5.21
scikit-learn
better-optimize