From 1a0333df6a66d73809badae0ecfbaf0fe1e27d33 Mon Sep 17 00:00:00 2001 From: jake <110916952+lucid-jake@users.noreply.github.com> Date: Mon, 2 Dec 2024 12:22:16 +0100 Subject: [PATCH 1/2] [Fix MWEM.py] Removed deprecated numpy .product() call --- synth/snsynth/mwem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synth/snsynth/mwem.py b/synth/snsynth/mwem.py index 9d300ff8..072a94fc 100644 --- a/synth/snsynth/mwem.py +++ b/synth/snsynth/mwem.py @@ -1,4 +1,4 @@ -import math +zimport math import random from typing import List import warnings @@ -573,7 +573,7 @@ def _histogram_from_data_attributes(self, data, splits=[]): # our ranges above if any([a > 0 for a in mins_data]): warnings.warn("Data should be preprocessed to have 0 based indices.") - dimensionality = np.product(dims_sizes) + dimensionality = np.prod(dims_sizes) if dimensionality > 1e8: warnings.warn(f"Dimensionality of histogram is {dimensionality:,}, consider using splits.") histogram, bins = np.histogramdd(split_data, bins=dims_sizes) From 355e7ccd75f9360be5f93723e45769d22e5d1d43 Mon Sep 17 00:00:00 2001 From: jake <110916952+lucid-jake@users.noreply.github.com> Date: Mon, 2 Dec 2024 12:24:10 +0100 Subject: [PATCH 2/2] Update mwem.py whoops --- synth/snsynth/mwem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synth/snsynth/mwem.py b/synth/snsynth/mwem.py index 072a94fc..0ad1ac84 100644 --- a/synth/snsynth/mwem.py +++ b/synth/snsynth/mwem.py @@ -1,4 +1,4 @@ -zimport math +import math import random from typing import List import warnings