From 4b6018f53313dd6d310c3ff67f50a586de24fddc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 12:42:30 +0200 Subject: [PATCH] chore: update pre-commit hooks (#487) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.1 → v0.5.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.1...v0.5.2) * fix mypy errors --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Saransh Chopra --- .pre-commit-config.yaml | 2 +- src/vector/backends/object.py | 6 +++--- src/vector/backends/sympy.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bfe16d09..be8ca733 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.1" + rev: "v0.5.2" hooks: - id: ruff args: ["--fix", "--show-fixes"] diff --git a/src/vector/backends/object.py b/src/vector/backends/object.py index 006c7917..7f585e13 100644 --- a/src/vector/backends/object.py +++ b/src/vector/backends/object.py @@ -676,7 +676,7 @@ def __init__( complaint = """unrecognized combination of coordinates, allowed combinations are:\n x= y= rho= phi=""".replace(" ", " ") - if type(self) == VectorObject2D: + if type(self) is VectorObject2D: raise TypeError(complaint) else: raise TypeError(f"{complaint}\n\nor their momentum equivalents") @@ -1060,7 +1060,7 @@ def __init__( rho= phi= z= rho= phi= theta= rho= phi= eta=""".replace(" ", " ") - if type(self) == VectorObject3D: + if type(self) is VectorObject3D: raise TypeError(complaint) else: raise TypeError(f"{complaint}\n\nor their momentum equivalents") @@ -1757,7 +1757,7 @@ def __init__( rho= phi= theta= tau= rho= phi= eta= t= rho= phi= eta= tau=""".replace(" ", " ") - if type(self) == VectorObject4D: + if type(self) is VectorObject4D: raise TypeError(complaint) else: raise TypeError(f"{complaint}\n\nor their momentum equivalents") diff --git a/src/vector/backends/sympy.py b/src/vector/backends/sympy.py index c61e9f18..66f7f4a4 100644 --- a/src/vector/backends/sympy.py +++ b/src/vector/backends/sympy.py @@ -643,7 +643,7 @@ def __init__(self, azimuthal: AzimuthalSympy | None = None, **kwargs: sympy.Symb complaint = """unrecognized combination of coordinates, allowed combinations are:\n x= y= rho= phi=""".replace(" ", " ") - if type(self) == VectorSympy2D: + if type(self) is VectorSympy2D: raise TypeError(complaint) else: raise TypeError(f"{complaint}\n\nor their momentum equivalents") @@ -870,7 +870,7 @@ def __init__( rho= phi= z= rho= phi= theta= rho= phi= eta=""".replace(" ", " ") - if type(self) == VectorSympy3D: + if type(self) is VectorSympy3D: raise TypeError(complaint) else: raise TypeError(f"{complaint}\n\nor their momentum equivalents") @@ -1197,7 +1197,7 @@ def __init__( rho= phi= theta= tau= rho= phi= eta= t= rho= phi= eta= tau=""".replace(" ", " ") - if type(self) == VectorSympy4D: + if type(self) is VectorSympy4D: raise TypeError(complaint) else: raise TypeError(f"{complaint}\n\nor their momentum equivalents")