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

chore: update pre-commit hooks #530

Merged
merged 2 commits into from
Nov 26, 2024
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.7.4"
rev: "v0.8.0"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down
2 changes: 1 addition & 1 deletion src/vector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ def _import_awkward() -> None:
"arr",
"array",
"awk",
"zip",
"dim",
"obj",
"register_awkward",
"register_numba",
"zip",
)


Expand Down
4 changes: 2 additions & 2 deletions src/vector/_typeutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
from typing import Protocol, TypedDict

__all__ = [
"BoolCollection",
"FloatArray",
"Protocol",
"ScalarCollection",
"BoolCollection",
"TransformProtocol2D",
"TransformProtocol3D",
"TransformProtocol4D",
"FloatArray",
]


Expand Down
2 changes: 1 addition & 1 deletion src/vector/backends/awkward.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ class AzimuthalAwkwardRhoPhi(AzimuthalAwkward, AzimuthalRhoPhi):
(<Array [[1, 2], None] type='2 * option[var * int64]'>, <Array [None, [1]] type='2 * option[var * int64]'>)
"""

__slots__ = ("rho", "phi")
__slots__ = ("phi", "rho")

def __init__(self, rho: typing.Any, phi: typing.Any) -> None:
self.rho = rho
Expand Down
10 changes: 4 additions & 6 deletions src/vector/backends/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1220,9 +1220,8 @@ def _wrap_result(
if returns in ([float], [bool]):
return result

elif (
len(returns) == 1
or (len(returns) == 2 and returns[1] is None)
elif len(returns) == 1 or (
(len(returns) == 2 and returns[1] is None)
and isinstance(returns[0], type)
and issubclass(returns[0], Azimuthal)
):
Expand Down Expand Up @@ -1525,9 +1524,8 @@ def _wrap_result(
out[name] = result[i]
return out.view(cls.ProjectionClass2D)

elif (
len(returns) == 2
or (len(returns) == 3 and returns[2] is None)
elif len(returns) == 2 or (
(len(returns) == 3 and returns[2] is None)
and isinstance(returns[0], type)
and issubclass(returns[0], Azimuthal)
and isinstance(returns[1], type)
Expand Down
10 changes: 4 additions & 6 deletions src/vector/backends/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,8 @@ def _wrap_result(
azcoords = _coord_object_type[returns[0]](result[0], result[1])
return cls.ProjectionClass2D(azimuthal=azcoords)

elif (
len(returns) == 2
or (len(returns) == 3 and returns[2] is None)
elif len(returns) == 2 or (
(len(returns) == 3 and returns[2] is None)
and isinstance(returns[0], type)
and issubclass(returns[0], Azimuthal)
and isinstance(returns[1], type)
Expand Down Expand Up @@ -1129,9 +1128,8 @@ def _wrap_result(
azcoords = _coord_object_type[returns[0]](result[0], result[1])
return cls.ProjectionClass2D(azimuthal=azcoords)

elif (
len(returns) == 2
or (len(returns) == 3 and returns[2] is None)
elif len(returns) == 2 or (
(len(returns) == 3 and returns[2] is None)
and isinstance(returns[0], type)
and issubclass(returns[0], Azimuthal)
and isinstance(returns[1], type)
Expand Down
10 changes: 4 additions & 6 deletions src/vector/backends/sympy.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,9 +716,8 @@ def _wrap_result(
azcoords = _coord_sympy_type[returns[0]](result[0], result[1])
return cls.ProjectionClass2D(azimuthal=azcoords)

elif (
len(returns) == 2
or (len(returns) == 3 and returns[2] is None)
elif len(returns) == 2 or (
(len(returns) == 3 and returns[2] is None)
and isinstance(returns[0], type)
and issubclass(returns[0], Azimuthal)
and isinstance(returns[1], type)
Expand Down Expand Up @@ -927,9 +926,8 @@ def _wrap_result(
azcoords = _coord_sympy_type[returns[0]](result[0], result[1])
return cls.ProjectionClass2D(azimuthal=azcoords)

elif (
len(returns) == 2
or (len(returns) == 3 and returns[2] is None)
elif len(returns) == 2 or (
(len(returns) == 3 and returns[2] is None)
and isinstance(returns[0], type)
and issubclass(returns[0], Azimuthal)
and isinstance(returns[1], type)
Expand Down