Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#608)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.6.0](pre-commit/pre-commit-hooks@v4.4.0...v4.6.0)
- [github.com/PyCQA/isort: 5.12.0 → 5.13.2](PyCQA/isort@5.12.0...5.13.2)
- [github.com/psf/black: 23.3.0 → 24.4.2](psf/black@23.3.0...24.4.2)
- [github.com/keewis/blackdoc: v0.3.8 → v0.3.9](keewis/blackdoc@v0.3.8...v0.3.9)
- [github.com/PyCQA/flake8: 6.0.0 → 7.0.0](PyCQA/flake8@6.0.0...7.0.0)
- [github.com/pre-commit/mirrors-mypy: v1.2.0 → v1.10.0](pre-commit/mirrors-mypy@v1.2.0...v1.10.0)

* Update .pre-commit-config.yaml

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update setup.cfg

* Update transform.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Julius Busecke <julius@ldeo.columbia.edu>
  • Loading branch information
pre-commit-ci[bot] and jbusecke committed May 1, 2024
1 parent 33db3f2 commit c68ef7e
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 23 deletions.
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.3.0 #make sure to sync with blackdoc beneath
rev: 24.4.2 #make sure to sync with blackdoc beneath
hooks:
- id: black
- repo: https://github.com/keewis/blackdoc
rev: v0.3.8
rev: v0.3.9
hooks:
- id: blackdoc
additional_dependencies: ["black==22.3.0"]
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.2.0
rev: v1.10.0
hooks:
- id: mypy
# `properies` & `asv_bench` are copied from setup.cfg.
Expand All @@ -36,7 +36,7 @@ repos:
# Type stubs
types-pkg_resources,
types-PyYAML,
typing-extensions==4.0.1,
typing-extensions,
# Dependencies that are typed
numpy,
]
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ignore =
F811
# Allows type hinting as Gridded[DataArray, "(X:center)"], where we did `from typing import Annotated as Gridded`
F722
E704

[isort]
profile = black
Expand Down
1 change: 1 addition & 0 deletions xgcm/padding.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Handle all padding.
"""

from __future__ import annotations

from typing import TYPE_CHECKING, Dict, Mapping, Optional, Tuple, Union
Expand Down
3 changes: 1 addition & 2 deletions xgcm/test/test_axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,4 @@ def test_get_axis_dim_num(periodic_1d):
assert num == da.get_axis_num("XG")


def test_assert_axes_equal():
...
def test_assert_axes_equal(): ...
9 changes: 3 additions & 6 deletions xgcm/test/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,11 @@ def test_inconsistent_lengths(self):


class TestGrid:
def test_init(self):
...
def test_init(self): ...

def test_kwargs_mapped_over_multiple_axes(self):
...
def test_kwargs_mapped_over_multiple_axes(self): ...

def test_repr(self):
...
def test_repr(self): ...

def test_properties(self):
# test boundaries
Expand Down
10 changes: 3 additions & 7 deletions xgcm/test/test_grid_ufunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ def test_no_args_to_annotate(self):
with pytest.raises(ValueError, match="Must specify axis positions"):

@as_grid_ufunc()
def ufunc():
...
def ufunc(): ...

# TODO test hints without annotations
# TODO test hints with annotations that don't conform to Xgcm
Expand Down Expand Up @@ -595,9 +594,7 @@ def grad_to_inner(a):

# Test decorator
@as_grid_ufunc()
def grad_to_inner(
a: Annotated[np.ndarray, "X:center,Y:center"]
) -> Tuple[
def grad_to_inner(a: Annotated[np.ndarray, "X:center,Y:center"]) -> Tuple[
Annotated[np.ndarray, "X:inner,Y:center"],
Annotated[np.ndarray, "X:center,Y:inner"],
]:
Expand Down Expand Up @@ -855,8 +852,7 @@ def test_chunked_non_core_dims(self):
# Create 2D test data
...

def test_chunked_core_dims_overlap_turned_off(self):
...
def test_chunked_core_dims_overlap_turned_off(self): ...


class TestDaskOverlap:
Expand Down
3 changes: 2 additions & 1 deletion xgcm/transform.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Classes and functions for 1D coordinate transformation.
"""

import functools
import warnings

Expand Down Expand Up @@ -391,7 +392,7 @@ def _check_other_dims(target_da):
target_da_other_dims = set(target_da.dims) - set(axis.coords.values())
if not target_da_other_dims.issubset(da_other_dims):
raise ValueError(
f"Found additional dimensions [{target_da_other_dims-da_other_dims}]"
f"Found additional dimensions [{target_da_other_dims - da_other_dims}]"
"in `target_data` not found in `da`. This could mean that the target "
"array is not on the same position along other axes."
" If the additional dimensions are associated witha staggered axis, "
Expand Down

0 comments on commit c68ef7e

Please sign in to comment.