Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
11 changes: 10 additions & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ on:
tags:
- "v*" # Push events to matching v*, i.e. v0.0.x,

permissions:
contents: read

jobs:
release:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
body: |
Expand All @@ -23,11 +29,14 @@ jobs:
prerelease: false
tag_name: ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}

deploy:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/upstream-dev-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: CI Upstream

on:
push:
branches:
Expand All @@ -11,8 +12,11 @@ on:
workflow_dispatch: # allows you to trigger the workflow run manually

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
detect-ci-trigger:
Expand All @@ -24,9 +28,9 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 2
- uses: xarray-contrib/[email protected]
persist-credentials: false
- uses: xarray-contrib/ci-trigger@v1
id: detect-trigger
with:
keyword: "[test-upstream]"
Expand All @@ -48,15 +52,16 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
python-version: [ "3.11" ]
outputs:
artifacts_availability: ${{ steps.status.outputs.ARTIFACTS_AVAILABLE }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
persist-credentials: false
- name: setup conda (micromamba)
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v2
with:
cache-downloads: true
cache-environment: true
Expand Down Expand Up @@ -93,7 +98,7 @@ jobs:
&& steps.status.outcome == 'failure'
&& github.event_name == 'schedule'
&& github.repository == 'xarray-contrib/xskillscore'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: output-${{ matrix.python-version }}-log
path: output-${{ matrix.python-version }}-log
Expand All @@ -108,6 +113,8 @@ jobs:
&& github.repository == 'xarray-contrib/xskillscore'
&& needs.upstream-dev.outputs.artifacts_availability == 'true'
runs-on: ubuntu-latest
permissions:
issues: write
defaults:
run:
shell: bash
Expand All @@ -118,7 +125,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
path: /tmp/workspace/logs
- name: Move all log files into a single directory
Expand All @@ -131,7 +138,7 @@ jobs:
wget https://raw.githubusercontent.com/pydata/xarray/master/.github/workflows/parse_logs.py
python parse_logs.py logs/**/*-log
- name: Report failures
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down
41 changes: 24 additions & 17 deletions .github/workflows/xskillscore_installs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ name: xskillscore installs
on: pull_request

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
detect-ci-trigger:
Expand All @@ -14,10 +17,11 @@ jobs:
outputs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: xarray-contrib/[email protected]
persist-credentials: false
- uses: xarray-contrib/ci-trigger@v1
id: detect-trigger
with:
keyword: "[skip-ci]"
Expand All @@ -28,19 +32,22 @@ jobs:
needs: detect-ci-trigger
if: needs.detect-ci-trigger.outputs.triggered == 'false'
defaults:
run:
shell: bash {0}
run:
shell: bash {0}
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
python-version: [ "3.9" ]
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -c "import xskillscore"
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -c "import xskillscore"
19 changes: 11 additions & 8 deletions .github/workflows/xskillscore_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
detect-ci-trigger:
name: detect ci trigger
Expand All @@ -17,9 +20,9 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 2
- uses: xarray-contrib/[email protected]
persist-credentials: false
- uses: xarray-contrib/ci-trigger@v1
id: detect-trigger
with:
keyword: "[skip-ci]"
Expand All @@ -35,13 +38,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up conda (micromamba)
uses: mamba-org/setup-micromamba@v2.0.4
uses: mamba-org/setup-micromamba@v2
with:
cache-downloads: true
cache-environment: true
Expand All @@ -52,10 +55,10 @@ jobs:
run: |
pytest -n 4 --cov=xskillscore --cov-report=xml --verbose
- name: Upload coverage to codecov
uses: codecov/codecov-action@v1.5.2
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
files: ./coverage.xml
fail_ci_if_error: false

doctest: # Tests all docstrings
Expand All @@ -75,7 +78,7 @@ jobs:
with:
persist-credentials: false
- name: Set up conda (micromamba)
uses: mamba-org/setup-micromamba@v2.0.4
uses: mamba-org/setup-micromamba@v2
with:
cache-downloads: true
cache-environment: true
Expand Down Expand Up @@ -104,7 +107,7 @@ jobs:
with:
persist-credentials: false
- name: Set up conda (micromamba)
uses: mamba-org/setup-micromamba@v2.0.4
uses: mamba-org/setup-micromamba@v2
with:
cache-downloads: true
cache-environment: true
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.12.2"
hooks:
- id: ruff
args: ["--select", "E,F,I001"]
- id: ruff-check
args: [ "--fix" ]
types_or: [python, pyi, jupyter]
- id: ruff-format
types_or: [python, pyi, jupyter]
Expand All @@ -46,7 +46,7 @@ repos:
rev: v0.4.1
hooks:
- id: blackdoc
additional_dependencies: ["black==23.10.1"]
additional_dependencies: ["black==25.1.0"]

- repo: https://github.com/PyCQA/doc8
rev: v2.0.0
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Internal Changes
updated. (:pr:`426`) `Trevor James Smith`_
- `xskillscore` now uses `setuptools-scm` to automatically determine the
version number. (:pr:`427`) `Trevor James Smith`_
- Updated GitHub Actions and `pre-commit` hook versions to more modern versions.
() `Trevor James Smith`_
- Release documentation steps have been updated to to refer to the new
`setuptools-scm`-based approach. () `Trevor James Smith`_
- The test suite now refers to the `xarray.testing` submodule for basic testing helpers.
() `weipeng1999`_


xskillscore v0.0.26 (2024-03-10)
Expand Down Expand Up @@ -363,4 +369,5 @@ Testing
.. _`Ray Bell`: https://github.com/raybellwaves
.. _`Taher Chegini`: https://github.com/cheginit
.. _`Trevor James Smith`: https://github.com/Zeitsperre
.. _`weipeng1999`: https://github.com/weipeng1999
.. _`Zachary Blackwood`: https://github.com/blackary
9 changes: 0 additions & 9 deletions HOWTOCONTRIBUTE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@ reporting `issues <https://github.com/xarray-contrib/xskillscore/issues>`__.
The following sections cover some general guidelines
regarding development in ``xskillscore`` for maintainers and contributors.


Nothing here is set in stone and can't be changed.
Feel free to suggest improvements or changes in the workflow.



.. contents:: Contribution links
:depth: 2



.. _submitfeedback:

Feature requests and feedback
Expand All @@ -33,7 +28,6 @@ with the label "feature request."
Please make sure to explain in detail how the feature should work and keep the scope as
narrow as possible. This will make it easier to implement in small PRs.


.. _reportbugs:

Report bugs
Expand All @@ -53,7 +47,6 @@ If you are reporting a bug, please include:
If you can write a demonstration test that currently fails but should passm
that is a very useful commit to make as well, even if you cannot fix the bug itself.


.. _fixbugs:

Fix bugs
Expand All @@ -63,7 +56,6 @@ Look through the `GitHub issues for bugs <https://github.com/xarray-contrib/xski

Talk to developers to find out how you can fix specific bugs.


Write documentation
-------------------

Expand Down Expand Up @@ -103,7 +95,6 @@ If you are adding new functions to the API, run ``sphinx-autogen -o api api.rst`
Preparing Pull Requests
-----------------------


#. Fork the
`xskillscore GitHub repository <https://github.com/xarray-contrib/xskillscore>`__. It's
fine to use ``xskillscore`` as your fork repository name because it will live
Expand Down
11 changes: 6 additions & 5 deletions HOWTORELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
Release Procedure
-----------------

#. Clone xskillscore from xarray-contrib, not a personal fork.
#. Clone `xskillscore` from xarray-contrib, not a personal fork.

#. Create a new branch ``release-v0.0.xx`` with the version for the release.

$ git checkout -b release-v0.0.xx

* Update ``CHANGELOG.rst``
* Make sure all new changes, features are reflected in the documentation.
#. Update ``CHANGELOG.rst``

* Update ``pyproject.toml`` and `version` in `xskillscore/__init__`
* Make sure all new changes and features are reflected in the documentation.

#. Open a new pull request for this branch targeting `main`
* Ensure that the release date is set to the current date.

#. Open a new pull request for this branch targeting ``main``

#. After all tests pass and the PR has been approved, merge the PR into ``main``

Expand Down
4 changes: 1 addition & 3 deletions asv_bench/benchmarks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,4 @@ def make_ds(self, nmember, nx, ny, chunks=None):
self.ds.attrs = {"history": "created for xskillscore benchmarking"}

# set nans for land sea mask
self.ds = self.ds.where(
(abs(self.ds.lat) > 20) | (self.ds.lat < 100) | (self.ds.lat > 160)
)
self.ds = self.ds.where((abs(self.ds.lat) > 20) | (self.ds.lat < 100) | (self.ds.lat > 160))
Loading
Loading