Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
92b257a
Replace np.cast with np.asarray
Armavica Apr 3, 2024
4b83f94
Replace np.sctype2char
Armavica Apr 3, 2024
5cef8fb
Remove np.obj2sctype
Armavica Apr 3, 2024
bf55d44
Replace np.find_common_type with np.result_type
Armavica Apr 3, 2024
b5c15dc
Add ruff numpy2 transition rule
Armavica Apr 3, 2024
c0de3fc
Update numpy deprecated imports
ricardoV94 Apr 5, 2024
d3f138c
Handle change in behavior np.dtype
ricardoV94 Apr 5, 2024
75efbdc
Update access to `_get_ndarray_c_version`
ricardoV94 Apr 5, 2024
8a83fb0
Replace `->elsize` by `PyArray_ITEMSIZE`
ricardoV94 Apr 5, 2024
2b58be2
Remove custom Complex type
ricardoV94 Apr 5, 2024
5e69937
Don't use deprecated PyArray_MoveInto
ricardoV94 Apr 5, 2024
3d228eb
Try numpy 2.0.0rc1
Armavica Apr 3, 2024
8f92f0d
Added get/set real/imag aliases
brendan-m-murphy Jul 8, 2024
2a9d9cb
Updated pytensor_complex struct to uses get/set
brendan-m-murphy Jul 8, 2024
d2dab13
Updated assignment and operations +, -, *
brendan-m-murphy Jul 8, 2024
a70bda5
Added missing header file
brendan-m-murphy Jul 8, 2024
825112b
Ruff formatting
brendan-m-murphy Jul 9, 2024
6199e4a
Merge branch 'numpy2' into numpy2.0-complex-types-update
brendan-m-murphy Jul 9, 2024
bc80b03
Reverted some changes from previous merge
brendan-m-murphy Jul 9, 2024
514de19
Added macros for get/set real/imag
brendan-m-murphy Jul 9, 2024
c84e799
Updated Abs Op to use get_real, get_imag
brendan-m-murphy Jul 9, 2024
eb3b5a7
Ruff formatting
brendan-m-murphy Jul 9, 2024
de7d901
Added macros for Numpy 1.x compatibility
brendan-m-murphy Jul 20, 2024
6831557
fixup! Added macros for Numpy 1.x compatibility
brendan-m-murphy Jul 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ channels:
dependencies:
- python>=3.10
- compilers
- numpy>=1.17.0
- conda-forge/label/numpy_dev::numpy=2.0.0rc1
- scipy>=0.14
- filelock
- etuples
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
requires = [
"setuptools>=48.0.0",
"cython",
"numpy>=1.17.0",
"numpy>=2.0.0rc1",
"versioneer[toml]>=0.28",
]
build-backend = "setuptools.build_meta"
Expand Down Expand Up @@ -48,7 +48,7 @@ keywords = [
dependencies = [
"setuptools>=48.0.0",
"scipy>=0.14",
"numpy>=1.17.0",
"numpy>=2.0.0rc1",
"filelock",
"etuples",
"logical-unification",
Expand Down Expand Up @@ -125,7 +125,7 @@ line-length = 88
exclude = ["doc/", "pytensor/_version.py", "bin/pytensor_cache.py"]

[tool.ruff.lint]
select = ["C", "E", "F", "I", "UP", "W", "RUF"]
select = ["C", "E", "F", "I", "UP", "W", "RUF", "NPY201"]
ignore = ["C408", "C901", "E501", "E741", "RUF012"]


Expand Down
4 changes: 2 additions & 2 deletions pytensor/link/c/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1371,8 +1371,8 @@ def cmodule_key_(

# We must always add the numpy ABI version here as
# DynamicModule always add the include <numpy/arrayobject.h>
if np.lib.NumpyVersion(np.__version__) < "1.16.0a":
ndarray_c_version = np.core.multiarray._get_ndarray_c_version()
if np.lib.NumpyVersion(np.__version__) >= "2.0.0rc":
ndarray_c_version = np._core._multiarray_umath._get_ndarray_c_version()
else:
ndarray_c_version = np.core._multiarray_umath._get_ndarray_c_version()
sig.append(f"NPY_ABI_VERSION=0x{ndarray_c_version:X}")
Expand Down
Loading