File numpy125.patch of Package python-holoviews
From b3dc1c80656c1ce6dd6cea4ae2a48f815e0aefd7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= <simon.hansen@me.com>
Date: Tue, 29 Aug 2023 10:19:43 +0200
Subject: [PATCH 1/2] Support Numpy 1.25
---
holoviews/util/transform.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/holoviews/util/transform.py b/holoviews/util/transform.py
index 9ab375bb7a..7c91722557 100644
--- a/holoviews/util/transform.py
+++ b/holoviews/util/transform.py
@@ -193,9 +193,11 @@ def _python_isin(array, values):
python_isin = _maybe_map(_python_isin)
+# Type of numpy function like np.max changed in Numpy 1.25
+# from function to a numpy._ArrayFunctionDispatcher.
function_types = (
BuiltinFunctionType, BuiltinMethodType, FunctionType,
- MethodType, np.ufunc, iloc, loc
+ MethodType, np.ufunc, iloc, loc, type(np.max)
)
From 01daf32c320b871218cf1b16cbf9517050191bf8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= <simon.hansen@me.com>
Date: Wed, 30 Aug 2023 11:36:18 +0200
Subject: [PATCH 2/2] Change ops to self.ops
---
holoviews/util/transform.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/holoviews/util/transform.py b/holoviews/util/transform.py
index 7c91722557..9204c2c65d 100644
--- a/holoviews/util/transform.py
+++ b/holoviews/util/transform.py
@@ -253,7 +253,7 @@ class dim:
def __init__(self, obj, *args, **kwargs):
from panel.widgets import Widget
- ops = []
+ self.ops = []
self._ns = np.ndarray
self.coerce = kwargs.get('coerce', True)
if isinstance(obj, str):
@@ -266,7 +266,7 @@ def __init__(self, obj, *args, **kwargs):
self.dimension = obj.param.value
else:
self.dimension = obj.dimension
- ops = obj.ops
+ self.ops = obj.ops
if args:
fn = args[0]
else:
@@ -276,9 +276,8 @@ def __init__(self, obj, *args, **kwargs):
any(fn in funcs for funcs in self._all_funcs)):
raise ValueError('Second argument must be a function, '
'found %s type' % type(fn))
- ops = ops + [{'args': args[1:], 'fn': fn, 'kwargs': kwargs,
+ self.ops = self.ops + [{'args': args[1:], 'fn': fn, 'kwargs': kwargs,
'reverse': kwargs.pop('reverse', False)}]
- self.ops = ops
def __getstate__(self):
return self.__dict__