Skip to content

Commit dee09dd

Browse files
committed
deps: support sympy 1.13
1 parent f518eb3 commit dee09dd

File tree

9 files changed

+93
-101
lines changed

9 files changed

+93
-101
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ jobs:
6868
os: ubuntu-20.04
6969
arch: "gcc-10"
7070
language: "C"
71-
sympy: "1.10"
71+
sympy: "1.11"
7272

7373
- name: pytest-ubuntu-py312-gcc13-omp
7474
python-version: '3.12'
7575
os: ubuntu-24.04
7676
arch: "gcc-13"
7777
language: "openmp"
78-
sympy: "1.11"
78+
sympy: "1.13"
7979

8080
- name: pytest-ubuntu-py39-gcc9-omp
8181
python-version: '3.9'

devito/finite_differences/differentiable.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66
import sympy
77
from sympy.core.add import _addsort
88
from sympy.core.mul import _keep_coeff, _mulsort
9-
from sympy.core.core import ordering_of_classes
109
from sympy.core.decorators import call_highest_priority
1110
from sympy.core.evalf import evalf_table
11+
try:
12+
from sympy.core.core import ordering_of_classes
13+
except ImportError:
14+
# Moved in 1.13
15+
from sympy.core.basic import ordering_of_classes
1216

1317
from devito.finite_differences.tools import make_shift_x0, coeff_priority
1418
from devito.logger import warning

devito/passes/clusters/cse.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
from functools import singledispatch
33

44
from sympy import Add, Function, Indexed, Mul, Pow
5-
from sympy.core.core import ordering_of_classes
5+
try:
6+
from sympy.core.core import ordering_of_classes
7+
except ImportError:
8+
# Moved in 1.13
9+
from sympy.core.basic import ordering_of_classes
610

711
from devito.finite_differences.differentiable import IndexDerivative
812
from devito.ir import Cluster, Scope, cluster_pass

devito/symbolics/manipulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def pow_to_mul(expr):
289289
if exp > 10 or exp < -10 or exp == 0:
290290
# Large powers remain untouched
291291
return expr
292-
elif exp == -1 or int(exp) != exp:
292+
elif exp == -1 or (int(exp) - exp != 0):
293293
# Reciprocals and fractional powers also remain untouched,
294294
# but at least we traverse the base looking for other Pows
295295
return expr.func(pow_to_mul(base), exp, evaluate=False)

devito/types/misc.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
import numpy as np
44
import sympy
5-
from sympy.core.core import ordering_of_classes
5+
try:
6+
from sympy.core.core import ordering_of_classes
7+
except ImportError:
8+
# Moved in 1.13
9+
from sympy.core.basic import ordering_of_classes
610

711
from devito.types import Array, CompositeObject, Indexed, Symbol, LocalObject
812
from devito.types.basic import IndexedData

examples/seismic/tutorials/05_staggered_acoustic.ipynb

Lines changed: 33 additions & 49 deletions
Large diffs are not rendered by default.

examples/seismic/tutorials/06_elastic_varying_parameters.ipynb

Lines changed: 40 additions & 44 deletions
Large diffs are not rendered by default.

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pip>=9.0.1
22
numpy>1.16,<2.1
3-
sympy>=1.9,<1.13
3+
sympy>=1.9,<1.14
44
psutil>=5.1.0,<7.0
55
py-cpuinfo<10
66
cgen>=2020.1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def numpy_compat(required):
1515

1616
# Due to api changes in numpy 2.0, it requires sympy 1.12.1 at the minimum
1717
# Check if sympy is installed and enforce numpy version accordingly.
18-
# If sympy isn't installed, endforce sympy>=1.12.1 and numpy>=2.0
18+
# If sympy isn't installed, enforce sympy>=1.12.1 and numpy>=2.0
1919
try:
2020
sympy_version = pkg_resources.get_distribution("sympy").version
2121
min_ver2 = pkg_resources.parse_version("1.12.1")

0 commit comments

Comments
 (0)