diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dce11e8b..45f4e48c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,13 +26,13 @@ repos: - id: black - repo: https://github.com/adamchainz/blacken-docs - rev: 1.16.0 + rev: 1.18.0 hooks: - id: blacken-docs additional_dependencies: [black==24.1.1] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.7 + rev: v0.5.0 hooks: - id: ruff args: [--fix, --show-fixes] diff --git a/unyt/_array_functions.py b/unyt/_array_functions.py index b8322d64..bd752d7f 100644 --- a/unyt/_array_functions.py +++ b/unyt/_array_functions.py @@ -963,7 +963,7 @@ def asfarray(a, dtype=np.double): arr = np.asfarray._implementation(np.asarray(a), dtype=dtype) # noqa: NPY201 return arr * ret_units - _trapezoid_func = np.trapz + _trapezoid_func = np.trapz # noqa: NPY201 elif NUMPY_VERSION >= Version("2.0.0dev0"): # functions that were added in numpy 2.0.0 @@ -993,7 +993,7 @@ def trapezoid(y, x=None, dx=1.0, *args, **kwargs): if hasattr(np, "in1d"): - @implements(np.in1d) + @implements(np.in1d) # noqa: NPY201 def in1d(ar1, ar2, *args, **kwargs): _validate_units_consistency((ar1, ar2)) return np.isin._implementation( diff --git a/unyt/tests/test_array_functions.py b/unyt/tests/test_array_functions.py index 161729fb..6f73d0ec 100644 --- a/unyt/tests/test_array_functions.py +++ b/unyt/tests/test_array_functions.py @@ -951,7 +951,7 @@ def test_fft_shift(func): if NUMPY_VERSION >= Version("2.0.0dev0"): _trapezoid_func = np.trapezoid else: - _trapezoid_func = np.trapz + _trapezoid_func = np.trapz # noqa: NPY201 def test_trapezoid_no_x(): @@ -1706,14 +1706,14 @@ def test_isin(): def test_in1d_mixed_units(): a = [1, 2, 3] * cm with pytest.raises(UnitInconsistencyError): - np.in1d([1, 2], a) + np.in1d([1, 2], a) # noqa: NPY201 @pytest.mark.filterwarnings("ignore:`in1d` is deprecated. Use `np.isin` instead.") def test_in1d(): a = [1, 2, 3] * cm b = [1, 2] * cm - assert np.all(np.in1d(b, a)) + assert np.all(np.in1d(b, a)) # noqa: NPY201 def test_place_mixed_units():