Skip to content

Commit

Permalink
chore: update pre-commit hooks (#530)
Browse files Browse the repository at this point in the history
* chore: update pre-commit hooks

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.4 → v0.8.0](astral-sh/ruff-pre-commit@v0.7.4...v0.8.0)

* style: pre-commit fixes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Nov 26, 2024
1 parent 56d9c40 commit 608da2d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 23 deletions.
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

0 comments on commit 608da2d

Please sign in to comment.