From e52b2f7987f00fedaa7f4e5dc7cb96cf2e28126d Mon Sep 17 00:00:00 2001 From: Ricardo Date: Wed, 3 Nov 2021 11:38:00 +0100 Subject: [PATCH] Update Aesara dependency and add regression test for #5090 --- conda-envs/environment-dev-py37.yml | 2 +- conda-envs/environment-dev-py38.yml | 2 +- conda-envs/environment-dev-py39.yml | 2 +- conda-envs/environment-test-py37.yml | 2 +- conda-envs/environment-test-py38.yml | 2 +- conda-envs/environment-test-py39.yml | 2 +- conda-envs/windows-environment-dev-py38.yml | 2 +- conda-envs/windows-environment-test-py38.yml | 2 +- pymc/tests/test_initial_point.py | 10 ++++++++++ requirements-dev.txt | 2 +- requirements.txt | 2 +- 11 files changed, 20 insertions(+), 10 deletions(-) diff --git a/conda-envs/environment-dev-py37.yml b/conda-envs/environment-dev-py37.yml index f8cfd8339d7..3d56ab3cea9 100644 --- a/conda-envs/environment-dev-py37.yml +++ b/conda-envs/environment-dev-py37.yml @@ -5,7 +5,7 @@ channels: - defaults dependencies: - aeppl>=0.0.13 -- aesara>=2.2.2 +- aesara>=2.2.6 - arviz>=0.11.4 - cachetools>=4.2.1 - cloudpickle diff --git a/conda-envs/environment-dev-py38.yml b/conda-envs/environment-dev-py38.yml index 392a34cdba8..bd4ea5fe1f0 100644 --- a/conda-envs/environment-dev-py38.yml +++ b/conda-envs/environment-dev-py38.yml @@ -5,7 +5,7 @@ channels: - defaults dependencies: - aeppl>=0.0.13 -- aesara>=2.2.2 +- aesara>=2.2.6 - arviz>=0.11.4 - cachetools>=4.2.1 - cloudpickle diff --git a/conda-envs/environment-dev-py39.yml b/conda-envs/environment-dev-py39.yml index 061bb29e4bb..0915288e8cb 100644 --- a/conda-envs/environment-dev-py39.yml +++ b/conda-envs/environment-dev-py39.yml @@ -5,7 +5,7 @@ channels: - defaults dependencies: - aeppl>=0.0.13 -- aesara>=2.2.2 +- aesara>=2.2.6 - arviz>=0.11.4 - cachetools>=4.2.1 - cloudpickle diff --git a/conda-envs/environment-test-py37.yml b/conda-envs/environment-test-py37.yml index 43897617eba..d5d83fa4fdc 100644 --- a/conda-envs/environment-test-py37.yml +++ b/conda-envs/environment-test-py37.yml @@ -5,7 +5,7 @@ channels: - defaults dependencies: - aeppl>=0.0.13 -- aesara>=2.2.2 +- aesara>=2.2.6 - arviz>=0.11.4 - cachetools>=4.2.1 - cloudpickle diff --git a/conda-envs/environment-test-py38.yml b/conda-envs/environment-test-py38.yml index 46bcec686c9..799cbb16947 100644 --- a/conda-envs/environment-test-py38.yml +++ b/conda-envs/environment-test-py38.yml @@ -5,7 +5,7 @@ channels: - defaults dependencies: - aeppl>=0.0.13 -- aesara>=2.2.2 +- aesara>=2.2.6 - arviz>=0.11.4 - cachetools>=4.2.1 - cloudpickle diff --git a/conda-envs/environment-test-py39.yml b/conda-envs/environment-test-py39.yml index b3ff62d7487..21e0d84a078 100644 --- a/conda-envs/environment-test-py39.yml +++ b/conda-envs/environment-test-py39.yml @@ -5,7 +5,7 @@ channels: - defaults dependencies: - aeppl>=0.0.13 -- aesara>=2.2.2 +- aesara>=2.2.6 - arviz>=0.11.4 - cachetools - cloudpickle diff --git a/conda-envs/windows-environment-dev-py38.yml b/conda-envs/windows-environment-dev-py38.yml index 2f143a72af0..73080e6e2df 100644 --- a/conda-envs/windows-environment-dev-py38.yml +++ b/conda-envs/windows-environment-dev-py38.yml @@ -5,7 +5,7 @@ channels: dependencies: # base dependencies (see install guide for Windows) - aeppl>=0.0.13 -- aesara>=2.2.2 +- aesara>=2.2.6 - arviz>=0.11.4 - cachetools>=4.2.1 - cloudpickle diff --git a/conda-envs/windows-environment-test-py38.yml b/conda-envs/windows-environment-test-py38.yml index 490e402c632..d990aea261d 100644 --- a/conda-envs/windows-environment-test-py38.yml +++ b/conda-envs/windows-environment-test-py38.yml @@ -5,7 +5,7 @@ channels: dependencies: # base dependencies (see install guide for Windows) - aeppl>=0.0.13 -- aesara>=2.2.2 +- aesara>=2.2.6 - arviz>=0.11.2 - cachetools - cloudpickle diff --git a/pymc/tests/test_initial_point.py b/pymc/tests/test_initial_point.py index 815fd0927a6..6aa121d4709 100644 --- a/pymc/tests/test_initial_point.py +++ b/pymc/tests/test_initial_point.py @@ -13,6 +13,7 @@ # limitations under the License. import aesara import aesara.tensor as at +import cloudpickle import numpy as np import pytest @@ -218,3 +219,12 @@ def test_moment_from_dims(self, rv_cls): assert not hasattr(rv.tag, "test_value") assert tuple(get_moment(rv).shape.eval()) == (4, 3) pass + + +def test_pickling_issue_5090(): + with pm.Model() as model: + pm.Normal("x", initval="prior") + ip_before = model.recompute_initial_point(seed=5090) + model = cloudpickle.loads(cloudpickle.dumps(model)) + ip_after = model.recompute_initial_point(seed=5090) + assert ip_before["x"] == ip_after["x"] diff --git a/requirements-dev.txt b/requirements-dev.txt index af6ab3af721..14695158cdf 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ # See that file for comments about the need/usage of each dependency. aeppl>=0.0.13 -aesara>=2.2.2 +aesara>=2.2.6 arviz>=0.11.4 cachetools>=4.2.1 cloudpickle diff --git a/requirements.txt b/requirements.txt index 43acbf3e409..34202e5ab1c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ aeppl>=0.0.13 -aesara>=2.2.2 +aesara>=2.2.6 arviz>=0.11.4 cachetools>=4.2.1 cloudpickle