Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(WIP) feat: a sympy backend #441

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def lite(session: nox.Session) -> None:
@nox.session(reuse_venv=True)
def tests(session: nox.Session) -> None:
"""Run the unit and regular tests."""
session.install("-e", ".[awkward,numba,test,test-extras]")
session.install("-e", ".[awkward,numba,test,test-extras,sympy]")
session.run("pytest", "--ignore", "tests/test_notebooks.py", *session.posargs)


Expand All @@ -49,7 +49,7 @@ def coverage(session: nox.Session) -> None:
@nox.session(reuse_venv=True)
def doctests(session: nox.Session) -> None:
"""Run the doctests."""
session.install("-e", ".[awkward,numba,test,test-extras]")
session.install("-e", ".[awkward,numba,test,test-extras,sympy]")
session.run("pytest", "--doctest-plus", "src/vector/", *session.posargs)


Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ dev = [
"pytest>=6",
"pytest-cov>=3",
"pytest-doctestplus",
"sympy",
]
docs = [
"awkward>=1.2",
Expand All @@ -68,6 +69,9 @@ docs = [
numba = [
'numba>=0.57; python_version < "3.12"',
]
sympy = [
"sympy",
]
test = [
"dask_awkward",
"nox",
Expand Down
16 changes: 16 additions & 0 deletions src/vector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@
VectorObject4D,
obj,
)
from vector.backends.sympy import (
MomentumSympy2D,
MomentumSympy3D,
MomentumSympy4D,
VectorSympy,
VectorSympy2D,
VectorSympy3D,
VectorSympy4D,
)


def _import_awkward() -> None:
Expand Down Expand Up @@ -104,6 +113,9 @@ def _import_awkward() -> None:
"MomentumObject2D",
"MomentumObject3D",
"MomentumObject4D",
"MomentumSympy2D",
"MomentumSympy3D",
"MomentumSympy4D",
"Planar",
"Spatial",
"Temporal",
Expand All @@ -122,6 +134,10 @@ def _import_awkward() -> None:
"VectorObject2D",
"VectorObject3D",
"VectorObject4D",
"VectorSympy",
"VectorSympy2D",
"VectorSympy3D",
"VectorSympy4D",
"__version__",
"arr",
"array",
Expand Down
1 change: 1 addition & 0 deletions src/vector/_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -4299,6 +4299,7 @@ def _from_signature(
_handler_priority = [
"vector.backends.object",
"vector.backends.numpy",
"vector.backends.sympy",
"vector.backends.awkward",
]

Expand Down
Loading
Loading