From 4e9fb75c1f6b5c150a81ad7749aff2995c4c638b Mon Sep 17 00:00:00 2001 From: Hanjin Liu Date: Sat, 1 Jun 2024 08:44:01 +0900 Subject: [PATCH] fix numpy v2 --- impy/core.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/impy/core.py b/impy/core.py index 9fb374d..17eaa79 100644 --- a/impy/core.py +++ b/impy/core.py @@ -121,8 +121,11 @@ def array( dtype = arr.dtype axes, name = _normalize_params(axes, name, like) - - _arr = np.array(arr, dtype=dtype, copy=copy) + + if copy: + _arr = np.array(arr, dtype=dtype) + else: + _arr = np.asarray(arr, dtype=dtype) # Automatically determine axes if axes is None: