Skip to content
Merged
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: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Check compute features only on Python 3.8
if: "matrix.python-version == 3.8"
run: python -m pip install uncompyle6 spark-parser

- name: Requirements check
run: python -m pip list

Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ where = src
addopts = -vv -rs -Wd
testpaths =
tests
markers =
slow

[tool:isort]
profile = black
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"scikit-hep-testdata>=0.2.0",
"pytest>=4.6",
],
"test": ["pytest>=4.6"],
"test": [
"pytest>=4.6",
],
}

extras["all"] = sum(extras.values(), [])
Expand Down
4 changes: 2 additions & 2 deletions src/vector/compute/spatial/costheta.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


def xy_z(lib, x, y, z):
return lib.nan_to_num(z / mag.xy_z(lib, x, y, z), 1.0)
return lib.nan_to_num(z / mag.xy_z(lib, x, y, z), nan=1.0)


def xy_theta(lib, x, y, theta):
Expand All @@ -31,7 +31,7 @@ def xy_eta(lib, x, y, eta):


def rhophi_z(lib, rho, phi, z):
return lib.nan_to_num(z / mag.rhophi_z(lib, rho, phi, z), 1.0)
return lib.nan_to_num(z / mag.rhophi_z(lib, rho, phi, z), nan=1.0)


def rhophi_theta(lib, rho, phi, theta):
Expand Down
4 changes: 2 additions & 2 deletions src/vector/compute/spatial/cottheta.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


def xy_z(lib, x, y, z):
return lib.nan_to_num(z / rho.xy(lib, x, y), lib.inf)
return lib.nan_to_num(z / rho.xy(lib, x, y), nan=lib.inf)


def xy_theta(lib, x, y, theta):
Expand All @@ -32,7 +32,7 @@ def xy_eta(lib, x, y, eta):


def rhophi_z(lib, rho, phi, z):
return lib.nan_to_num(z / rho, lib.inf)
return lib.nan_to_num(z / rho, nan=lib.inf)


def rhophi_theta(lib, rho, phi, theta):
Expand Down
6 changes: 3 additions & 3 deletions src/vector/compute/spatial/eta.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@


def xy_z(lib, x, y, z):
return lib.nan_to_num(lib.arctanh(z / lib.sqrt(x ** 2 + y ** 2 + z ** 2)), 0.0)
return lib.nan_to_num(lib.arctanh(z / lib.sqrt(x ** 2 + y ** 2 + z ** 2)), nan=0.0)


def xy_theta(lib, x, y, theta):
return lib.nan_to_num(-lib.log(lib.tan(0.5 * theta)), 0.0)
return lib.nan_to_num(-lib.log(lib.tan(0.5 * theta)), nan=0.0)


def xy_eta(lib, x, y, eta):
return eta


def rhophi_z(lib, rho, phi, z):
return lib.nan_to_num(lib.arctanh(z / lib.sqrt(rho ** 2 + z ** 2)), 0.0)
return lib.nan_to_num(lib.arctanh(z / lib.sqrt(rho ** 2 + z ** 2)), nan=0.0)


def rhophi_theta(lib, rho, phi, theta):
Expand Down
4 changes: 2 additions & 2 deletions src/vector/compute/spatial/z.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def xy_z(lib, x, y, z):


def xy_theta(lib, x, y, theta):
return lib.nan_to_num(rho.xy(lib, x, y) / lib.tan(theta), 0.0)
return lib.nan_to_num(rho.xy(lib, x, y) / lib.tan(theta), nan=0.0)


def xy_eta(lib, x, y, eta):
Expand All @@ -35,7 +35,7 @@ def rhophi_z(lib, rho, phi, z):


def rhophi_theta(lib, rho, phi, theta):
return lib.nan_to_num(rho / lib.tan(theta), 0.0)
return lib.nan_to_num(rho / lib.tan(theta), nan=0.0)


def rhophi_eta(lib, rho, phi, eta):
Expand Down
Loading