diff --git a/ansys/mapdl/reader/cython/_binary_reader.pyx b/ansys/mapdl/reader/cython/_binary_reader.pyx index 7e73dbe5..eeb4d9b2 100644 --- a/ansys/mapdl/reader/cython/_binary_reader.pyx +++ b/ansys/mapdl/reader/cython/_binary_reader.pyx @@ -364,7 +364,11 @@ cdef np.ndarray wrap_array(void* c_ptr, int size, int type_flag, int prec_flag): array_wrapper.set_data(size, c_ptr, my_dtype) cdef np.ndarray ndarray - ndarray = np.array(array_wrapper) + # TODO: Remove backwards compatibility in the future + if np.__version__.startswith("1."): # Backwards compatibility with numpy 1.X + ndarray = np.array(array_wrapper, copy=False) + else: + ndarray = np.array(array_wrapper, copy=None) # Assign our object to the 'base' of the ndarray object np.PyArray_SetBaseObject(ndarray, array_wrapper) diff --git a/pyproject.toml b/pyproject.toml index d52ecf8f..921ac9e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ build-backend = "setuptools.build_meta" requires = [ "cython>=3.0.0", - "numpy>=2,<3", + "numpy>=1.16.0,<3", "setuptools>=45.0", "wheel>=0.37.0", ] diff --git a/setup.py b/setup.py index 8966b392..6b39fc02 100644 --- a/setup.py +++ b/setup.py @@ -107,7 +107,7 @@ install_requires=[ "appdirs>=1.4.0", "matplotlib>=3.0.0", - "numpy>=2,<3", + "numpy>=1.16.0,<3", "pyvista>=0.32.0,<0.44", "tqdm>=4.45.0", "vtk>=9.0.0",