vector 1.3.1__tar.gz → 1.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vector-1.3.1 → vector-1.4.1}/.github/workflows/cd.yml +25 -3
- {vector-1.3.1 → vector-1.4.1}/.github/workflows/ci.yml +17 -1
- {vector-1.3.1 → vector-1.4.1}/.pre-commit-config.yaml +6 -9
- {vector-1.3.1 → vector-1.4.1}/PKG-INFO +181 -4
- {vector-1.3.1 → vector-1.4.1}/README.md +176 -2
- {vector-1.3.1 → vector-1.4.1}/docs/changelog.md +49 -0
- vector-1.4.1/docs/usage/intro.ipynb +3980 -0
- {vector-1.3.1 → vector-1.4.1}/noxfile.py +2 -2
- {vector-1.3.1 → vector-1.4.1}/pyproject.toml +79 -57
- {vector-1.3.1 → vector-1.4.1}/src/vector/__init__.py +25 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/rotateZ.py +4 -1
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/scale.py +4 -1
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/deltaangle.py +277 -42
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/rotate_euler.py +6 -1
- vector-1.4.1/src/vector/_lib.py +95 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_methods.py +238 -112
- {vector-1.3.1 → vector-1.4.1}/src/vector/_version.py +2 -2
- {vector-1.3.1 → vector-1.4.1}/src/vector/backends/numpy.py +110 -1
- {vector-1.3.1 → vector-1.4.1}/src/vector/backends/object.py +1 -5
- vector-1.4.1/src/vector/backends/sympy.py +1534 -0
- vector-1.4.1/tests/backends/test_sympy.py +484 -0
- vector-1.4.1/tests/compute/lorentz/test_is_lightlike.py +200 -0
- vector-1.4.1/tests/compute/lorentz/test_is_spacelike.py +284 -0
- vector-1.4.1/tests/compute/lorentz/test_is_timelike.py +284 -0
- vector-1.4.1/tests/compute/spatial/test_cross.py +72 -0
- vector-1.4.1/tests/compute/sympy/lorentz/__init__.py +4 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_Et.py +197 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_Et2.py +173 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_Mt.py +169 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_Mt2.py +161 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_beta.py +203 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_boostX_beta.py +53 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_boostX_gamma.py +51 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_boostY_beta.py +69 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_boostY_gamma.py +51 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_boostZ_beta.py +52 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_boostZ_gamma.py +51 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_boost_beta3.py +92 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_boost_p4.py +99 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_deltaRapidityPhi.py +88 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_deltaRapidityPhi2.py +89 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_gamma.py +201 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_is_lightlike.py +149 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_is_spacelike.py +367 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_is_timelike.py +361 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_rapidity.py +239 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_t.py +183 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_t2.py +173 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_tau.py +170 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_tau2.py +164 -0
- vector-1.4.1/tests/compute/sympy/lorentz/test_to_beta3.py +342 -0
- vector-1.4.1/tests/compute/sympy/planar/__init__.py +4 -0
- vector-1.4.1/tests/compute/sympy/planar/test_deltaphi.py +67 -0
- vector-1.4.1/tests/compute/sympy/planar/test_phi.py +35 -0
- vector-1.4.1/tests/compute/sympy/planar/test_rho.py +33 -0
- vector-1.4.1/tests/compute/sympy/planar/test_rho2.py +33 -0
- vector-1.4.1/tests/compute/sympy/planar/test_rotateZ.py +35 -0
- vector-1.4.1/tests/compute/sympy/planar/test_x.py +33 -0
- vector-1.4.1/tests/compute/sympy/planar/test_y.py +33 -0
- vector-1.4.1/tests/compute/sympy/spatial/__init__.py +4 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_costheta.py +99 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_cottheta.py +91 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_cross.py +57 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_deltaR.py +110 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_deltaR2.py +108 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_deltaangle.py +90 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_deltaeta.py +88 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_eta.py +81 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_mag.py +81 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_mag2.py +84 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_rotateX.py +78 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_rotateY.py +78 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_rotate_axis.py +111 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_rotate_euler.py +43 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_rotate_quaternion.py +43 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_theta.py +81 -0
- vector-1.4.1/tests/compute/sympy/spatial/test_z.py +77 -0
- vector-1.4.1/tests/compute/sympy/test_add.py +121 -0
- vector-1.4.1/tests/compute/sympy/test_conversions.py +549 -0
- vector-1.4.1/tests/compute/sympy/test_dot.py +100 -0
- vector-1.4.1/tests/compute/sympy/test_equal.py +95 -0
- vector-1.4.1/tests/compute/sympy/test_is_antiparallel.py +76 -0
- vector-1.4.1/tests/compute/sympy/test_is_parallel.py +66 -0
- vector-1.4.1/tests/compute/sympy/test_is_perpendicular.py +68 -0
- vector-1.4.1/tests/compute/sympy/test_not_equal.py +95 -0
- vector-1.4.1/tests/compute/sympy/test_scale.py +305 -0
- vector-1.4.1/tests/compute/sympy/test_subtract.py +117 -0
- vector-1.4.1/tests/compute/sympy/test_unit.py +93 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/test_add.py +0 -2
- {vector-1.3.1 → vector-1.4.1}/tests/compute/test_conversions.py +2 -22
- vector-1.4.1/tests/compute/test_is_antiparallel.py +124 -0
- vector-1.4.1/tests/compute/test_is_parallel.py +124 -0
- vector-1.4.1/tests/compute/test_is_perpendicular.py +124 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/test_isclose.py +0 -2
- {vector-1.3.1 → vector-1.4.1}/tests/compute/test_scale.py +5 -5
- {vector-1.3.1 → vector-1.4.1}/tests/test_compute_features.py +1 -0
- vector-1.4.1/tests/test_issues.py +176 -0
- vector-1.3.1/docs/usage/intro.ipynb +0 -2817
- vector-1.3.1/tests/compute/spatial/test_cross.py +0 -170
- vector-1.3.1/tests/test_issues.py +0 -49
- {vector-1.3.1 → vector-1.4.1}/.all-contributorsrc +0 -0
- {vector-1.3.1 → vector-1.4.1}/.git_archival.txt +0 -0
- {vector-1.3.1 → vector-1.4.1}/.gitattributes +0 -0
- {vector-1.3.1 → vector-1.4.1}/.github/CONTRIBUTING.md +0 -0
- {vector-1.3.1 → vector-1.4.1}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {vector-1.3.1 → vector-1.4.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {vector-1.3.1 → vector-1.4.1}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {vector-1.3.1 → vector-1.4.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {vector-1.3.1 → vector-1.4.1}/.github/codecov.yml +0 -0
- {vector-1.3.1 → vector-1.4.1}/.github/dependabot.yml +0 -0
- {vector-1.3.1 → vector-1.4.1}/.github/matchers/pylint.json +0 -0
- {vector-1.3.1 → vector-1.4.1}/.github/workflows/notebooks.yml +0 -0
- {vector-1.3.1 → vector-1.4.1}/.gitignore +0 -0
- {vector-1.3.1 → vector-1.4.1}/.readthedocs.yml +0 -0
- {vector-1.3.1 → vector-1.4.1}/CITATION.cff +0 -0
- {vector-1.3.1 → vector-1.4.1}/LICENSE +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/Makefile +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/_images/LogoSrc.svg +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/_images/vector-logo.png +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/backends/vector.backends._numba.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/backends/vector.backends._numba_object.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/backends/vector.backends.awkward.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/backends/vector.backends.awkward_constructors.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/backends/vector.backends.numba_numpy.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/backends/vector.backends.numpy.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/backends/vector.backends.object.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/backends/vector.backends.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.Et.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.Et2.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.Mt.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.Mt2.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.add.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.beta.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.boostX_beta.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.boostX_gamma.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.boostY_beta.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.boostY_gamma.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.boostZ_beta.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.boostZ_gamma.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.boost_beta3.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.boost_p4.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.deltaRapidityPhi.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.deltaRapidityPhi2.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.dot.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.equal.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.gamma.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.is_lightlike.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.is_spacelike.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.is_timelike.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.isclose.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.not_equal.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.rapidity.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.scale.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.subtract.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.t.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.t2.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.tau.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.tau2.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.to_beta3.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.transform4D.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/lorentz/vector._compute.lorentz.unit.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.add.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.deltaphi.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.dot.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.equal.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.is_antiparallel.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.is_parallel.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.is_perpendicular.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.isclose.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.not_equal.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.phi.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.rho.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.rho2.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.rotateZ.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.scale.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.subtract.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.transform2D.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.unit.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.x.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/planar/vector._compute.planar.y.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.add.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.costheta.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.cottheta.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.cross.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.deltaR.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.deltaR2.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.deltaangle.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.deltaeta.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.dot.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.equal.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.eta.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.is_antiparallel.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.is_parallel.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.is_perpendicular.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.isclose.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.mag.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.mag2.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.not_equal.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.rotateX.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.rotateY.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.rotate_axis.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.rotate_euler.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.rotate_quaternion.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.scale.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.subtract.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.theta.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.transform3D.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.unit.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/spatial/vector._compute.spatial.z.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/compute/vector._compute.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/inheritance.svg +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/modules.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/vector._methods.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/vector._typeutils.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/api/vector.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/conf.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/index.rst +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/make.bat +0 -0
- {vector-1.3.1 → vector-1.4.1}/docs/usage/structure.md +0 -0
- {vector-1.3.1 → vector-1.4.1}/environment.yml +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/__init__.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/Et.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/Et2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/Mt.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/Mt2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/__init__.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/add.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/beta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/boostX_beta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/boostX_gamma.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/boostY_beta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/boostY_gamma.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/boostZ_beta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/boostZ_gamma.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/boost_beta3.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/boost_p4.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/deltaRapidityPhi.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/deltaRapidityPhi2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/dot.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/equal.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/gamma.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/is_lightlike.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/is_spacelike.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/is_timelike.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/isclose.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/not_equal.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/rapidity.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/scale.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/subtract.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/t.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/t2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/tau.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/tau2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/to_beta3.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/transform4D.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/lorentz/unit.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/__init__.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/add.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/deltaphi.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/dot.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/equal.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/is_antiparallel.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/is_parallel.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/is_perpendicular.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/isclose.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/not_equal.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/phi.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/rho.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/rho2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/subtract.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/transform2D.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/unit.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/x.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/planar/y.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/__init__.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/add.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/costheta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/cottheta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/cross.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/deltaR.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/deltaR2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/deltaeta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/dot.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/equal.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/eta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/is_antiparallel.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/is_parallel.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/is_perpendicular.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/isclose.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/mag.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/mag2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/not_equal.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/rotateX.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/rotateY.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/rotate_axis.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/rotate_quaternion.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/scale.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/subtract.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/theta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/transform3D.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/unit.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_compute/spatial/z.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/_typeutils.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/backends/__init__.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/backends/_numba.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/backends/_numba_object.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/backends/awkward.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/backends/awkward_constructors.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/backends/numba_numpy.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/py.typed +0 -0
- {vector-1.3.1 → vector-1.4.1}/src/vector/version.pyi +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/__init__.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/backends/__init__.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/backends/test_awkward.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/backends/test_awkward_numba.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/backends/test_dask_awkward.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/backends/test_numba_numpy.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/backends/test_numba_object.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/backends/test_numpy.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/backends/test_object.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/backends/test_operators.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/__init__.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/__init__.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_Et.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_Et2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_Mt.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_Mt2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_beta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_boostX_beta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_boostX_gamma.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_boostY_beta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_boostY_gamma.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_boostZ_beta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_boostZ_gamma.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_boost_beta3.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_boost_p4.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_deltaRapidityPhi.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_deltaRapidityPhi2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_gamma.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_rapidity.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_t.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_t2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_tau.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_tau2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/lorentz/test_to_beta3.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/planar/__init__.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/planar/test_deltaphi.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/planar/test_phi.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/planar/test_rho.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/planar/test_rho2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/planar/test_rotateZ.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/planar/test_x.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/planar/test_y.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/__init__.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_costheta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_cottheta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_deltaR.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_deltaR2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_deltaangle.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_deltaeta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_eta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_mag.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_mag2.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_rotateX.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_rotateY.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_rotate_axis.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_rotate_euler.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_rotate_quaternion.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_theta.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/spatial/test_z.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/test_dot.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/test_equal.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/test_not_equal.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/test_subtract.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/compute/test_unit.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/samples/issue-161-v2.pkl +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/samples/issue-161.pkl +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/test_methods.py +0 -0
- {vector-1.3.1 → vector-1.4.1}/tests/test_notebooks.py +0 -0
|
@@ -9,6 +9,10 @@ on:
|
|
|
9
9
|
jobs:
|
|
10
10
|
dist:
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
id-token: write
|
|
14
|
+
attestations: write
|
|
15
|
+
contents: read
|
|
12
16
|
steps:
|
|
13
17
|
- uses: actions/checkout@v4
|
|
14
18
|
with:
|
|
@@ -17,13 +21,18 @@ jobs:
|
|
|
17
21
|
- name: Build SDist and wheel
|
|
18
22
|
run: pipx run build
|
|
19
23
|
|
|
24
|
+
- name: Check metadata
|
|
25
|
+
run: pipx run twine check dist/*
|
|
26
|
+
|
|
27
|
+
- name: Generate artifact attestation for sdist and wheel
|
|
28
|
+
uses: actions/attest-build-provenance@49df96e17e918a15956db358890b08e61c704919 # v1.2.0
|
|
29
|
+
with:
|
|
30
|
+
subject-path: "dist/vector-*"
|
|
31
|
+
|
|
20
32
|
- uses: actions/upload-artifact@v4
|
|
21
33
|
with:
|
|
22
34
|
path: dist/*
|
|
23
35
|
|
|
24
|
-
- name: Check metadata
|
|
25
|
-
run: pipx run twine check dist/*
|
|
26
|
-
|
|
27
36
|
publish:
|
|
28
37
|
needs: [dist]
|
|
29
38
|
runs-on: ubuntu-latest
|
|
@@ -40,4 +49,17 @@ jobs:
|
|
|
40
49
|
name: artifact
|
|
41
50
|
path: dist
|
|
42
51
|
|
|
52
|
+
- name: List distributions to be deployed
|
|
53
|
+
run: ls -l dist/
|
|
54
|
+
|
|
55
|
+
- name: Verify sdist artifact attestation
|
|
56
|
+
env:
|
|
57
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
58
|
+
run: gh attestation verify dist/vector-*.tar.gz --repo ${{ github.repository }}
|
|
59
|
+
|
|
60
|
+
- name: Verify wheel artifact attestation
|
|
61
|
+
env:
|
|
62
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
63
|
+
run: gh attestation verify dist/vector-*.whl --repo ${{ github.repository }}
|
|
64
|
+
|
|
43
65
|
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -57,6 +57,14 @@ jobs:
|
|
|
57
57
|
- name: Test light package
|
|
58
58
|
run: python -m pytest -ra --ignore tests/test_notebooks.py
|
|
59
59
|
|
|
60
|
+
- name: Install numpy v2
|
|
61
|
+
if: matrix.python-version != 3.8
|
|
62
|
+
run: python -m pip install "numpy>=2.0.0b1"
|
|
63
|
+
|
|
64
|
+
- name: Test light package with numpy v2.x
|
|
65
|
+
if: matrix.python-version != 3.8
|
|
66
|
+
run: python -m pytest -ra --ignore tests/test_notebooks.py
|
|
67
|
+
|
|
60
68
|
check-awkward-v1:
|
|
61
69
|
needs: [check-light]
|
|
62
70
|
runs-on: ubuntu-latest
|
|
@@ -129,8 +137,16 @@ jobs:
|
|
|
129
137
|
- name: Test package with awkward v2.x
|
|
130
138
|
run: python -m pytest -ra --cov=vector --ignore tests/test_notebooks.py .
|
|
131
139
|
|
|
140
|
+
- name: Install numpy v2
|
|
141
|
+
if: matrix.python-version != 3.8
|
|
142
|
+
run: python -m pip install "numpy>=2.0.0b1"
|
|
143
|
+
|
|
144
|
+
- name: Test package with numpy v2.x
|
|
145
|
+
if: matrix.python-version != 3.8
|
|
146
|
+
run: python -m pytest -ra --cov=vector --ignore tests/test_notebooks.py .
|
|
147
|
+
|
|
132
148
|
- name: Upload coverage report
|
|
133
|
-
uses: codecov/codecov-action@v4.1
|
|
149
|
+
uses: codecov/codecov-action@v4.4.1
|
|
134
150
|
with:
|
|
135
151
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
136
152
|
|
|
@@ -4,7 +4,7 @@ ci:
|
|
|
4
4
|
|
|
5
5
|
repos:
|
|
6
6
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
7
|
-
rev: v4.
|
|
7
|
+
rev: v4.6.0
|
|
8
8
|
hooks:
|
|
9
9
|
- id: check-added-large-files
|
|
10
10
|
- id: check-case-conflict
|
|
@@ -19,19 +19,14 @@ repos:
|
|
|
19
19
|
- id: trailing-whitespace
|
|
20
20
|
|
|
21
21
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
22
|
-
rev: "v0.
|
|
22
|
+
rev: "v0.4.4"
|
|
23
23
|
hooks:
|
|
24
24
|
- id: ruff
|
|
25
25
|
args: ["--fix", "--show-fixes"]
|
|
26
26
|
- id: ruff-format
|
|
27
27
|
|
|
28
|
-
- repo: https://github.com/tox-dev/pyproject-fmt
|
|
29
|
-
rev: "1.7.0"
|
|
30
|
-
hooks:
|
|
31
|
-
- id: pyproject-fmt
|
|
32
|
-
|
|
33
28
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
34
|
-
rev: v1.
|
|
29
|
+
rev: v1.10.0
|
|
35
30
|
hooks:
|
|
36
31
|
- id: mypy
|
|
37
32
|
files: src
|
|
@@ -39,11 +34,13 @@ repos:
|
|
|
39
34
|
additional_dependencies:
|
|
40
35
|
- numpy
|
|
41
36
|
- packaging
|
|
37
|
+
- sympy
|
|
42
38
|
|
|
43
39
|
- repo: https://github.com/codespell-project/codespell
|
|
44
40
|
rev: v2.2.6
|
|
45
41
|
hooks:
|
|
46
42
|
- id: codespell
|
|
43
|
+
exclude: ^docs/usage/intro.ipynb$
|
|
47
44
|
|
|
48
45
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
|
49
46
|
rev: "v4.0.0-alpha.8"
|
|
@@ -69,7 +66,7 @@ repos:
|
|
|
69
66
|
- id: rst-inline-touching-normal
|
|
70
67
|
|
|
71
68
|
- repo: https://github.com/nbQA-dev/nbQA
|
|
72
|
-
rev: 1.8.
|
|
69
|
+
rev: 1.8.5
|
|
73
70
|
hooks:
|
|
74
71
|
- id: nbqa-pyupgrade
|
|
75
72
|
args: ["--py37-plus"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: vector
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.1
|
|
4
4
|
Summary: Vector classes and utilities
|
|
5
5
|
Project-URL: Bug Tracker, https://github.com/scikit-hep/vector/issues
|
|
6
6
|
Project-URL: Changelog, https://vector.readthedocs.io/en/latest/changelog.html
|
|
@@ -42,6 +42,7 @@ Requires-Dist: papermill>=2.4; extra == 'dev'
|
|
|
42
42
|
Requires-Dist: pytest-cov>=3; extra == 'dev'
|
|
43
43
|
Requires-Dist: pytest-doctestplus; extra == 'dev'
|
|
44
44
|
Requires-Dist: pytest>=6; extra == 'dev'
|
|
45
|
+
Requires-Dist: sympy; extra == 'dev'
|
|
45
46
|
Provides-Extra: docs
|
|
46
47
|
Requires-Dist: awkward>=1.2; extra == 'docs'
|
|
47
48
|
Requires-Dist: ipykernel; extra == 'docs'
|
|
@@ -53,6 +54,8 @@ Requires-Dist: sphinx-math-dollar; extra == 'docs'
|
|
|
53
54
|
Requires-Dist: sphinx>=4; extra == 'docs'
|
|
54
55
|
Provides-Extra: numba
|
|
55
56
|
Requires-Dist: numba>=0.57; (python_version < '3.12') and extra == 'numba'
|
|
57
|
+
Provides-Extra: sympy
|
|
58
|
+
Requires-Dist: sympy; extra == 'sympy'
|
|
56
59
|
Provides-Extra: test
|
|
57
60
|
Requires-Dist: dask-awkward; extra == 'test'
|
|
58
61
|
Requires-Dist: nox; extra == 'test'
|
|
@@ -93,10 +96,12 @@ Main features of Vector:
|
|
|
93
96
|
- Uses names and conventions set by [ROOT](https://root.cern/)'s [TLorentzVector](https://root.cern.ch/doc/master/classTLorentzVector.html) and [Math::LorentzVector](https://root.cern.ch/doc/master/classROOT_1_1Math_1_1LorentzVector.html), as well as [scikit-hep/math](https://github.com/scikit-hep/scikit-hep/tree/master/skhep/math), [uproot-methods TLorentzVector](https://github.com/scikit-hep/uproot3-methods/blob/master/uproot3_methods/classes/TLorentzVector.py), [henryiii/hepvector](https://github.com/henryiii/hepvector), and [coffea.nanoevents.methods.vector](https://coffeateam.github.io/coffea/modules/coffea.nanoevents.methods.vector.html).
|
|
94
97
|
- Implemented on a variety of backends:
|
|
95
98
|
- pure Python objects
|
|
99
|
+
- [SymPy](https://www.sympy.org/en/index.html) vectors
|
|
96
100
|
- NumPy arrays of vectors (as a [structured array](https://numpy.org/doc/stable/user/basics.rec.html) subclass)
|
|
97
101
|
- [Awkward Arrays](https://awkward-array.org/) of vectors
|
|
98
102
|
- potential for more: CuPy, TensorFlow, Torch, JAX...
|
|
99
|
-
-
|
|
103
|
+
- Awkward backend also implemented in [Numba](https://numba.pydata.org/) for JIT-compiled calculations on vectors.
|
|
104
|
+
- [JAX](https://awkward-array.org/doc/main/user-guide/how-to-specialize-differentiate-jax.html) and [Dask](https://dask-awkward.readthedocs.io/en/stable/) support through Awkward Arrays.
|
|
100
105
|
- Distinction between geometrical vectors, which have a minimum of attribute and method names, and vectors representing momentum, which have synonyms like `pt` = `rho`, `energy` = `t`, `mass` = `tau`.
|
|
101
106
|
|
|
102
107
|
## Installation
|
|
@@ -125,7 +130,7 @@ The easiest way to create one or many vectors is with a helper function:
|
|
|
125
130
|
|
|
126
131
|
### Pure Python vectors
|
|
127
132
|
|
|
128
|
-
You can directly use the `VectorObject` classes to construct object type vectors:
|
|
133
|
+
You can directly use the `VectorObject` and `MomentumObject` classes to construct object type vectors:
|
|
129
134
|
|
|
130
135
|
```python
|
|
131
136
|
vector.VectorObject2D(x=1.1, y=2.2)
|
|
@@ -226,6 +231,80 @@ vector.VectorObject4D.from_xyetatau(1.1, 2.2, 3.3, 4.4)
|
|
|
226
231
|
|
|
227
232
|
and so on, for all combinations of azimuthal, longitudinal, and temporal coordinates, geometric and momentum-flavored.
|
|
228
233
|
|
|
234
|
+
### SymPy vectors
|
|
235
|
+
|
|
236
|
+
> **Note:** Operations on SymPy vectors are only 100% compatible with numeric vectors (Python, NumPy, and Awkward backends) if the vectors are positive time-like, that is, if `t**2 > x**2 + y**2 + z**2`. The space-like and negative time-like cases have different sign conventions.
|
|
237
|
+
|
|
238
|
+
You can directly use the `VectorSympy` and `MomentumSympy` classes to construct object type vectors:
|
|
239
|
+
|
|
240
|
+
```python
|
|
241
|
+
import sympy
|
|
242
|
+
|
|
243
|
+
x, y, z, t, px, py, pz, eta, tau = sympy.symbols(
|
|
244
|
+
"x y z t px py pz eta tau",
|
|
245
|
+
real=True, # see sympy assumptions to add more restrictions on the symbols
|
|
246
|
+
)
|
|
247
|
+
vector.VectorSympy2D(x=x, y=y)
|
|
248
|
+
vector.MomentumSympy3D(px=px, py=py, pz=pz)
|
|
249
|
+
vector.VectorSympy4D(x=x, y=y, eta=eta, tau=tau)
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
and so on for every class.
|
|
253
|
+
|
|
254
|
+
```python
|
|
255
|
+
# Test instance type for any level of granularity.
|
|
256
|
+
(
|
|
257
|
+
# is a vector or array of vectors
|
|
258
|
+
isinstance(vector.VectorSympy2D(x=x, y=y), vector.Vector),
|
|
259
|
+
# is 2D (not 3D or 4D)
|
|
260
|
+
isinstance(vector.VectorSympy2D(x=x, y=y), vector.Vector2D),
|
|
261
|
+
# is a sympy vector (not an array)
|
|
262
|
+
isinstance(vector.VectorSympy2D(x=x, y=y), vector.VectorSympy),
|
|
263
|
+
# has momentum synonyms
|
|
264
|
+
isinstance(vector.MomentumSympy2D(px=px, py=py), vector.Momentum),
|
|
265
|
+
# has transverse plane (2D, 3D, or 4D)
|
|
266
|
+
isinstance(vector.VectorSympy4D(x=x, y=y, z=z, t=t), vector.Planar),
|
|
267
|
+
# has all spatial coordinates (3D or 4D)
|
|
268
|
+
isinstance(vector.VectorSympy4D(x=x, y=y, z=z, t=t), vector.Spatial),
|
|
269
|
+
# has temporal coordinates (4D)
|
|
270
|
+
isinstance(vector.VectorSympy4D(x=x, y=y, z=z, t=t), vector.Lorentz),
|
|
271
|
+
# azimuthal coordinate type
|
|
272
|
+
isinstance(vector.VectorSympy4D(x=x, y=y, z=z, t=t).azimuthal, vector.AzimuthalXY),
|
|
273
|
+
# longitudinal coordinate type
|
|
274
|
+
isinstance(
|
|
275
|
+
vector.VectorSympy4D(x=x, y=y, z=z, t=t).longitudinal, vector.LongitudinalZ
|
|
276
|
+
),
|
|
277
|
+
# temporal coordinate type
|
|
278
|
+
isinstance(vector.VectorSympy4D(x=x, y=y, z=z, t=t).temporal, vector.TemporalT),
|
|
279
|
+
)
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Since `VectorSympy2D`, `VectorSympy3D`, `VectorSympy4D`, and their momentum equivalents operate on SymPy expressions, all of the normal SymPy methods and functions work on the results, coordinates, and the vectors.
|
|
283
|
+
|
|
284
|
+
```python
|
|
285
|
+
sympy.init_session() # latex printing
|
|
286
|
+
|
|
287
|
+
v1 = vector.VectorSympy2D(x=x, y=y)
|
|
288
|
+
sympy.Eq(v1.rho, sympy.sqrt(x**2 + y**2))
|
|
289
|
+
|
|
290
|
+
v2 = vector.VectorSympy4D(x=x, y=y, z=z, t=t)
|
|
291
|
+
v2.to_rhophithetatau().tau
|
|
292
|
+
|
|
293
|
+
values = {x: 3, y: 2, z: 1, t: 10} # t**2 > x**2 + y**2 + z**2
|
|
294
|
+
v2.is_timelike()
|
|
295
|
+
v2.is_timelike().subs(values)
|
|
296
|
+
|
|
297
|
+
v2.to_rhophithetatau().tau.subs(values).evalf()
|
|
298
|
+
|
|
299
|
+
v2.boost(v2.to_beta3())
|
|
300
|
+
v2.boost(v2.to_beta3()).t
|
|
301
|
+
v2.boost(v2.to_beta3()).t.simplify()
|
|
302
|
+
v2.boost(v2.to_beta3()).t.subs(values)
|
|
303
|
+
v2.boost(v2.to_beta3()).t.subs(values).evalf()
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
All of the keyword arguments and rules that apply to `vector.obj` construction apply to `vector.VectorSympyND` and `vector.MomentumObjectND` objects.
|
|
307
|
+
|
|
229
308
|
### NumPy arrays of vectors
|
|
230
309
|
|
|
231
310
|
You can directly use the `VectorNumpy` classes to construct object type vectors:
|
|
@@ -752,6 +831,104 @@ def compute_masses(array):
|
|
|
752
831
|
compute_masses(array)
|
|
753
832
|
```
|
|
754
833
|
|
|
834
|
+
## Sub-classing Awkward mixins
|
|
835
|
+
|
|
836
|
+
At the moment, it is possible to sub-class vector awkward mixins to extend the vector functionalities. Although the mechanism in place works well, it is still being improved.
|
|
837
|
+
|
|
838
|
+
For instance, the `MomentumAwkward` classes can be extended in the following way:
|
|
839
|
+
|
|
840
|
+
```py
|
|
841
|
+
@ak.mixin_class(vector.backends.awkward.behavior)
|
|
842
|
+
class TwoVector(vector.backends.awkward.MomentumAwkward2D):
|
|
843
|
+
pass
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
@ak.mixin_class(vector.backends.awkward.behavior)
|
|
847
|
+
class ThreeVector(vector.backends.awkward.MomentumAwkward3D):
|
|
848
|
+
pass
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
# required for transforming vectors
|
|
852
|
+
# the class names must always end with "Array"
|
|
853
|
+
TwoVectorArray.ProjectionClass2D = TwoVectorArray # noqa: F821
|
|
854
|
+
TwoVectorArray.ProjectionClass3D = ThreeVectorArray # noqa: F821
|
|
855
|
+
TwoVectorArray.MomentumClass = TwoVectorArray # noqa: F821
|
|
856
|
+
|
|
857
|
+
ThreeVectorArray.ProjectionClass2D = TwoVectorArray # noqa: F821
|
|
858
|
+
ThreeVectorArray.ProjectionClass3D = ThreeVectorArray # noqa: F821
|
|
859
|
+
ThreeVectorArray.MomentumClass = ThreeVectorArray # noqa: F821
|
|
860
|
+
|
|
861
|
+
vec = ak.zip(
|
|
862
|
+
{
|
|
863
|
+
"pt": [[1, 2], [], [3], [4]],
|
|
864
|
+
"phi": [[1.2, 1.4], [], [1.6], [3.4]],
|
|
865
|
+
},
|
|
866
|
+
with_name="TwoVector",
|
|
867
|
+
behavior=vector.backends.awkward.behavior,
|
|
868
|
+
)
|
|
869
|
+
|
|
870
|
+
vec
|
|
871
|
+
```
|
|
872
|
+
|
|
873
|
+
The binary operators are not automatically registered by awkward, but vector methods can be used to perform operations on sub-classed vectors.
|
|
874
|
+
|
|
875
|
+
```py
|
|
876
|
+
vec.add(vec)
|
|
877
|
+
```
|
|
878
|
+
|
|
879
|
+
Similarly, other vector methods can be used by the new methods internally.
|
|
880
|
+
|
|
881
|
+
```py
|
|
882
|
+
@ak.mixin_class(vector.backends.awkward.behavior)
|
|
883
|
+
class LorentzVector(vector.backends.awkward.MomentumAwkward4D):
|
|
884
|
+
@ak.mixin_class_method(np.divide, {numbers.Number})
|
|
885
|
+
def divide(self, factor):
|
|
886
|
+
return self.scale(1 / factor)
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
# required for transforming vectors
|
|
890
|
+
# the class names must always end with "Array"
|
|
891
|
+
LorentzVectorArray.ProjectionClass2D = TwoVectorArray # noqa: F821
|
|
892
|
+
LorentzVectorArray.ProjectionClass3D = ThreeVectorArray # noqa: F821
|
|
893
|
+
LorentzVectorArray.ProjectionClass4D = LorentzVectorArray # noqa: F821
|
|
894
|
+
LorentzVectorArray.MomentumClass = LorentzVectorArray # noqa: F821
|
|
895
|
+
|
|
896
|
+
vec = ak.zip(
|
|
897
|
+
{
|
|
898
|
+
"pt": [[1, 2], [], [3], [4]],
|
|
899
|
+
"eta": [[1.2, 1.4], [], [1.6], [3.4]],
|
|
900
|
+
"phi": [[0.3, 0.4], [], [0.5], [0.6]],
|
|
901
|
+
"energy": [[50, 51], [], [52], [60]],
|
|
902
|
+
},
|
|
903
|
+
with_name="LorentzVector",
|
|
904
|
+
behavior=vector.backends.awkward.behavior,
|
|
905
|
+
)
|
|
906
|
+
|
|
907
|
+
vec / 2
|
|
908
|
+
vec.like(vector.obj(x=1, y=2))
|
|
909
|
+
vec.like(vector.obj(x=1, y=2, z=3))
|
|
910
|
+
```
|
|
911
|
+
|
|
912
|
+
It is also possible to manually add binary operations in vector's behavior dict to enable binary operations.
|
|
913
|
+
|
|
914
|
+
```py
|
|
915
|
+
_binary_dispatch_cls = {
|
|
916
|
+
"TwoVector": TwoVector,
|
|
917
|
+
"ThreeVector": ThreeVector,
|
|
918
|
+
"LorentzVector": LorentzVector,
|
|
919
|
+
}
|
|
920
|
+
_rank = [TwoVector, ThreeVector, LorentzVector]
|
|
921
|
+
|
|
922
|
+
for lhs, lhs_to in _binary_dispatch_cls.items():
|
|
923
|
+
for rhs, rhs_to in _binary_dispatch_cls.items():
|
|
924
|
+
out_to = min(lhs_to, rhs_to, key=_rank.index)
|
|
925
|
+
vector.backends.awkward.behavior[(np.add, lhs, rhs)] = out_to.add
|
|
926
|
+
vector.backends.awkward.behavior[(np.subtract, lhs, rhs)] = out_to.subtract
|
|
927
|
+
|
|
928
|
+
vec + vec
|
|
929
|
+
vec.to_2D() + vec.to_2D()
|
|
930
|
+
```
|
|
931
|
+
|
|
755
932
|
## Talks about vector
|
|
756
933
|
|
|
757
934
|
- 9th October 2023 - [What’s new with Vector? First major release is out!](https://indi.to/35ym5) - [PyHEP 2023 (virtual)](https://indico.cern.ch/event/1252095/) [🎥](https://www.youtube.com/watch?v=JHEAb2R3xzE&list=PLKZ9c4ONm-VlAorAG8kR09ZqhMfHiH2LJ&index=10)
|
|
@@ -26,10 +26,12 @@ Main features of Vector:
|
|
|
26
26
|
- Uses names and conventions set by [ROOT](https://root.cern/)'s [TLorentzVector](https://root.cern.ch/doc/master/classTLorentzVector.html) and [Math::LorentzVector](https://root.cern.ch/doc/master/classROOT_1_1Math_1_1LorentzVector.html), as well as [scikit-hep/math](https://github.com/scikit-hep/scikit-hep/tree/master/skhep/math), [uproot-methods TLorentzVector](https://github.com/scikit-hep/uproot3-methods/blob/master/uproot3_methods/classes/TLorentzVector.py), [henryiii/hepvector](https://github.com/henryiii/hepvector), and [coffea.nanoevents.methods.vector](https://coffeateam.github.io/coffea/modules/coffea.nanoevents.methods.vector.html).
|
|
27
27
|
- Implemented on a variety of backends:
|
|
28
28
|
- pure Python objects
|
|
29
|
+
- [SymPy](https://www.sympy.org/en/index.html) vectors
|
|
29
30
|
- NumPy arrays of vectors (as a [structured array](https://numpy.org/doc/stable/user/basics.rec.html) subclass)
|
|
30
31
|
- [Awkward Arrays](https://awkward-array.org/) of vectors
|
|
31
32
|
- potential for more: CuPy, TensorFlow, Torch, JAX...
|
|
32
|
-
-
|
|
33
|
+
- Awkward backend also implemented in [Numba](https://numba.pydata.org/) for JIT-compiled calculations on vectors.
|
|
34
|
+
- [JAX](https://awkward-array.org/doc/main/user-guide/how-to-specialize-differentiate-jax.html) and [Dask](https://dask-awkward.readthedocs.io/en/stable/) support through Awkward Arrays.
|
|
33
35
|
- Distinction between geometrical vectors, which have a minimum of attribute and method names, and vectors representing momentum, which have synonyms like `pt` = `rho`, `energy` = `t`, `mass` = `tau`.
|
|
34
36
|
|
|
35
37
|
## Installation
|
|
@@ -58,7 +60,7 @@ The easiest way to create one or many vectors is with a helper function:
|
|
|
58
60
|
|
|
59
61
|
### Pure Python vectors
|
|
60
62
|
|
|
61
|
-
You can directly use the `VectorObject` classes to construct object type vectors:
|
|
63
|
+
You can directly use the `VectorObject` and `MomentumObject` classes to construct object type vectors:
|
|
62
64
|
|
|
63
65
|
```python
|
|
64
66
|
vector.VectorObject2D(x=1.1, y=2.2)
|
|
@@ -159,6 +161,80 @@ vector.VectorObject4D.from_xyetatau(1.1, 2.2, 3.3, 4.4)
|
|
|
159
161
|
|
|
160
162
|
and so on, for all combinations of azimuthal, longitudinal, and temporal coordinates, geometric and momentum-flavored.
|
|
161
163
|
|
|
164
|
+
### SymPy vectors
|
|
165
|
+
|
|
166
|
+
> **Note:** Operations on SymPy vectors are only 100% compatible with numeric vectors (Python, NumPy, and Awkward backends) if the vectors are positive time-like, that is, if `t**2 > x**2 + y**2 + z**2`. The space-like and negative time-like cases have different sign conventions.
|
|
167
|
+
|
|
168
|
+
You can directly use the `VectorSympy` and `MomentumSympy` classes to construct object type vectors:
|
|
169
|
+
|
|
170
|
+
```python
|
|
171
|
+
import sympy
|
|
172
|
+
|
|
173
|
+
x, y, z, t, px, py, pz, eta, tau = sympy.symbols(
|
|
174
|
+
"x y z t px py pz eta tau",
|
|
175
|
+
real=True, # see sympy assumptions to add more restrictions on the symbols
|
|
176
|
+
)
|
|
177
|
+
vector.VectorSympy2D(x=x, y=y)
|
|
178
|
+
vector.MomentumSympy3D(px=px, py=py, pz=pz)
|
|
179
|
+
vector.VectorSympy4D(x=x, y=y, eta=eta, tau=tau)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
and so on for every class.
|
|
183
|
+
|
|
184
|
+
```python
|
|
185
|
+
# Test instance type for any level of granularity.
|
|
186
|
+
(
|
|
187
|
+
# is a vector or array of vectors
|
|
188
|
+
isinstance(vector.VectorSympy2D(x=x, y=y), vector.Vector),
|
|
189
|
+
# is 2D (not 3D or 4D)
|
|
190
|
+
isinstance(vector.VectorSympy2D(x=x, y=y), vector.Vector2D),
|
|
191
|
+
# is a sympy vector (not an array)
|
|
192
|
+
isinstance(vector.VectorSympy2D(x=x, y=y), vector.VectorSympy),
|
|
193
|
+
# has momentum synonyms
|
|
194
|
+
isinstance(vector.MomentumSympy2D(px=px, py=py), vector.Momentum),
|
|
195
|
+
# has transverse plane (2D, 3D, or 4D)
|
|
196
|
+
isinstance(vector.VectorSympy4D(x=x, y=y, z=z, t=t), vector.Planar),
|
|
197
|
+
# has all spatial coordinates (3D or 4D)
|
|
198
|
+
isinstance(vector.VectorSympy4D(x=x, y=y, z=z, t=t), vector.Spatial),
|
|
199
|
+
# has temporal coordinates (4D)
|
|
200
|
+
isinstance(vector.VectorSympy4D(x=x, y=y, z=z, t=t), vector.Lorentz),
|
|
201
|
+
# azimuthal coordinate type
|
|
202
|
+
isinstance(vector.VectorSympy4D(x=x, y=y, z=z, t=t).azimuthal, vector.AzimuthalXY),
|
|
203
|
+
# longitudinal coordinate type
|
|
204
|
+
isinstance(
|
|
205
|
+
vector.VectorSympy4D(x=x, y=y, z=z, t=t).longitudinal, vector.LongitudinalZ
|
|
206
|
+
),
|
|
207
|
+
# temporal coordinate type
|
|
208
|
+
isinstance(vector.VectorSympy4D(x=x, y=y, z=z, t=t).temporal, vector.TemporalT),
|
|
209
|
+
)
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Since `VectorSympy2D`, `VectorSympy3D`, `VectorSympy4D`, and their momentum equivalents operate on SymPy expressions, all of the normal SymPy methods and functions work on the results, coordinates, and the vectors.
|
|
213
|
+
|
|
214
|
+
```python
|
|
215
|
+
sympy.init_session() # latex printing
|
|
216
|
+
|
|
217
|
+
v1 = vector.VectorSympy2D(x=x, y=y)
|
|
218
|
+
sympy.Eq(v1.rho, sympy.sqrt(x**2 + y**2))
|
|
219
|
+
|
|
220
|
+
v2 = vector.VectorSympy4D(x=x, y=y, z=z, t=t)
|
|
221
|
+
v2.to_rhophithetatau().tau
|
|
222
|
+
|
|
223
|
+
values = {x: 3, y: 2, z: 1, t: 10} # t**2 > x**2 + y**2 + z**2
|
|
224
|
+
v2.is_timelike()
|
|
225
|
+
v2.is_timelike().subs(values)
|
|
226
|
+
|
|
227
|
+
v2.to_rhophithetatau().tau.subs(values).evalf()
|
|
228
|
+
|
|
229
|
+
v2.boost(v2.to_beta3())
|
|
230
|
+
v2.boost(v2.to_beta3()).t
|
|
231
|
+
v2.boost(v2.to_beta3()).t.simplify()
|
|
232
|
+
v2.boost(v2.to_beta3()).t.subs(values)
|
|
233
|
+
v2.boost(v2.to_beta3()).t.subs(values).evalf()
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
All of the keyword arguments and rules that apply to `vector.obj` construction apply to `vector.VectorSympyND` and `vector.MomentumObjectND` objects.
|
|
237
|
+
|
|
162
238
|
### NumPy arrays of vectors
|
|
163
239
|
|
|
164
240
|
You can directly use the `VectorNumpy` classes to construct object type vectors:
|
|
@@ -685,6 +761,104 @@ def compute_masses(array):
|
|
|
685
761
|
compute_masses(array)
|
|
686
762
|
```
|
|
687
763
|
|
|
764
|
+
## Sub-classing Awkward mixins
|
|
765
|
+
|
|
766
|
+
At the moment, it is possible to sub-class vector awkward mixins to extend the vector functionalities. Although the mechanism in place works well, it is still being improved.
|
|
767
|
+
|
|
768
|
+
For instance, the `MomentumAwkward` classes can be extended in the following way:
|
|
769
|
+
|
|
770
|
+
```py
|
|
771
|
+
@ak.mixin_class(vector.backends.awkward.behavior)
|
|
772
|
+
class TwoVector(vector.backends.awkward.MomentumAwkward2D):
|
|
773
|
+
pass
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
@ak.mixin_class(vector.backends.awkward.behavior)
|
|
777
|
+
class ThreeVector(vector.backends.awkward.MomentumAwkward3D):
|
|
778
|
+
pass
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
# required for transforming vectors
|
|
782
|
+
# the class names must always end with "Array"
|
|
783
|
+
TwoVectorArray.ProjectionClass2D = TwoVectorArray # noqa: F821
|
|
784
|
+
TwoVectorArray.ProjectionClass3D = ThreeVectorArray # noqa: F821
|
|
785
|
+
TwoVectorArray.MomentumClass = TwoVectorArray # noqa: F821
|
|
786
|
+
|
|
787
|
+
ThreeVectorArray.ProjectionClass2D = TwoVectorArray # noqa: F821
|
|
788
|
+
ThreeVectorArray.ProjectionClass3D = ThreeVectorArray # noqa: F821
|
|
789
|
+
ThreeVectorArray.MomentumClass = ThreeVectorArray # noqa: F821
|
|
790
|
+
|
|
791
|
+
vec = ak.zip(
|
|
792
|
+
{
|
|
793
|
+
"pt": [[1, 2], [], [3], [4]],
|
|
794
|
+
"phi": [[1.2, 1.4], [], [1.6], [3.4]],
|
|
795
|
+
},
|
|
796
|
+
with_name="TwoVector",
|
|
797
|
+
behavior=vector.backends.awkward.behavior,
|
|
798
|
+
)
|
|
799
|
+
|
|
800
|
+
vec
|
|
801
|
+
```
|
|
802
|
+
|
|
803
|
+
The binary operators are not automatically registered by awkward, but vector methods can be used to perform operations on sub-classed vectors.
|
|
804
|
+
|
|
805
|
+
```py
|
|
806
|
+
vec.add(vec)
|
|
807
|
+
```
|
|
808
|
+
|
|
809
|
+
Similarly, other vector methods can be used by the new methods internally.
|
|
810
|
+
|
|
811
|
+
```py
|
|
812
|
+
@ak.mixin_class(vector.backends.awkward.behavior)
|
|
813
|
+
class LorentzVector(vector.backends.awkward.MomentumAwkward4D):
|
|
814
|
+
@ak.mixin_class_method(np.divide, {numbers.Number})
|
|
815
|
+
def divide(self, factor):
|
|
816
|
+
return self.scale(1 / factor)
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
# required for transforming vectors
|
|
820
|
+
# the class names must always end with "Array"
|
|
821
|
+
LorentzVectorArray.ProjectionClass2D = TwoVectorArray # noqa: F821
|
|
822
|
+
LorentzVectorArray.ProjectionClass3D = ThreeVectorArray # noqa: F821
|
|
823
|
+
LorentzVectorArray.ProjectionClass4D = LorentzVectorArray # noqa: F821
|
|
824
|
+
LorentzVectorArray.MomentumClass = LorentzVectorArray # noqa: F821
|
|
825
|
+
|
|
826
|
+
vec = ak.zip(
|
|
827
|
+
{
|
|
828
|
+
"pt": [[1, 2], [], [3], [4]],
|
|
829
|
+
"eta": [[1.2, 1.4], [], [1.6], [3.4]],
|
|
830
|
+
"phi": [[0.3, 0.4], [], [0.5], [0.6]],
|
|
831
|
+
"energy": [[50, 51], [], [52], [60]],
|
|
832
|
+
},
|
|
833
|
+
with_name="LorentzVector",
|
|
834
|
+
behavior=vector.backends.awkward.behavior,
|
|
835
|
+
)
|
|
836
|
+
|
|
837
|
+
vec / 2
|
|
838
|
+
vec.like(vector.obj(x=1, y=2))
|
|
839
|
+
vec.like(vector.obj(x=1, y=2, z=3))
|
|
840
|
+
```
|
|
841
|
+
|
|
842
|
+
It is also possible to manually add binary operations in vector's behavior dict to enable binary operations.
|
|
843
|
+
|
|
844
|
+
```py
|
|
845
|
+
_binary_dispatch_cls = {
|
|
846
|
+
"TwoVector": TwoVector,
|
|
847
|
+
"ThreeVector": ThreeVector,
|
|
848
|
+
"LorentzVector": LorentzVector,
|
|
849
|
+
}
|
|
850
|
+
_rank = [TwoVector, ThreeVector, LorentzVector]
|
|
851
|
+
|
|
852
|
+
for lhs, lhs_to in _binary_dispatch_cls.items():
|
|
853
|
+
for rhs, rhs_to in _binary_dispatch_cls.items():
|
|
854
|
+
out_to = min(lhs_to, rhs_to, key=_rank.index)
|
|
855
|
+
vector.backends.awkward.behavior[(np.add, lhs, rhs)] = out_to.add
|
|
856
|
+
vector.backends.awkward.behavior[(np.subtract, lhs, rhs)] = out_to.subtract
|
|
857
|
+
|
|
858
|
+
vec + vec
|
|
859
|
+
vec.to_2D() + vec.to_2D()
|
|
860
|
+
```
|
|
861
|
+
|
|
688
862
|
## Talks about vector
|
|
689
863
|
|
|
690
864
|
- 9th October 2023 - [What’s new with Vector? First major release is out!](https://indi.to/35ym5) - [PyHEP 2023 (virtual)](https://indico.cern.ch/event/1252095/) [🎥](https://www.youtube.com/watch?v=JHEAb2R3xzE&list=PLKZ9c4ONm-VlAorAG8kR09ZqhMfHiH2LJ&index=10)
|
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Version 1.4
|
|
4
|
+
|
|
5
|
+
### Version 1.4.1
|
|
6
|
+
|
|
7
|
+
#### Fixes
|
|
8
|
+
|
|
9
|
+
- fix: sympy backend on numpy 2.0 (full numpy 2.0 support) [#473][]
|
|
10
|
+
- fix: add lower and upper bounds for deltaangle [#465][]
|
|
11
|
+
- fix: maximum for SymPy backend is the identity function now [#465][]
|
|
12
|
+
- fix: get coordinate classes to work for numpy [#466][]
|
|
13
|
+
|
|
14
|
+
#### Documentation
|
|
15
|
+
|
|
16
|
+
- docs: add basic docs for sub-classing awkward mixins [#468][]
|
|
17
|
+
|
|
18
|
+
#### Maintenance
|
|
19
|
+
|
|
20
|
+
- chore: add missing compute function tests [#454]
|
|
21
|
+
- ci: Add GitHub artifact attestations to package distribution [#470][]
|
|
22
|
+
|
|
23
|
+
[#473]: https://github.com/scikit-hep/vector/pull/473
|
|
24
|
+
[#465]: https://github.com/scikit-hep/vector/pull/465
|
|
25
|
+
[#466]: https://github.com/scikit-hep/vector/pull/466
|
|
26
|
+
[#468]: https://github.com/scikit-hep/vector/pull/468
|
|
27
|
+
[#454]: https://github.com/scikit-hep/vector/pull/454
|
|
28
|
+
[#470]: https://github.com/scikit-hep/vector/pull/470
|
|
29
|
+
|
|
30
|
+
### Version 1.4.0
|
|
31
|
+
|
|
32
|
+
#### Features
|
|
33
|
+
|
|
34
|
+
- feat: allow coord values in to\_<coord_names> methods [#446][]
|
|
35
|
+
- feat: a sympy backend [#442][]
|
|
36
|
+
|
|
37
|
+
#### Bug fixes
|
|
38
|
+
|
|
39
|
+
- fix: call the square implementation for power 2 on object vectors [#444][]
|
|
40
|
+
- fix: use negfactor in negfactor scale test [#456][]
|
|
41
|
+
|
|
42
|
+
#### Maintenance
|
|
43
|
+
|
|
44
|
+
- chore: test on numpy 2.0 [#451][]
|
|
45
|
+
|
|
46
|
+
[#446]: https://github.com/scikit-hep/vector/pull/446
|
|
47
|
+
[#442]: https://github.com/scikit-hep/vector/pull/442
|
|
48
|
+
[#444]: https://github.com/scikit-hep/vector/pull/444
|
|
49
|
+
[#456]: https://github.com/scikit-hep/vector/pull/456
|
|
50
|
+
[#451]: https://github.com/scikit-hep/vector/pull/451
|
|
51
|
+
|
|
3
52
|
## Version 1.3
|
|
4
53
|
|
|
5
54
|
### Version 1.3.1
|