Skip to content

Commit

Permalink
Merge branch 'main' into hypothesis-strategies
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNicholas committed Jul 20, 2023
2 parents 9777c2a + 2bf15f8 commit 4dcbc60
Show file tree
Hide file tree
Showing 219 changed files with 27,196 additions and 10,452 deletions.
7 changes: 0 additions & 7 deletions .coveragerc

This file was deleted.

3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
23 changes: 23 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Comment to be posted to on first time issues
newIssueWelcomeComment: >
Thanks for opening your first issue here at xarray! Be sure to follow the issue template!
If you have an idea for a solution, we would really welcome a Pull Request with proposed changes.
See the [Contributing Guide](https://docs.xarray.dev/en/latest/contributing.html) for more.
It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better.
Thank you!
# Comment to be posted to on PRs from first time contributors in your repository
newPRWelcomeComment: >
Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient.
If you have questions, some answers may be found in our [contributing guidelines](http://docs.xarray.dev/en/stable/contributing.html).
# Comment to be posted to on pull requests merged by a first time user
firstPRMergeComment: >
Congratulations on completing your first pull request! Welcome to Xarray!
We are proud of you, and hope to see you again!
![celebration gif](https://media.giphy.com/media/umYMU8G2ixG5mJBDo5/giphy.gif)
4 changes: 0 additions & 4 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ topic-indexing:
- xarray/core/indexes.py
- xarray/core/indexing.py

run-benchmark:
- asv_bench/benchmarks/*
- asv_bench/benchmarks/**/*

topic-performance:
- asv_bench/benchmarks/*
- asv_bench/benchmarks/**/*
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/benchmarks-last-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Benchmark compare last release

on:
push:
branches:
- main
workflow_dispatch:

jobs:
benchmark:
name: Linux
runs-on: ubuntu-20.04
env:
ASV_DIR: "./asv_bench"
CONDA_ENV_FILE: ci/requirements/environment.yml

steps:
# We need the full repo to avoid this issue
# https://github.com/actions/checkout/issues/23
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up conda environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{env.CONDA_ENV_FILE}}
environment-name: xarray-tests
cache-environment: true
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}-benchmark"
create-args: >-
asv
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
# with:
# fallback: 1.0.0 # Optional fallback tag to use when no tag can be found

- name: Run benchmarks
shell: bash -l {0}
id: benchmark
env:
OPENBLAS_NUM_THREADS: 1
MKL_NUM_THREADS: 1
OMP_NUM_THREADS: 1
ASV_FACTOR: 1.5
ASV_SKIP_SLOW: 1
run: |
set -x
# ID this runner
asv machine --yes
echo "Baseline: ${{ steps.previoustag.outputs.tag }} "
echo "Contender: ${{ github.sha }}"
# Use mamba for env creation
# export CONDA_EXE=$(which mamba)
export CONDA_EXE=$(which conda)
# Run benchmarks for current commit against base
ASV_OPTIONS="--split --show-stderr --factor $ASV_FACTOR"
asv continuous $ASV_OPTIONS ${{ steps.previoustag.outputs.tag }} ${{ github.sha }} \
| sed "/Traceback \|failed$\|PERFORMANCE DECREASED/ s/^/::error::/" \
| tee benchmarks.log
# Report and export results for subsequent steps
if grep "Traceback \|failed\|PERFORMANCE DECREASED" benchmarks.log > /dev/null ; then
exit 1
fi
working-directory: ${{ env.ASV_DIR }}

- name: Add instructions to artifact
if: always()
run: |
cp benchmarks/README_CI.md benchmarks.log .asv/results/
working-directory: ${{ env.ASV_DIR }}

- uses: actions/upload-artifact@v3
if: always()
with:
name: asv-benchmark-results-${{ runner.os }}
path: ${{ env.ASV_DIR }}/.asv/results
20 changes: 10 additions & 10 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ on:

jobs:
benchmark:
if: ${{ contains( github.event.pull_request.labels.*.name, 'run-benchmark') && github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
if: ${{ contains( github.event.pull_request.labels.*.name, 'run-benchmark') && github.event_name == 'pull_request' || contains( github.event.pull_request.labels.*.name, 'topic-performance') && github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
name: Linux
runs-on: ubuntu-20.04
env:
ASV_DIR: "./asv_bench"
CONDA_ENV_FILE: ci/requirements/environment.yml

steps:
# We need the full repo to avoid this issue
Expand All @@ -20,17 +21,16 @@ jobs:
with:
fetch-depth: 0

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
- name: Set up conda environment
uses: mamba-org/setup-micromamba@v1
with:
# installer-url: https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh
installer-url: https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
environment-file: ${{env.CONDA_ENV_FILE}}
environment-name: xarray-tests
cache-environment: true
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}-benchmark"
create-args: >-
asv
- name: Setup some dependencies
shell: bash -l {0}
run: |
pip install asv
sudo apt-get update -y
- name: Run benchmarks
shell: bash -l {0}
Expand Down
100 changes: 84 additions & 16 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: xarray-contrib/ci-trigger@v1.1
- uses: xarray-contrib/ci-trigger@v1
id: detect-trigger
with:
keyword: "[skip-ci]"
Expand Down Expand Up @@ -53,14 +53,15 @@ jobs:
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Setup micromamba
uses: mamba-org/provision-with-micromamba@34071ca7df4983ccd272ed0d3625818b27b70dcc
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{env.CONDA_ENV_FILE}}
environment-name: xarray-tests
extra-specs: |
create-args: >-
python=${{env.PYTHON_VERSION}}
cache-env: true
cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
conda
cache-environment: true
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"

- name: Install xarray
run: |
Expand All @@ -72,7 +73,10 @@ jobs:
python xarray/util/print_versions.py
- name: Run doctests
run: |
python -m pytest --doctest-modules xarray --ignore xarray/tests
# Raise an error if there are warnings in the doctests, with `-Werror`.
# This is a trial; if it presents an problem, feel free to remove.
# See https://github.com/pydata/xarray/issues/7164 for more info.
python -m pytest --doctest-modules xarray --ignore xarray/tests -Werror
mypy:
name: Mypy
Expand All @@ -96,14 +100,15 @@ jobs:
run: |
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Setup micromamba
uses: mamba-org/provision-with-micromamba@34071ca7df4983ccd272ed0d3625818b27b70dcc
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{env.CONDA_ENV_FILE}}
environment-name: xarray-tests
extra-specs: |
create-args: >-
python=${{env.PYTHON_VERSION}}
cache-env: true
cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
conda
cache-environment: true
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
- name: Install xarray
run: |
python -m pip install --no-deps -e .
Expand All @@ -114,11 +119,76 @@ jobs:
python xarray/util/print_versions.py
- name: Install mypy
run: |
python -m pip install mypy
python -m pip install mypy --force-reinstall
- name: Run mypy
run: |
python -m mypy --install-types --non-interactive
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
- name: Upload mypy coverage to Codecov
uses: codecov/[email protected]
with:
file: mypy_report/cobertura.xml
flags: mypy
env_vars: PYTHON_VERSION
name: codecov-umbrella
fail_ci_if_error: false

mypy39:
name: Mypy 3.9
runs-on: "ubuntu-latest"
needs: detect-ci-trigger
defaults:
run:
shell: bash -l {0}
env:
CONDA_ENV_FILE: ci/requirements/environment.yml
PYTHON_VERSION: "3.9"

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: set environment variables
run: |
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{env.CONDA_ENV_FILE}}
environment-name: xarray-tests
create-args: >-
python=${{env.PYTHON_VERSION}}
conda
cache-environment: true
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
- name: Install xarray
run: |
python -m pip install --no-deps -e .
- name: Version info
run: |
conda info -a
conda list
python xarray/util/print_versions.py
- name: Install mypy
run: |
python -m pip install mypy --force-reinstall
- name: Run mypy
run: |
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
- name: Upload mypy coverage to Codecov
uses: codecov/[email protected]
with:
file: mypy_report/cobertura.xml
flags: mypy39
env_vars: PYTHON_VERSION
name: codecov-umbrella
fail_ci_if_error: false



min-version-policy:
name: Minimum Version Policy
Expand All @@ -140,16 +210,14 @@ jobs:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: Setup micromamba
uses: mamba-org/provision-with-micromamba@34071ca7df4983ccd272ed0d3625818b27b70dcc
uses: mamba-org/setup-micromamba@v1
with:
environment-name: xarray-tests
environment-file: false
extra-specs: |
create-args: >-
python=3.10
pyyaml
conda
python-dateutil
channels: conda-forge
- name: minimum versions policy
run: |
Expand Down
Loading

0 comments on commit 4dcbc60

Please sign in to comment.