Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
with:
fetch-depth: 2
persist-credentials: false

- uses: xarray-contrib/ci-trigger@10cd2bfec3484946a4058a421ddf9cfad101e715 # v1.2.1
id: detect-trigger
with:
Expand All @@ -50,8 +51,10 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: xarray-contrib/pixi-lock/create-and-cache@1fab4c17af8243f6ca1321bc941cf2325f46c05d # v0.1.1
id: pixi-lock

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pixi-lock
Expand Down Expand Up @@ -81,6 +84,7 @@ jobs:
uses: xarray-contrib/pixi-lock/restore@1fab4c17af8243f6ca1321bc941cf2325f46c05d # v0.1.1
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}

- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }}
Expand All @@ -91,6 +95,7 @@ jobs:
- name: Version info
run: |
pixi run -e ${{env.PIXI_ENV}} -- python xarray/util/print_versions.py

- name: Run doctests
run: |
# Raise an error if there are warnings in the doctests, with `-Werror`.
Expand All @@ -116,27 +121,31 @@ jobs:
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
persist-credentials: false

- name: Restore cached pixi lockfile
uses: xarray-contrib/pixi-lock/restore@1fab4c17af8243f6ca1321bc941cf2325f46c05d # v0.1.1
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}

- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }}
cache: true
environments: ${{ env.PIXI_ENV }}
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}

- name: set environment variables
run: |
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
echo "PYTHON_VERSION=$(pixi run -e ${{env.PIXI_ENV}} -- python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV

- name: Version info
run: |
pixi run -e ${{env.PIXI_ENV}} -- python xarray/util/print_versions.py

- name: Run mypy
run: |
pixi run -e ${{env.PIXI_ENV}} -- python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
pixi run -e ${{env.PIXI_ENV}} -- python -m mypy --cobertura-xml-report mypy_report

- name: Upload mypy coverage to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
Expand All @@ -162,27 +171,31 @@ jobs:
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
persist-credentials: false

- name: Restore cached pixi lockfile
uses: xarray-contrib/pixi-lock/restore@1fab4c17af8243f6ca1321bc941cf2325f46c05d # v0.1.1
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}

- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }}
cache: true
environments: ${{ env.PIXI_ENV }}
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}

- name: set environment variables
run: |
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
echo "PYTHON_VERSION=$(pixi run -e ${{env.PIXI_ENV}} -- python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV

- name: Version info
run: |
pixi run -e ${{env.PIXI_ENV}} -- python xarray/util/print_versions.py

- name: Run mypy
run: |
pixi run -e ${{env.PIXI_ENV}} -- python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
pixi run -e ${{env.PIXI_ENV}} -- python -m mypy --cobertura-xml-report mypy_report

- name: Upload mypy coverage to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
Expand Down Expand Up @@ -216,6 +229,7 @@ jobs:
uses: xarray-contrib/pixi-lock/restore@1fab4c17af8243f6ca1321bc941cf2325f46c05d # v0.1.1
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}

- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }}
Expand All @@ -227,10 +241,6 @@ jobs:
run: |
pixi run -e ${{env.PIXI_ENV}} -- python xarray/util/print_versions.py

- name: Install type stubs
run: |
pixi run -e ${{env.PIXI_ENV}} -- python -m mypy --install-types --non-interactive xarray/ || true

- name: Run stubtest (core modules)
run: |
pixi run -e ${{env.PIXI_ENV}} -- python -m mypy.stubtest \
Expand Down Expand Up @@ -267,16 +277,19 @@ jobs:
uses: xarray-contrib/pixi-lock/restore@1fab4c17af8243f6ca1321bc941cf2325f46c05d # v0.1.1
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}

- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }}
cache: true
environments: ${{ matrix.pixi-env }}
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}

- name: set environment variables
run: |
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
echo "PYTHON_VERSION=$(pixi run -e ${{ matrix.pixi-env }} -- python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV

- name: Version info
run: |
pixi run -e ${{ matrix.pixi-env }} -- python xarray/util/print_versions.py
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: xarray-contrib/pixi-lock/create-and-cache@1fab4c17af8243f6ca1321bc941cf2325f46c05d # v0.1.1
id: pixi-lock

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pixi-lock
Expand Down Expand Up @@ -107,10 +109,12 @@ jobs:
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
persist-credentials: false

- name: Restore cached pixi lockfile
uses: xarray-contrib/pixi-lock/restore@1fab4c17af8243f6ca1321bc941cf2325f46c05d # v0.1.1
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}

- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/hypothesis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
with:
fetch-depth: 2
persist-credentials: false

- uses: xarray-contrib/ci-trigger@10cd2bfec3484946a4058a421ddf9cfad101e715 # v1.2.1
id: detect-trigger
with:
Expand All @@ -57,8 +58,10 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: xarray-contrib/pixi-lock/create-and-cache@1fab4c17af8243f6ca1321bc941cf2325f46c05d # v0.1.1
id: pixi-lock

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pixi-lock
Expand Down Expand Up @@ -89,6 +92,7 @@ jobs:
uses: xarray-contrib/pixi-lock/restore@1fab4c17af8243f6ca1321bc941cf2325f46c05d # v0.1.1
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}

- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/pypi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
name: Install Python
with:
Expand All @@ -52,6 +53,7 @@ jobs:
else
echo "✅ Looks good"
fi

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: releases
Expand All @@ -65,10 +67,12 @@ jobs:
name: Install Python
with:
python-version: "3.12"

- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: releases
path: dist

- name: List contents of built dist
run: |
ls -ltrh
Expand Down Expand Up @@ -96,6 +100,7 @@ jobs:
with:
name: releases
path: dist

- name: Publish package to TestPyPI
if: github.event_name == 'push'
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
Expand All @@ -119,6 +124,7 @@ jobs:
with:
name: releases
path: dist

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
with:
fetch-depth: 2
persist-credentials: false

- uses: xarray-contrib/ci-trigger@10cd2bfec3484946a4058a421ddf9cfad101e715 # v1.2.1
id: detect-trigger
with:
Expand Down Expand Up @@ -69,13 +70,15 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: xarray-contrib/pixi-lock/create-and-cache@1fab4c17af8243f6ca1321bc941cf2325f46c05d # v0.1.1
id: pixi-lock
with:
manifest-path: ${{ env.MANIFEST_PATH }}
hash-files: |
${{ env.MANIFEST_PATH }}
pyproject.toml

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pixi-lock
Expand Down Expand Up @@ -108,28 +111,34 @@ jobs:
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
persist-credentials: false

- name: Determine log path
id: determine-log-path
run: |
echo "log-file=output-${ENV}-log.jsonl" >> $GITHUB_OUTPUT;

- name: Restore cached pixi lockfile
uses: xarray-contrib/pixi-lock/restore@1fab4c17af8243f6ca1321bc941cf2325f46c05d # v0.1.1
with:
manifest-path: ${{ env.MANIFEST_PATH }}
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}

- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }}
cache: true
environments: ${{ matrix.pixi-env }}
manifest-path: ${{ env.MANIFEST_PATH }}
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}

- name: Version info
run: |
pixi run --manifest-path "$MANIFEST_PATH" -e $ENV -- python xarray/util/print_versions.py

- name: Import xarray
run: |
pixi run --manifest-path "$MANIFEST_PATH" -e $ENV -- python -c 'import xarray'

- name: Run Tests
if: success()
id: status
Expand All @@ -141,6 +150,7 @@ jobs:
-e $ENV \
-- \
python -m pytest --timeout=60 -rf -nauto --report-log "$LOG_PATH"

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: failure()
with:
Expand All @@ -165,6 +175,7 @@ jobs:
with:
name: log file
path: logs/

- name: Generate and publish the report
uses: scientific-python/issue-from-pytest-log-action@35b4e0a9e06f8e7e261778289cf4b968b722662d # v1.6.2
with:
Expand Down Expand Up @@ -201,6 +212,7 @@ jobs:
with:
manifest-path: ${{ env.MANIFEST_PATH }}
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}

- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }}
Expand All @@ -213,12 +225,15 @@ jobs:
run: |
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
echo "PYTHON_VERSION=$(pixi run --manifest-path "$MANIFEST_PATH" -e $ENV -- python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV

- name: Version info
run: |
pixi run --manifest-path "$MANIFEST_PATH" -e $ENV -- python xarray/util/print_versions.py

- name: Run mypy
run: |
pixi run --manifest-path "$MANIFEST_PATH" -e $ENV -- python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report

- name: Upload mypy coverage to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
Expand Down
11 changes: 7 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ repos:
typing-extensions>=4.1.0,
numpy,
]
# keep the mypy version used in CI (pixi.toml) in sync with the hook above, so that the
# pre-commit.ci autoupdate also updates mypy in CI
# keep the mypy version used in CI (pixi.toml) and the dev dependency group
# (pyproject.toml) in sync with the hook above, so that the pre-commit.ci autoupdate
# also updates mypy in CI and for uv users
- repo: local
hooks:
- id: sync-mypy-version
name: sync the mypy version in pixi.toml
name: sync mypy version
language: python
files: ^\.pre-commit-config\.yaml$
pass_filenames: false
Expand All @@ -73,7 +74,9 @@ repos:
config = pathlib.Path('.pre-commit-config.yaml').read_text();
version = re.search(r'mirrors-mypy\s+rev: v?([0-9.]+)', config).group(1);
pixi = pathlib.Path('pixi.toml');
pixi.write_text(re.sub(r'(?m)^mypy = \"==[0-9.]+\"', f'mypy = \"=={version}\"', pixi.read_text()))"
pixi.write_text(re.sub(r'(?m)^mypy = \"==[0-9.]+\"', f'mypy = \"=={version}\"', pixi.read_text()));
pyproject = pathlib.Path('pyproject.toml');
pyproject.write_text(re.sub(r'\"mypy==[0-9.]+\"', f'\"mypy=={version}\"', pyproject.read_text()))"
- repo: https://github.com/citation-file-format/cff-converter-python
rev: 5295f87c0e261da61a7b919fc754e3a77edd98a7
hooks:
Expand Down
1 change: 1 addition & 0 deletions doc/user-guide/ecosystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Geosciences
- `cf_xarray <https://cf-xarray.readthedocs.io/en/latest/>`_: Provides an accessor (DataArray.cf or Dataset.cf) that allows you to interpret Climate and Forecast metadata convention attributes present on xarray objects.
- `climpred <https://climpred.readthedocs.io>`_: Analysis of ensemble forecast models for climate prediction.
- `geocube <https://corteva.github.io/geocube>`_: Tool to convert geopandas vector data into rasterized xarray data.
- `GeoUtils <https://geoutils.readthedocs.io>`_: Raster and vector operations for geospatial analysis, built on rasterio and geopandas.
- `GeoWombat <https://github.com/jgrss/geowombat>`_: Utilities for analysis of remotely sensed and gridded raster data at scale (easily tame Landsat, Sentinel, Quickbird, and PlanetScope).
- `grib2io <https://github.com/NOAA-MDL/grib2io>`_: Utility to work with GRIB2 files including an xarray backend, DASK support for parallel reading in open_mfdataset, lazy loading of data, editing of GRIB2 attributes and GRIB2IO DataArray attrs, and spatial interpolation and reprojection of GRIB2 messages and GRIB2IO Datasets/DataArrays for both grid to grid and grid to stations.
- `gsw-xarray <https://github.com/DocOtak/gsw-xarray>`_: a wrapper around `gsw <https://teos-10.github.io/GSW-Python>`_ that adds CF compliant attributes when possible, units, name.
Expand Down
Loading
Loading