From 548b8db316bd8ee39ad8feceeb5df3691297355f Mon Sep 17 00:00:00 2001 From: mloubout Date: Mon, 8 Jul 2024 16:14:18 -0400 Subject: [PATCH] deps: support sympy 1.13 --- .github/workflows/pytest-core-nompi.yml | 4 ++-- devito/finite_differences/differentiable.py | 6 +++++- devito/passes/clusters/cse.py | 6 +++++- devito/types/misc.py | 6 +++++- requirements.txt | 2 +- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pytest-core-nompi.yml b/.github/workflows/pytest-core-nompi.yml index f3189f8aafa..c9967fa3516 100644 --- a/.github/workflows/pytest-core-nompi.yml +++ b/.github/workflows/pytest-core-nompi.yml @@ -68,14 +68,14 @@ jobs: os: ubuntu-20.04 arch: "gcc-10" language: "C" - sympy: "1.10" + sympy: "1.11" - name: pytest-ubuntu-py312-gcc13-omp python-version: '3.12' os: ubuntu-24.04 arch: "gcc-13" language: "openmp" - sympy: "1.11" + sympy: "1.13" - name: pytest-ubuntu-py39-gcc9-omp python-version: '3.9' diff --git a/devito/finite_differences/differentiable.py b/devito/finite_differences/differentiable.py index 2e1fef65482..161e8089117 100644 --- a/devito/finite_differences/differentiable.py +++ b/devito/finite_differences/differentiable.py @@ -6,9 +6,13 @@ import sympy from sympy.core.add import _addsort from sympy.core.mul import _keep_coeff, _mulsort -from sympy.core.core import ordering_of_classes from sympy.core.decorators import call_highest_priority from sympy.core.evalf import evalf_table +try: + from sympy.core.core import ordering_of_classes +except ImportError: + # Moved in 1.13 + from sympy.core.basic import ordering_of_classes from devito.finite_differences.tools import make_shift_x0, coeff_priority from devito.logger import warning diff --git a/devito/passes/clusters/cse.py b/devito/passes/clusters/cse.py index 97edce538ee..c04128f21fa 100644 --- a/devito/passes/clusters/cse.py +++ b/devito/passes/clusters/cse.py @@ -2,7 +2,11 @@ from functools import singledispatch from sympy import Add, Function, Indexed, Mul, Pow -from sympy.core.core import ordering_of_classes +try: + from sympy.core.core import ordering_of_classes +except ImportError: + # Moved in 1.13 + from sympy.core.basic import ordering_of_classes from devito.finite_differences.differentiable import IndexDerivative from devito.ir import Cluster, Scope, cluster_pass diff --git a/devito/types/misc.py b/devito/types/misc.py index 72f1ab895a4..29514bb99a3 100644 --- a/devito/types/misc.py +++ b/devito/types/misc.py @@ -2,7 +2,11 @@ import numpy as np import sympy -from sympy.core.core import ordering_of_classes +try: + from sympy.core.core import ordering_of_classes +except ImportError: + # Moved in 1.13 + from sympy.core.basic import ordering_of_classes from devito.types import Array, CompositeObject, Indexed, Symbol, LocalObject from devito.types.basic import IndexedData diff --git a/requirements.txt b/requirements.txt index 0ebd994b1aa..1bbf4877467 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ pip>=9.0.1 numpy>1.16,<2.1 -sympy>=1.9,<1.13 +sympy>=1.9,<1.14 psutil>=5.1.0,<7.0 py-cpuinfo<10 cgen>=2020.1