From d7492823a76c635c596863efb5214fe569160eca Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Wed, 13 Mar 2024 14:16:15 +0100 Subject: [PATCH 1/5] fix deprecation warning: /Users/runner/work/dianna/dianna/dianna/utils/maskers.py:106: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.) https://github.com/dianna-ai/dianna/actions/runs/8250917332/job/22566702492#step:4:622 line 571 --- dianna/utils/maskers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dianna/utils/maskers.py b/dianna/utils/maskers.py index 0913b512..c8cbb190 100644 --- a/dianna/utils/maskers.py +++ b/dianna/utils/maskers.py @@ -104,7 +104,8 @@ def _determine_number_masked(p_keep: float, series_length: int) -> int: ceil = np.ceil(mean) if floor != ceil: user_requested_steps = int( - np.random.choice([floor, ceil], 1, p=[ceil - mean, mean - floor])) + np.random.choice([floor, ceil], 1, p=[ceil - mean, + mean - floor])[0]) else: user_requested_steps = int(floor) From 9f5f74e84aa9b9fca145280f25341d67efe031eb Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Wed, 13 Mar 2024 14:50:49 +0100 Subject: [PATCH 2/5] fix macos build See https://github.com/dianna-ai/dianna/actions/runs/8250917332/job/22566702492#step:4:622 All builds [3.9,3.11]X[win, ubuntu,mac] pass except (mac,3.9). I think it's because it is using a new tf version 2.16 where the others are using 2.15. I also replicated this behavior locally but couldn't completely pinpoint the cause. It may also have something to do with the tensorflow-probability version. --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 225f7c04..d55e6732 100644 --- a/setup.cfg +++ b/setup.cfg @@ -49,7 +49,7 @@ install_requires = tqdm xarray # tf and tfprob are required but not declared by onnx_tf - tensorflow >= 2.12 + tensorflow >= 2.12,<2.16 tensorflow_probability # https://setuptools.pypa.io/en/latest/userguide/datafiles.html#accessing-data-files-at-runtime importlib_resources;python_version<'3.10' From b2273c448bc918c59cdb168ad6b29f699073bee9 Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Wed, 13 Mar 2024 15:08:26 +0100 Subject: [PATCH 3/5] fix macos build See https://github.com/dianna-ai/dianna/actions/runs/8250917332/job/22566702492#step:4:622 All builds [3.9,3.11]X[win, ubuntu,mac] pass except (mac,3.9). I think it's because it is using a new tf version 2.16 where the others are using 2.15. I also replicated this behavior locally but couldn't completely pinpoint the cause. It may also have something to do with the tensorflow-probability version. Fixing tf-prob version <2.24 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index d55e6732..ffc5fca1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -50,7 +50,7 @@ install_requires = xarray # tf and tfprob are required but not declared by onnx_tf tensorflow >= 2.12,<2.16 - tensorflow_probability + tensorflow_probability <2.24 # https://setuptools.pypa.io/en/latest/userguide/datafiles.html#accessing-data-files-at-runtime importlib_resources;python_version<'3.10' From 0288635a54f0cdaec4a18c44cfa6c3b0e45a8e72 Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Wed, 13 Mar 2024 15:16:09 +0100 Subject: [PATCH 4/5] fix macos build See https://github.com/dianna-ai/dianna/actions/runs/8250917332/job/22566702492#step:4:622 All builds [3.9,3.11]X[win, ubuntu,mac] pass except (mac,3.9). I think it's because it is using a new tf version 2.16 where the others are using 2.15. I also replicated this behavior locally but couldn't completely pinpoint the cause. It may also have something to do with the tensorflow-probability version. Fixing tf-prob version <2.24 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index ffc5fca1..dbae75a6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -50,7 +50,7 @@ install_requires = xarray # tf and tfprob are required but not declared by onnx_tf tensorflow >= 2.12,<2.16 - tensorflow_probability <2.24 + tensorflow_probability <0.24 # https://setuptools.pypa.io/en/latest/userguide/datafiles.html#accessing-data-files-at-runtime importlib_resources;python_version<'3.10' From ba97404e131e03f987b21a6b95f24d0dcb3ebcde Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Wed, 13 Mar 2024 16:30:53 +0100 Subject: [PATCH 5/5] pin shap to 0.45 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index dbae75a6..94b6f89d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -43,7 +43,7 @@ install_requires = onnx==1.14.1 onnx_tf onnxruntime - shap + shap<0.45 scikit-image>=0.19.3 scikit-learn tqdm