Skip to content

Commit

Permalink
Merge pull request #510 from yt-project/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
neutrinoceros authored Jul 1, 2024
2 parents de01d96 + 0fda973 commit 4dc3844
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions unyt/_array_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions unyt/tests/test_array_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit 4dc3844

Please sign in to comment.