Skip to content

Commit

Permalink
Typing annotations for arithmetic overrides (e.g., DataArray + Datase…
Browse files Browse the repository at this point in the history
…t) (#9688)

* Typing annotations for arithmetic overrides (e.g., DataArray + Dataset)

This change explicitly adds annotations for arithmetic like
DataArray + Dataset in `_typed_ops.py`.

Note: I've added a dependency on jinja2, a standard Python templating
engine. It is only required for manually regenerating typed operations,
which should impact only a handful of xarray developers.

Fixes GH9656

* Update mypy on GitHub CI to use python 3.12

* add jinja2 to dev dependencies
  • Loading branch information
shoyer authored Oct 28, 2024
1 parent cf87ba4 commit 88612ce
Show file tree
Hide file tree
Showing 4 changed files with 503 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
shell: bash -l {0}
env:
CONDA_ENV_FILE: ci/requirements/environment.yml
PYTHON_VERSION: "3.11"
PYTHON_VERSION: "3.12"

steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ accel = ["scipy", "bottleneck", "numbagg", "numba>=0.54", "flox", "opt_einsum"]
complete = ["xarray[accel,etc,io,parallel,viz]"]
dev = [
"hypothesis",
"jinja2",
"mypy",
"pre-commit",
"pytest",
Expand Down
Loading

0 comments on commit 88612ce

Please sign in to comment.