Skip to content

Commit ffd5a69

Browse files
chore: update pre-commit hooks (#610)
* chore: update pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.13 → v0.12.2](astral-sh/ruff-pre-commit@v0.11.13...v0.12.2) - [github.com/pre-commit/mirrors-mypy: v1.16.0 → v1.16.1](pre-commit/mirrors-mypy@v1.16.0...v1.16.1) - [github.com/rbubley/mirrors-prettier: v3.5.3 → v3.6.2](rbubley/mirrors-prettier@v3.5.3...v3.6.2) * ruff -> ruff-check * add __hash__ method everywhere * better hashes * fix spelling * bump ruff * these classes do not really need a hash * hash tests not required --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Saransh Chopra <[email protected]>
1 parent 096cf76 commit ffd5a69

File tree

6 files changed

+30
-15
lines changed

6 files changed

+30
-15
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ repos:
1919
- id: trailing-whitespace
2020

2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: "v0.11.13"
22+
rev: "v0.12.3"
2323
hooks:
24-
- id: ruff
24+
- id: ruff-check
2525
args: ["--fix", "--show-fixes"]
2626
- id: ruff-format
2727

2828
- repo: https://github.com/pre-commit/mirrors-mypy
29-
rev: v1.16.0
29+
rev: v1.16.1
3030
hooks:
3131
- id: mypy
3232
files: src
@@ -44,7 +44,7 @@ repos:
4444
exclude: ^docs/usage/intro.ipynb$
4545

4646
- repo: https://github.com/rbubley/mirrors-prettier
47-
rev: "v3.5.3"
47+
rev: "v3.6.2"
4848
hooks:
4949
- id: prettier
5050
types_or: [yaml, markdown, html, css, scss, javascript, json]

pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,24 @@ isort.required-imports = [
138138
"docs/src/*.ipynb" = [
139139
"T20", "I001", "I002", "F811"
140140
]
141+
"src/vector/__init__.py" = [
142+
"PLC0415",
143+
]
144+
"src/vector/_methods.py" = [
145+
"PLC0415",
146+
]
141147
"src/vector/backends/_numba_object.py" = [
142148
"PGH003",
143149
]
150+
"src/vector/backends/awkward.py" = [
151+
"PLC0415",
152+
]
153+
"src/vector/backends/awkward_constructors.py" = [
154+
"PLC0415",
155+
]
156+
"src/vector/backends/object.py" = [
157+
"PLC0415",
158+
]
144159
"tests/backends/test_operators.py" = [
145160
"SIM201",
146161
"SIM202",

src/vector/backends/awkward.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ class AwkwardProtocol(Protocol):
622622
def __getitem__(self, where: typing.Any) -> float | ak.Array | ak.Record | None: ...
623623

624624

625-
class _lib(typing.NamedTuple):
625+
class _lib(typing.NamedTuple): # noqa: PLW1641
626626
"""a wrapper that respects the numpy-like interface of awkward-array and the module interface of numpy"""
627627

628628
module: types.ModuleType

src/vector/backends/numpy.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ class TemporalNumpy(CoordinatesNumpy, Temporal):
429429
ObjectClass: type[vector.backends.object.TemporalObject]
430430

431431

432-
class AzimuthalNumpyXY(AzimuthalNumpy, AzimuthalXY, GetItem, FloatArray): # type: ignore[misc]
432+
class AzimuthalNumpyXY(AzimuthalNumpy, AzimuthalXY, GetItem, FloatArray): # type: ignore[misc] # noqa: PLW1641
433433
"""
434434
Class for the ``x`` and ``y`` (azimuthal) coordinates of NumPy backend.
435435
Creates a structured NumPy array and returns it as an AzimuthalNumpyXY object.
@@ -495,7 +495,7 @@ def y(self) -> FloatArray:
495495
return self["y"]
496496

497497

498-
class AzimuthalNumpyRhoPhi(AzimuthalNumpy, AzimuthalRhoPhi, GetItem, FloatArray): # type: ignore[misc]
498+
class AzimuthalNumpyRhoPhi(AzimuthalNumpy, AzimuthalRhoPhi, GetItem, FloatArray): # type: ignore[misc] # noqa: PLW1641
499499
"""
500500
Class for the ``rho`` and ``phi`` (azimuthal) coordinates of NumPy backend.
501501
Creates a structured NumPy array and returns it as an AzimuthalNumpyXY object.
@@ -561,7 +561,7 @@ def phi(self) -> FloatArray:
561561
return self["phi"]
562562

563563

564-
class LongitudinalNumpyZ(LongitudinalNumpy, LongitudinalZ, GetItem, FloatArray): # type: ignore[misc]
564+
class LongitudinalNumpyZ(LongitudinalNumpy, LongitudinalZ, GetItem, FloatArray): # type: ignore[misc] # noqa: PLW1641
565565
"""
566566
Class for the ``z`` (longitudinal) coordinate of NumPy backend.
567567
Creates a structured NumPy array and returns it as a LongitudinalNumpyZ object.
@@ -619,7 +619,7 @@ def z(self) -> FloatArray:
619619
return self["z"]
620620

621621

622-
class LongitudinalNumpyTheta(LongitudinalNumpy, LongitudinalTheta, GetItem, FloatArray): # type: ignore[misc]
622+
class LongitudinalNumpyTheta(LongitudinalNumpy, LongitudinalTheta, GetItem, FloatArray): # type: ignore[misc] # noqa: PLW1641
623623
"""
624624
Class for the ``theta`` (longitudinal) coordinate of NumPy backend.
625625
Creates a structured NumPy array and returns it as a LongitudinalNumpyTheta object.
@@ -677,7 +677,7 @@ def theta(self) -> FloatArray:
677677
return self["theta"]
678678

679679

680-
class LongitudinalNumpyEta(LongitudinalNumpy, LongitudinalEta, GetItem, FloatArray): # type: ignore[misc]
680+
class LongitudinalNumpyEta(LongitudinalNumpy, LongitudinalEta, GetItem, FloatArray): # type: ignore[misc] # noqa: PLW1641
681681
"""
682682
Class for the ``eta`` (longitudinal) coordinate of NumPy backend.
683683
Creates a structured NumPy array and returns it as a LongitudinalNumpyEta object.
@@ -735,7 +735,7 @@ def eta(self) -> FloatArray:
735735
return self["eta"]
736736

737737

738-
class TemporalNumpyT(TemporalNumpy, TemporalT, GetItem, FloatArray): # type: ignore[misc]
738+
class TemporalNumpyT(TemporalNumpy, TemporalT, GetItem, FloatArray): # type: ignore[misc] # noqa: PLW1641
739739
"""
740740
Class for the ``t`` (temporal) coordinate of NumPy backend.
741741
Creates a structured NumPy array and returns it as a TemporalNumpyT object.
@@ -793,7 +793,7 @@ def t(self) -> FloatArray:
793793
return self["t"]
794794

795795

796-
class TemporalNumpyTau(TemporalNumpy, TemporalTau, GetItem, FloatArray): # type: ignore[misc]
796+
class TemporalNumpyTau(TemporalNumpy, TemporalTau, GetItem, FloatArray): # type: ignore[misc] # noqa: PLW1641
797797
"""Class for the ``tau`` (temporal) coordinate of NumPy backend."""
798798

799799
ObjectClass = vector.backends.object.TemporalObjectTau
@@ -843,7 +843,7 @@ def tau(self) -> FloatArray:
843843
return self["tau"]
844844

845845

846-
class VectorNumpy(Vector, GetItem):
846+
class VectorNumpy(Vector, GetItem): # noqa: PLW1641
847847
"""Mixin class for NumPy vectors."""
848848

849849
lib = numpy

src/vector/backends/object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def _replace_data(obj: typing.Any, result: typing.Any) -> typing.Any:
326326
return obj
327327

328328

329-
class VectorObject(Vector):
329+
class VectorObject(Vector): # noqa: PLW1641
330330
"""Mixin class for Object vectors."""
331331

332332
lib = numpy

src/vector/backends/sympy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def _replace_data(obj: typing.Any, result: typing.Any) -> typing.Any:
437437
return obj
438438

439439

440-
class VectorSympy(Vector):
440+
class VectorSympy(Vector): # noqa: PLW1641
441441
"""Mixin class for Sympy vectors."""
442442

443443
lib = _lib()

0 commit comments

Comments
 (0)