Skip to content

Commit

Permalink
fix: fix sympy backend on numpy 2.0 (#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
Saransh-cpp authored Jun 4, 2024
1 parent b7a0907 commit 1b88710
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 0 additions & 14 deletions tests/compute/sympy/test_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

from __future__ import annotations

import importlib.metadata

import packaging.version
import pytest

import vector
Expand All @@ -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(
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 1b88710

Please sign in to comment.