Merge pull request #102 from pkgw/numpy-2
Update for Numpy 2.0 compatibility
This commit is contained in:
Коммит
6b5c0c2217
|
@ -16,12 +16,12 @@ parameters:
|
|||
PYTHON_SERIES: "3.9"
|
||||
|
||||
- name: macos_310
|
||||
vmImage: macos-11
|
||||
vmImage: macos-12
|
||||
vars:
|
||||
PYTHON_SERIES: "3.10"
|
||||
|
||||
- name: macos_39
|
||||
vmImage: macos-11
|
||||
vmImage: macos-12
|
||||
vars:
|
||||
PYTHON_SERIES: "3.9"
|
||||
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
[build-system]
|
||||
requires = [
|
||||
'cython',
|
||||
'oldest-supported-numpy',
|
||||
'setuptools',
|
||||
'wheel',
|
||||
]
|
||||
requires = ['cython', 'numpy', 'setuptools', 'wheel']
|
||||
build-backend = 'setuptools.build_meta'
|
||||
|
||||
[tool.cranko]
|
||||
annotated_files = [
|
||||
"docs/conf.py",
|
||||
"toasty/cli.py",
|
||||
]
|
||||
annotated_files = ["docs/conf.py", "toasty/cli.py"]
|
||||
|
|
6
setup.py
6
setup.py
|
@ -94,7 +94,11 @@ setup_args = dict(
|
|||
"build_ext": build_ext,
|
||||
},
|
||||
ext_modules=[
|
||||
Extension("toasty._libtoasty", ["toasty/_libtoasty.pyx"]),
|
||||
Extension(
|
||||
"toasty._libtoasty",
|
||||
["toasty/_libtoasty.pyx"],
|
||||
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
|
||||
),
|
||||
],
|
||||
include_dirs=[
|
||||
np.get_include(),
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
from libc.math cimport sin, cos, atan2, hypot
|
||||
import numpy as np
|
||||
|
||||
cimport cython
|
||||
|
||||
cimport numpy as np
|
||||
import numpy as np
|
||||
|
||||
np.import_array()
|
||||
|
||||
DTYPE = np.float64
|
||||
ctypedef np.float64_t DTYPE_t
|
||||
|
|
|
@ -152,7 +152,8 @@ def healpix_fits_file_sampler(
|
|||
# needed.
|
||||
data = data[data.dtype.names[0]]
|
||||
if data.dtype.byteorder not in "=|":
|
||||
data = data.byteswap().newbyteorder()
|
||||
data = data.byteswap()
|
||||
data = data.view(data.dtype.newbyteorder())
|
||||
|
||||
nest = hdr.get("ORDERING") == "NESTED"
|
||||
coord = hdr.get("COORDSYS", "C")
|
||||
|
|
Загрузка…
Ссылка в новой задаче