From 4f298433270cc88fb5229d7d9409e618e77000bf Mon Sep 17 00:00:00 2001 From: Michal Raczycki Date: Mon, 3 Apr 2023 10:37:58 +0100 Subject: [PATCH 1/6] added pytest.ini, added config to fail uncaught warnings --- pytest.ini | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 pytest.ini diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 00000000..90f72a1c --- /dev/null +++ b/pytest.ini @@ -0,0 +1,5 @@ +[pytest] +filterwarnings = + error + ignore:.*?(\b(pkg_resources\.declare_namespace)\b).*:DeprecationWarning + ignore::UserWarning:arviz.data.inference_data From 10c68ac46253a2b8d6e54f4b284cdcd1f8d9dcf3 Mon Sep 17 00:00:00 2001 From: Michal Raczycki Date: Mon, 10 Apr 2023 09:02:55 +0100 Subject: [PATCH 2/6] temporary blocking pkg_resources warning(Arviz) --- pymc_experimental/tests/test_pathfinder.py | 2 ++ pytest.ini | 1 + 2 files changed, 3 insertions(+) diff --git a/pymc_experimental/tests/test_pathfinder.py b/pymc_experimental/tests/test_pathfinder.py index 6d92e0dd..b7d6b084 100644 --- a/pymc_experimental/tests/test_pathfinder.py +++ b/pymc_experimental/tests/test_pathfinder.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import platform import sys import numpy as np @@ -21,6 +22,7 @@ import pymc_experimental as pmx +@pytest.mark.skipif(platform.machine() != "x86_64", reason="Test requires x86_64 architecture") @pytest.mark.skipif(sys.platform == "win32", reason="JAX not supported on windows.") def test_pathfinder(): # Data of the Eight Schools Model diff --git a/pytest.ini b/pytest.ini index 90f72a1c..ba9c51ad 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,3 +3,4 @@ filterwarnings = error ignore:.*?(\b(pkg_resources\.declare_namespace)\b).*:DeprecationWarning ignore::UserWarning:arviz.data.inference_data + ignore::DeprecationWarning:pkg_resources From c7a86ff6dead8d493c0a3b2f3710d0d78eb441c5 Mon Sep 17 00:00:00 2001 From: Michal Raczycki Date: Mon, 10 Apr 2023 09:18:48 +0100 Subject: [PATCH 3/6] fixing pathfinder deprecated model.rv_dim call --- pymc_experimental/inference/pathfinder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymc_experimental/inference/pathfinder.py b/pymc_experimental/inference/pathfinder.py index 1092341a..85c1981e 100644 --- a/pymc_experimental/inference/pathfinder.py +++ b/pymc_experimental/inference/pathfinder.py @@ -138,7 +138,7 @@ def one_step(state, rng_key): dims = { var_name: [dim for dim in dims if dim is not None] - for var_name, dims in model.RV_dims.items() + for var_name, dims in model.named_vars_to_dims.items() } idata = convert_flat_trace_to_idata( From 759d4b74cee7947a6b384b830b596a777e83846a Mon Sep 17 00:00:00 2001 From: Michal Raczycki Date: Tue, 11 Apr 2023 08:06:11 +0100 Subject: [PATCH 4/6] adding req fror numpy in setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index c2c71d21..171508ea 100644 --- a/setup.py +++ b/setup.py @@ -51,6 +51,7 @@ with open(REQUIREMENTS_FILE) as f: install_reqs = f.read().splitlines() +install_reqs += ["numpy"] with open(DEV_REQUIREMENTS_FILE) as f: dev_install_reqs = f.read().splitlines() From 0f516f2002cf98e6e7d3ebacf723595fdf75810a Mon Sep 17 00:00:00 2001 From: Michal Raczycki Date: Tue, 11 Apr 2023 08:11:54 +0100 Subject: [PATCH 5/6] Revert "adding req fror numpy in setup.py" This reverts commit 759d4b74cee7947a6b384b830b596a777e83846a. fixing commit made by mistake on this branch --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 171508ea..c2c71d21 100644 --- a/setup.py +++ b/setup.py @@ -51,7 +51,6 @@ with open(REQUIREMENTS_FILE) as f: install_reqs = f.read().splitlines() -install_reqs += ["numpy"] with open(DEV_REQUIREMENTS_FILE) as f: dev_install_reqs = f.read().splitlines() From 5669c16c872f6e01233a706aaa66540507dfc25f Mon Sep 17 00:00:00 2001 From: Michal Raczycki Date: Wed, 12 Apr 2023 10:11:23 +0100 Subject: [PATCH 6/6] removing redundant skipif for test --- pymc_experimental/tests/test_pathfinder.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pymc_experimental/tests/test_pathfinder.py b/pymc_experimental/tests/test_pathfinder.py index b7d6b084..6d92e0dd 100644 --- a/pymc_experimental/tests/test_pathfinder.py +++ b/pymc_experimental/tests/test_pathfinder.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import platform import sys import numpy as np @@ -22,7 +21,6 @@ import pymc_experimental as pmx -@pytest.mark.skipif(platform.machine() != "x86_64", reason="Test requires x86_64 architecture") @pytest.mark.skipif(sys.platform == "win32", reason="JAX not supported on windows.") def test_pathfinder(): # Data of the Eight Schools Model