From 37dba3296e89a9ae632f010aa165bcfd0fd70bc0 Mon Sep 17 00:00:00 2001 From: David Zwicker Date: Mon, 17 Jun 2024 17:29:15 +0200 Subject: [PATCH] Fixed type issues because we support numpy 1 and 2 --- pde/tools/misc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pde/tools/misc.py b/pde/tools/misc.py index 1dbf8e7b..d8a988ce 100644 --- a/pde/tools/misc.py +++ b/pde/tools/misc.py @@ -389,15 +389,15 @@ def number_array( # dtype needs to be determined automatically try: # convert the result to a numpy array with the given dtype - result = np.array(data, dtype=get_common_dtype(data), copy=copy) + result = np.array(data, dtype=get_common_dtype(data), copy=copy) # type: ignore except TypeError: # Conversion can fail when `data` contains a complex sympy number, i.e., # sympy.I. In this case, we simply try to convert the expression using a # complex dtype - result = np.array(data, dtype=np.cdouble, copy=copy) + result = np.array(data, dtype=np.cdouble, copy=copy) # type: ignore else: # a specific dtype is requested - result = np.array(data, dtype=np.dtype(dtype), copy=copy) + result = np.array(data, dtype=np.dtype(dtype), copy=copy) # type: ignore return result