Skip to content
forked from pydata/xarray

Commit

Permalink
Merge branch 'main' into groupby-refactor-init
Browse files Browse the repository at this point in the history
* main: (95 commits)
  Use `zarr` to validate attrs when writing to zarr (pydata#6636)
  Add pre-commit hook to check CITATION.cff (pydata#6658)
  Fix kwargs used for extrapolation in docs (pydata#6639)
  Fix notebooks' HTML links (pydata#6655)
  Doc index update (pydata#6530)
  CFTime support for polyval (pydata#6624)
  Support dask arrays in datetime_to_numeric (pydata#6556)
  [pre-commit.ci] pre-commit autoupdate (pydata#6654)
  0-padded month. (pydata#6653)
  [test-upstream] import `cleanup` fixture from `distributed` (pydata#6650)
  Allow all interp methods in typing (pydata#6647)
  Typing support for custom backends (pydata#6651)
  Improved DataArray typing (pydata#6637)
  Adjust code comments & types from pydata#6638 (pydata#6642)
  Typing of `str` and `dt` accessors (pydata#6641)
  Feature/to dict encoding (pydata#6635)
  fix {full,zeros,ones}_like overloads (pydata#6630)
  Mypy badge (pydata#6626)
  concatenate docs style (pydata#6621)
  Typing for open_dataset/array/mfdataset and to_netcdf/zarr (pydata#6612)
  ...
  • Loading branch information
dcherian committed Jun 5, 2022
2 parents 299e6c9 + b080349 commit 1277544
Show file tree
Hide file tree
Showing 108 changed files with 5,363 additions and 3,234 deletions.
28 changes: 22 additions & 6 deletions .github/ISSUE_TEMPLATE/bugreport.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Bug Report
name: 🐛 Bug Report
description: File a bug report to help us improve
labels: [bug, "needs triage"]
body:
Expand Down Expand Up @@ -26,14 +26,24 @@ body:
attributes:
label: Minimal Complete Verifiable Example
description: |
Minimal, self-contained copy-pastable example that generates the issue if possible. Please be concise with code posted. See guidelines below on how to provide a good bug report:
Minimal, self-contained copy-pastable example that demonstrates the issue. This will be automatically formatted into code, so no need for markdown backticks.
render: Python

- type: checkboxes
id: mvce-checkboxes
attributes:
label: MVCE confirmation
description: |
Please confirm that the bug report is in an excellent state, so we can understand & fix it quickly & efficiently. For more details, check out:
- [Minimal Complete Verifiable Examples](https://stackoverflow.com/help/mcve)
- [Craft Minimal Bug Reports](http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)
Bug reports that follow these guidelines are easier to diagnose, and so are often handled much more quickly.
This will be automatically formatted into code, so no need for markdown backticks.
render: Python
options:
- label: Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
- label: Complete example — the example is self-contained, including all data and the text of any traceback.
- label: Verifiable example — the example copy & pastes into an IPython prompt or [Binder notebook](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/blank_template.ipynb), returning the result.
- label: New issue — a search of GitHub Issues suggests this is not a duplicate.

- type: textarea
id: log-output
Expand All @@ -54,6 +64,12 @@ body:
attributes:
label: Environment
description: |
Paste the output of `xr.show_versions()` here
Paste the output of `xr.show_versions()` between the `<details>` tags, leaving an empty line following the opening tag.
value: |
<details>
</details>
validations:
required: true
8 changes: 7 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
blank_issues_enabled: false
contact_links:
- name: Usage question
- name: Usage question
url: https://github.com/pydata/xarray/discussions
about: |
Ask questions and discuss with other community members here.
If you have a question like "How do I concatenate a list of datasets?" then
please include a self-contained reproducible example if possible.
- name: 🗺️ Raster analysis usage question
url: https://github.com/corteva/rioxarray/discussions
about: |
If you are using the rioxarray extension (engine='rasterio'), or have questions about
raster analysis such as geospatial formats, coordinate reprojection, etc.,
please use the rioxarray discussion forum.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/misc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Issue
description: General Issue or discussion topic. For usage questions, please follow the "Usage question" link
name: 📝 Issue
description: General issue, that's not a bug report.
labels: ["needs triage"]
body:
- type: markdown
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/newfeature.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Feature Request
name: 💡 Feature Request
description: Suggest an idea for xarray
labels: [enhancement]
body:
Expand Down
12 changes: 7 additions & 5 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Configuration for probot-stale - https://github.com/probot/stale

# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 700 # start with a large number and reduce shortly
daysUntilStale: 600 # start with a large number and reduce shortly

# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
Expand All @@ -14,10 +14,10 @@ exemptLabels:
- "[Status] Maybe Later"

# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
exemptProjects: true

# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: false
exemptMilestones: true

# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: true
Expand All @@ -31,6 +31,9 @@ markComment: |
If this issue remains relevant, please comment here or remove the `stale` label; otherwise it will be marked as closed automatically
closeComment: |
The stalebot didn't hear anything for a while, so it closed this. Please reopen if this is still an issue.
# Comment to post when removing the stale label.
# unmarkComment: >
# Your comment here.
Expand All @@ -40,8 +43,7 @@ markComment: |
# Your comment here.

# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 1 # start with a small number

limitPerRun: 2 # start with a small number

# Limit to only `issues` or `pulls`
# only: issues
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
cp benchmarks/README_CI.md benchmarks.log .asv/results/
working-directory: ${{ env.ASV_DIR }}

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: always()
with:
name: asv-benchmark-results-${{ runner.os }}
Expand Down
81 changes: 19 additions & 62 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,95 +30,48 @@ jobs:
with:
keyword: "[skip-ci]"

test:
name: ${{ matrix.os }} ${{ matrix.env }}
runs-on: ${{ matrix.os }}
doctest:
name: Doctests
runs-on: "ubuntu-latest"
needs: detect-ci-trigger
if: needs.detect-ci-trigger.outputs.triggered == 'false'
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
env:
[
# Minimum python version:
"py38-bare-minimum",
"py38-min-all-deps",

# Latest python version:
"py39-all-but-dask",
"py39-flaky",
]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: Set environment variables
run: |
if [[ ${{ matrix.env }} == "py39-flaky" ]] ;
then
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests" >> $GITHUB_ENV
else
echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV
fi
- name: Cache conda
uses: actions/cache@v2
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ matrix.env }}-${{
hashFiles('ci/requirements/**.yml') }}

- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
channel-priority: strict
mamba-version: "*"
activate-environment: xarray-tests
auto-update-conda: false
python-version: 3.9
use-only-tar-bz2: true
python-version: "3.9"

- name: Install conda dependencies
run: |
mamba env update -f $CONDA_ENV_FILE
mamba env update -f ci/requirements/environment.yml
- 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: Import xarray
run: |
python -c "import xarray"
- name: Run tests
- name: Run doctests
run: |
python -m pytest -n 4 \
--cov=xarray \
--cov-report=xml \
$PYTEST_EXTRA_FLAGS
python -m pytest --doctest-modules xarray --ignore xarray/tests
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v2.1.0
with:
file: ./coverage.xml
flags: unittests,${{ matrix.env }}
env_vars: RUNNER_OS
name: codecov-umbrella
fail_ci_if_error: false
doctest:
name: Doctests
mypy:
name: Mypy
runs-on: "ubuntu-latest"
needs: detect-ci-trigger
# temporarily skipping due to https://github.com/pydata/xarray/issues/6551
if: needs.detect-ci-trigger.outputs.triggered == 'false'
defaults:
run:
Expand Down Expand Up @@ -148,9 +101,13 @@ jobs:
conda info -a
conda list
python xarray/util/print_versions.py
- name: Run doctests
- name: Install mypy
run: |
python -m pytest --doctest-modules xarray --ignore xarray/tests
python -m pip install mypy
- name: Run mypy
run: |
python -m mypy --install-types --non-interactive
min-version-policy:
name: Minimum Version Policy
Expand All @@ -176,5 +133,5 @@ jobs:
- name: minimum versions policy
run: |
mamba install -y pyyaml conda python-dateutil
python ci/min_deps_check.py ci/requirements/py38-bare-minimum.yml
python ci/min_deps_check.py ci/requirements/py38-min-all-deps.yml
python ci/min_deps_check.py ci/requirements/bare-minimum.yml
python ci/min_deps_check.py ci/requirements/min-all-deps.yml
53 changes: 44 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
with:
keyword: "[skip-ci]"
test:
name: ${{ matrix.os }} py${{ matrix.python-version }}
name: ${{ matrix.os }} py${{ matrix.python-version }} ${{ matrix.env }}
runs-on: ${{ matrix.os }}
needs: detect-ci-trigger
if: needs.detect-ci-trigger.outputs.triggered == 'false'
Expand All @@ -42,7 +42,23 @@ jobs:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
# Bookend python versions
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.10"]
env: [""]
include:
# Minimum python version:
- env: "bare-minimum"
python-version: "3.8"
os: ubuntu-latest
- env: "min-all-deps"
python-version: "3.8"
os: ubuntu-latest
# Latest python version:
- env: "all-but-dask"
python-version: "3.10"
os: ubuntu-latest
- env: "flaky"
python-version: "3.10"
os: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -52,18 +68,27 @@ jobs:
if [[ ${{ matrix.os }} == windows* ]] ;
then
echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV
elif [[ "${{ matrix.env }}" != "" ]] ;
then
if [[ "${{ matrix.env }}" == "flaky" ]] ;
then
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests" >> $GITHUB_ENV
else
echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV
fi
else
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
fi
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Cache conda
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{
hashFiles('ci/requirements/**.yml') }}
key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{ hashFiles('ci/requirements/**.yml') }}-${{ matrix.env }}

- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
Expand All @@ -78,6 +103,13 @@ jobs:
run: |
mamba env update -f $CONDA_ENV_FILE
# We only want to install this on one run, because otherwise we'll have
# duplicate annotations.
- name: Install error reporter
if: ${{ matrix.os }} == 'ubuntu-latest' and ${{ matrix.python-version }} == '3.10'
run: |
python -m pip install pytest-github-actions-annotate-failures
- name: Install xarray
run: |
python -m pip install --no-deps -e .
Expand All @@ -87,24 +119,27 @@ jobs:
conda info -a
conda list
python xarray/util/print_versions.py
- name: Import xarray
run: |
python -c "import xarray"
- name: Run tests
run: python -m pytest -n 4
--cov=xarray
--cov-report=xml
--junitxml=pytest.xml
$PYTEST_EXTRA_FLAGS

- name: Upload test results
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: Test results for ${{ runner.os }}-${{ matrix.python-version }}
path: pytest.xml

- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v2.1.0
uses: codecov/codecov-action@v3.1.0
with:
file: ./coverage.xml
flags: unittests
Expand All @@ -118,7 +153,7 @@ jobs:
if: github.repository == 'pydata/xarray'
steps:
- name: Upload
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: Event File
path: ${{ github.event_path }}
Loading

0 comments on commit 1277544

Please sign in to comment.