From 1b887106d89301ae8ef492b83851f16793c5ee9a Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Tue, 4 Jun 2024 16:03:55 +0200 Subject: [PATCH] fix: fix sympy backend on numpy 2.0 (#473) --- .pre-commit-config.yaml | 5 ----- tests/compute/sympy/test_scale.py | 14 -------------- 2 files changed, 19 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 752a32f9..2d5154f1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,11 +25,6 @@ repos: args: ["--fix", "--show-fixes"] - id: ruff-format - - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.0.4" - hooks: - - id: pyproject-fmt - - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.10.0 hooks: diff --git a/tests/compute/sympy/test_scale.py b/tests/compute/sympy/test_scale.py index 3135c6b2..21bb5bb0 100644 --- a/tests/compute/sympy/test_scale.py +++ b/tests/compute/sympy/test_scale.py @@ -5,9 +5,6 @@ from __future__ import annotations -import importlib.metadata - -import packaging.version import pytest import vector @@ -19,11 +16,6 @@ x, y, z, t = sympy.symbols("x y z t", real=True) values = {x: 1, y: 2, z: 3, t: 10} -# mpmath does not support numpy 2.0 yet -numpy_2 = packaging.version.Version( - importlib.metadata.version("numpy") -) >= packaging.version.Version("2.0.0rc1") - def test_planar_posfactor(): vec = vector.VectorSympy2D( @@ -59,7 +51,6 @@ def test_planar_negfactor(): assert out.y.subs(values).evalf() == pytest.approx(2 * -1.75) -@pytest.mark.xfail(numpy_2, reason="mpmath does not support numpy 2.0 yet") def test_spatial_posfactor(): vec = vector.VectorSympy3D( azimuthal=vector.backends.sympy.AzimuthalSympyXY(x, y), @@ -89,7 +80,6 @@ def test_spatial_posfactor(): assert out.z.subs(values).evalf() == pytest.approx(3 * 1.75) -@pytest.mark.xfail(numpy_2, reason="mpmath does not support numpy 2.0 yet") def test_spatial_negfactor(): vec = vector.VectorSympy3D( azimuthal=vector.backends.sympy.AzimuthalSympyXY(x, y), @@ -119,7 +109,6 @@ def test_spatial_negfactor(): assert out.z.subs(values).evalf() == pytest.approx(3 * -1.75) -@pytest.mark.xfail(numpy_2, reason="mpmath does not support numpy 2.0 yet") def test_lorentz_postime_posfactor(): vec = vector.VectorSympy4D( azimuthal=vector.backends.sympy.AzimuthalSympyXY(x, y), @@ -160,7 +149,6 @@ def test_lorentz_postime_posfactor(): assert out.t.subs(values).evalf() == pytest.approx(10 * 1.75) -@pytest.mark.xfail(numpy_2, reason="mpmath does not support numpy 2.0 yet") def test_lorentz_postime_negfactor(): vec = vector.VectorSympy4D( azimuthal=vector.backends.sympy.AzimuthalSympyXY(x, y), @@ -213,7 +201,6 @@ def test_lorentz_postime_negfactor(): assert out.t.subs(values).evalf() == pytest.approx(10 * 1.75) -@pytest.mark.xfail(numpy_2, reason="mpmath does not support numpy 2.0 yet") def test_lorentz_negtime_posfactor(): vec = vector.VectorSympy4D( azimuthal=vector.backends.sympy.AzimuthalSympyXY(x, y), @@ -266,7 +253,6 @@ def test_lorentz_negtime_posfactor(): assert out.t.subs(values).evalf() == pytest.approx(10 * 1.75) -@pytest.mark.xfail(numpy_2, reason="mpmath does not support numpy 2.0 yet") def test_lorentz_negtime_negfactor(): vec = vector.VectorSympy4D( azimuthal=vector.backends.sympy.AzimuthalSympyXY(x, y),