Skip to content

Bump numpy version due to use of Generator.spawn only available in >=1.25 #7607

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 4 commits into from
Dec 5, 2024
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-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
- cachetools>=4.2.1
- cloudpickle
- h5py>=2.7
- numpy>=1.15.0
- numpy>=1.25.0
- pandas>=0.24.0
- pip
- pytensor>=2.26.2,<2.27
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 @@ -8,7 +8,7 @@ dependencies:
- arviz>=0.13.0
- cachetools>=4.2.1
- cloudpickle
- numpy>=1.15.0
- numpy>=1.25.0
- pandas>=0.24.0
- pip
- pytensor>=2.26.2,<2.27
Expand Down
2 changes: 1 addition & 1 deletion conda-envs/environment-jax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
- jaxlib>=0.4.28
- libblas=*=*mkl
- mkl-service
- numpy>=1.15.0
- numpy>=1.25.0
- numpyro>=0.8.0
- pandas>=0.24.0
- pip
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 @@ -11,7 +11,7 @@ dependencies:
- cloudpickle
- h5py>=2.7
- jax
- numpy>=1.15.0
- numpy>=1.25.0
- pandas>=0.24.0
- pip
- pytensor>=2.26.2,<2.27
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 @@ -10,7 +10,7 @@ dependencies:
- cachetools>=4.2.1
- cloudpickle
- h5py>=2.7
- numpy>=1.15.0
- numpy>=1.25.0
- pandas>=0.24.0
- pip
- pytensor>=2.26.2,<2.27
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 @@ -13,7 +13,7 @@ dependencies:
- libpython
- mkl-service>=2.3.0
- m2w64-toolchain
- numpy>=1.15.0
- numpy>=1.25.0
- pandas>=0.24.0
- pip
- pytensor>=2.26.2,<2.27
Expand Down
16 changes: 12 additions & 4 deletions pymc/sampling/mcmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,10 +528,8 @@
random_seed : int, array-like of int, or Generator, optional
Random seed(s) used by the sampling steps. Each step will create its own
:py:class:`~numpy.random.Generator` object to make its random draws in a way that is
indepedent from all other steppers and all other chains. If a list, tuple or array of ints
is passed, each entry will be used to seed the creation of ``Generator`` objects.
A ``ValueError`` will be raised if the length does not match the number of chains.
A ``TypeError`` will be raised if a :py:class:`~numpy.random.RandomState` object is passed.
indepedent from all other steppers and all other chains.
A ``TypeError`` will be raised if a legacy :py:class:`~numpy.random.RandomState` object is passed.
We no longer support ``RandomState`` objects because their seeding mechanism does not allow
easy spawning of new independent random streams that are needed by the step methods.
progressbar : bool, optional default=True
Expand Down Expand Up @@ -729,7 +727,17 @@
)

if random_seed == -1:
warnings.warn(

Check warning on line 730 in pymc/sampling/mcmc.py

View check run for this annotation

Codecov / codecov/patch

pymc/sampling/mcmc.py#L730

Added line #L730 was not covered by tests
"Setting random_seed = -1 is deprecated. Pass `None` to not specify a seed.",
FutureWarning,
)
random_seed = None
elif isinstance(random_seed, tuple | list):
warnings.warn(
"A list or tuple of random_seed no longer specifies the specific random_seed of each chain. "
"Use a single seed instead.",
UserWarning,
)
rngs = get_random_generator(random_seed).spawn(chains)
random_seed_list = [rng.integers(2**30) for rng in rngs]

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mcbackend>=0.4.0
mypy==1.5.1
myst-nb<=1.0.0
numdifftools>=0.9.40
numpy>=1.15.0
numpy>=1.25.0
numpydoc
pandas>=0.24.0
polyagamma
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
arviz>=0.13.0
cachetools>=4.2.1
cloudpickle
numpy>=1.15.0
numpy>=1.25.0
pandas>=0.24.0
pytensor>=2.26.1,<2.27
rich>=13.7.1
Expand Down
2 changes: 1 addition & 1 deletion tests/distributions/test_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def test_multivariate_insufficient_signature(self):
with pytest.raises(
NotImplementedError, match="signature is not sufficient to infer the support shape"
):
CustomDist.dist(signature="(n)->(m)")
CustomDist.dist([0], signature="(n)->(m)")


class TestCustomSymbolicDist:
Expand Down
Loading