Skip to content

Commit 6a3c7b3

Browse files
authored
Merge pull request #2848 from devitocodes/np-126
deps: Add back support for numpy 1.26
2 parents 1a48837 + 7423c18 commit 6a3c7b3

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

.github/workflows/pytest-core-nompi.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
pytest-ubuntu-py313-gcc14-omp
4747
]
4848
set: [base, adjoint]
49+
4950
include:
5051
- name: pytest-ubuntu-py311-gcc11-cxxnoomp
5152
python-version: '3.11'
@@ -188,6 +189,10 @@ jobs:
188189
python3 -m pip install ${{ env.PIPFLAGS }} -e ".[tests,extras]"
189190
python3 -m pip install ${{ env.PIPFLAGS }} sympy==${{matrix.sympy}}
190191
192+
- name: Backward compat for numpy 1.26
193+
if: matrix.name == 'pytest-ubuntu-py310-gcc14-omp'
194+
run: python3 -m pip install ${{ env.PIPFLAGS }} numpy==1.26
195+
191196
- name: Check Docker image Python version
192197
if: "contains(matrix.name, 'docker')"
193198
run: |

devito/ir/support/guards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ class GuardExpr(LocalObject, BooleanFunction):
354354
it is defined.
355355
"""
356356

357-
dtype = np.bool
357+
dtype = np.bool_
358358

359359
def __init__(self, name, liveness='eager', **kwargs):
360360
super().__init__(name, liveness=liveness, **kwargs)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pip>=9.0.1
2-
numpy>=2,<=2.3.3
2+
numpy>=1.26,<=2.4.3
33
sympy>=1.12.1,<1.15
44
psutil>=5.1.0,<8.0
55
py-cpuinfo<10

tests/test_symbolics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ def test_reduce_to_number(self):
881881

882882
w_sub = uxreplace(w_lowered, {h_x: Number(3)})
883883

884-
assert np.isclose(w_sub, -0.003935689)
884+
assert np.isclose(float(w_sub), -0.003935689)
885885
assert not w_sub.is_Mul
886886
assert w_sub.is_Number
887887

0 commit comments

Comments
 (0)