1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
From: Antonio Valentino <antonio.valentino@tiscali.it>
Date: Sat, 17 May 2025 16:16:56 +0000
Subject: Fix unitests on 32bit architectures
Forwarded: https://github.com/ml31415/numpy-groupies/pull/94
---
numpy_groupies/utils.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/numpy_groupies/utils.py b/numpy_groupies/utils.py
index 56befb5..ac695d4 100644
--- a/numpy_groupies/utils.py
+++ b/numpy_groupies/utils.py
@@ -1,5 +1,6 @@
"""Common functionality for all aggregate implementations."""
+import platform
import numpy as np
aggregate_common_doc = """
@@ -258,6 +259,22 @@ _forced_types = {
"nanargmin": np.int64,
"nanargmax": np.int64,
}
+if platform.architecture()[0] == "32bit":
+ _forced_types = {
+ "array": object,
+ "all": bool,
+ "any": bool,
+ "nanall": bool,
+ "nanany": bool,
+ "len": np.int32,
+ "nanlen": np.int32,
+ "allnan": bool,
+ "anynan": bool,
+ "argmax": np.int32,
+ "argmin": np.int32,
+ "nanargmin": np.int32,
+ "nanargmax": np.int32,
+ }
_forced_float_types = {"mean", "var", "std", "nanmean", "nanvar", "nanstd"}
_forced_same_type = {
"min",
|