Skip to content
forked from pydata/xarray

Commit 1277544

Browse files
committed
Merge branch 'main' into groupby-refactor-init
* 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) ...
2 parents 299e6c9 + b080349 commit 1277544

File tree

108 files changed

+5363
-3234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+5363
-3234
lines changed

.github/ISSUE_TEMPLATE/bugreport.yml

+22-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Bug Report
1+
name: 🐛 Bug Report
22
description: File a bug report to help us improve
33
labels: [bug, "needs triage"]
44
body:
@@ -26,14 +26,24 @@ body:
2626
attributes:
2727
label: Minimal Complete Verifiable Example
2828
description: |
29-
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:
29+
Minimal, self-contained copy-pastable example that demonstrates the issue. This will be automatically formatted into code, so no need for markdown backticks.
30+
render: Python
31+
32+
- type: checkboxes
33+
id: mvce-checkboxes
34+
attributes:
35+
label: MVCE confirmation
36+
description: |
37+
Please confirm that the bug report is in an excellent state, so we can understand & fix it quickly & efficiently. For more details, check out:
3038
3139
- [Minimal Complete Verifiable Examples](https://stackoverflow.com/help/mcve)
3240
- [Craft Minimal Bug Reports](http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)
3341
34-
Bug reports that follow these guidelines are easier to diagnose, and so are often handled much more quickly.
35-
This will be automatically formatted into code, so no need for markdown backticks.
36-
render: Python
42+
options:
43+
- label: Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
44+
- label: Complete example — the example is self-contained, including all data and the text of any traceback.
45+
- 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.
46+
- label: New issue — a search of GitHub Issues suggests this is not a duplicate.
3747

3848
- type: textarea
3949
id: log-output
@@ -54,6 +64,12 @@ body:
5464
attributes:
5565
label: Environment
5666
description: |
57-
Paste the output of `xr.show_versions()` here
67+
Paste the output of `xr.show_versions()` between the `<details>` tags, leaving an empty line following the opening tag.
68+
value: |
69+
<details>
70+
71+
72+
73+
</details>
5874
validations:
5975
required: true

.github/ISSUE_TEMPLATE/config.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
blank_issues_enabled: false
22
contact_links:
3-
- name: Usage question
3+
- name: Usage question
44
url: https://github.com/pydata/xarray/discussions
55
about: |
66
Ask questions and discuss with other community members here.
77
If you have a question like "How do I concatenate a list of datasets?" then
88
please include a self-contained reproducible example if possible.
9+
- name: 🗺️ Raster analysis usage question
10+
url: https://github.com/corteva/rioxarray/discussions
11+
about: |
12+
If you are using the rioxarray extension (engine='rasterio'), or have questions about
13+
raster analysis such as geospatial formats, coordinate reprojection, etc.,
14+
please use the rioxarray discussion forum.

.github/ISSUE_TEMPLATE/misc.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: Issue
2-
description: General Issue or discussion topic. For usage questions, please follow the "Usage question" link
1+
name: 📝 Issue
2+
description: General issue, that's not a bug report.
33
labels: ["needs triage"]
44
body:
55
- type: markdown

.github/ISSUE_TEMPLATE/newfeature.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Feature Request
1+
name: 💡 Feature Request
22
description: Suggest an idea for xarray
33
labels: [enhancement]
44
body:

.github/stale.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Configuration for probot-stale - https://github.com/probot/stale
22

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

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

1616
# Set to true to ignore issues in a project (defaults to false)
17-
exemptProjects: false
17+
exemptProjects: true
1818

1919
# Set to true to ignore issues in a milestone (defaults to false)
20-
exemptMilestones: false
20+
exemptMilestones: true
2121

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

4245
# Limit the number of actions per hour, from 1-30. Default is 30
43-
limitPerRun: 1 # start with a small number
44-
46+
limitPerRun: 2 # start with a small number
4547

4648
# Limit to only `issues` or `pulls`
4749
# only: issues

.github/workflows/benchmarks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
cp benchmarks/README_CI.md benchmarks.log .asv/results/
6868
working-directory: ${{ env.ASV_DIR }}
6969

70-
- uses: actions/upload-artifact@v2
70+
- uses: actions/upload-artifact@v3
7171
if: always()
7272
with:
7373
name: asv-benchmark-results-${{ runner.os }}

.github/workflows/ci-additional.yaml

+19-62
Original file line numberDiff line numberDiff line change
@@ -30,95 +30,48 @@ jobs:
3030
with:
3131
keyword: "[skip-ci]"
3232

33-
test:
34-
name: ${{ matrix.os }} ${{ matrix.env }}
35-
runs-on: ${{ matrix.os }}
33+
doctest:
34+
name: Doctests
35+
runs-on: "ubuntu-latest"
3636
needs: detect-ci-trigger
3737
if: needs.detect-ci-trigger.outputs.triggered == 'false'
3838
defaults:
3939
run:
4040
shell: bash -l {0}
41-
strategy:
42-
fail-fast: false
43-
matrix:
44-
os: ["ubuntu-latest"]
45-
env:
46-
[
47-
# Minimum python version:
48-
"py38-bare-minimum",
49-
"py38-min-all-deps",
5041

51-
# Latest python version:
52-
"py39-all-but-dask",
53-
"py39-flaky",
54-
]
5542
steps:
5643
- uses: actions/checkout@v3
5744
with:
5845
fetch-depth: 0 # Fetch all history for all branches and tags.
59-
60-
- name: Set environment variables
61-
run: |
62-
if [[ ${{ matrix.env }} == "py39-flaky" ]] ;
63-
then
64-
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
65-
echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests" >> $GITHUB_ENV
66-
67-
else
68-
echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV
69-
fi
70-
- name: Cache conda
71-
uses: actions/cache@v2
72-
with:
73-
path: ~/conda_pkgs_dir
74-
key:
75-
${{ runner.os }}-conda-${{ matrix.env }}-${{
76-
hashFiles('ci/requirements/**.yml') }}
77-
7846
- uses: conda-incubator/setup-miniconda@v2
7947
with:
8048
channels: conda-forge
8149
channel-priority: strict
8250
mamba-version: "*"
8351
activate-environment: xarray-tests
8452
auto-update-conda: false
85-
python-version: 3.9
86-
use-only-tar-bz2: true
53+
python-version: "3.9"
8754

8855
- name: Install conda dependencies
8956
run: |
90-
mamba env update -f $CONDA_ENV_FILE
91-
57+
mamba env update -f ci/requirements/environment.yml
9258
- name: Install xarray
9359
run: |
9460
python -m pip install --no-deps -e .
95-
9661
- name: Version info
9762
run: |
9863
conda info -a
9964
conda list
10065
python xarray/util/print_versions.py
101-
- name: Import xarray
102-
run: |
103-
python -c "import xarray"
104-
- name: Run tests
66+
- name: Run doctests
10567
run: |
106-
python -m pytest -n 4 \
107-
--cov=xarray \
108-
--cov-report=xml \
109-
$PYTEST_EXTRA_FLAGS
68+
python -m pytest --doctest-modules xarray --ignore xarray/tests
11069
111-
- name: Upload code coverage to Codecov
112-
uses: codecov/[email protected]
113-
with:
114-
file: ./coverage.xml
115-
flags: unittests,${{ matrix.env }}
116-
env_vars: RUNNER_OS
117-
name: codecov-umbrella
118-
fail_ci_if_error: false
119-
doctest:
120-
name: Doctests
70+
mypy:
71+
name: Mypy
12172
runs-on: "ubuntu-latest"
73+
needs: detect-ci-trigger
74+
# temporarily skipping due to https://github.com/pydata/xarray/issues/6551
12275
if: needs.detect-ci-trigger.outputs.triggered == 'false'
12376
defaults:
12477
run:
@@ -148,9 +101,13 @@ jobs:
148101
conda info -a
149102
conda list
150103
python xarray/util/print_versions.py
151-
- name: Run doctests
104+
- name: Install mypy
152105
run: |
153-
python -m pytest --doctest-modules xarray --ignore xarray/tests
106+
python -m pip install mypy
107+
108+
- name: Run mypy
109+
run: |
110+
python -m mypy --install-types --non-interactive
154111
155112
min-version-policy:
156113
name: Minimum Version Policy
@@ -176,5 +133,5 @@ jobs:
176133
- name: minimum versions policy
177134
run: |
178135
mamba install -y pyyaml conda python-dateutil
179-
python ci/min_deps_check.py ci/requirements/py38-bare-minimum.yml
180-
python ci/min_deps_check.py ci/requirements/py38-min-all-deps.yml
136+
python ci/min_deps_check.py ci/requirements/bare-minimum.yml
137+
python ci/min_deps_check.py ci/requirements/min-all-deps.yml

.github/workflows/ci.yaml

+44-9
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
with:
3131
keyword: "[skip-ci]"
3232
test:
33-
name: ${{ matrix.os }} py${{ matrix.python-version }}
33+
name: ${{ matrix.os }} py${{ matrix.python-version }} ${{ matrix.env }}
3434
runs-on: ${{ matrix.os }}
3535
needs: detect-ci-trigger
3636
if: needs.detect-ci-trigger.outputs.triggered == 'false'
@@ -42,7 +42,23 @@ jobs:
4242
matrix:
4343
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
4444
# Bookend python versions
45-
python-version: ["3.8", "3.9", "3.10"]
45+
python-version: ["3.8", "3.10"]
46+
env: [""]
47+
include:
48+
# Minimum python version:
49+
- env: "bare-minimum"
50+
python-version: "3.8"
51+
os: ubuntu-latest
52+
- env: "min-all-deps"
53+
python-version: "3.8"
54+
os: ubuntu-latest
55+
# Latest python version:
56+
- env: "all-but-dask"
57+
python-version: "3.10"
58+
os: ubuntu-latest
59+
- env: "flaky"
60+
python-version: "3.10"
61+
os: ubuntu-latest
4662
steps:
4763
- uses: actions/checkout@v3
4864
with:
@@ -52,18 +68,27 @@ jobs:
5268
if [[ ${{ matrix.os }} == windows* ]] ;
5369
then
5470
echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV
71+
elif [[ "${{ matrix.env }}" != "" ]] ;
72+
then
73+
if [[ "${{ matrix.env }}" == "flaky" ]] ;
74+
then
75+
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
76+
echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests" >> $GITHUB_ENV
77+
else
78+
echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV
79+
fi
5580
else
5681
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
57-
5882
fi
83+
5984
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
6085
6186
- name: Cache conda
62-
uses: actions/cache@v2
87+
uses: actions/cache@v3
6388
with:
6489
path: ~/conda_pkgs_dir
65-
key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{
66-
hashFiles('ci/requirements/**.yml') }}
90+
key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{ hashFiles('ci/requirements/**.yml') }}-${{ matrix.env }}
91+
6792
- uses: conda-incubator/setup-miniconda@v2
6893
with:
6994
channels: conda-forge
@@ -78,6 +103,13 @@ jobs:
78103
run: |
79104
mamba env update -f $CONDA_ENV_FILE
80105
106+
# We only want to install this on one run, because otherwise we'll have
107+
# duplicate annotations.
108+
- name: Install error reporter
109+
if: ${{ matrix.os }} == 'ubuntu-latest' and ${{ matrix.python-version }} == '3.10'
110+
run: |
111+
python -m pip install pytest-github-actions-annotate-failures
112+
81113
- name: Install xarray
82114
run: |
83115
python -m pip install --no-deps -e .
@@ -87,24 +119,27 @@ jobs:
87119
conda info -a
88120
conda list
89121
python xarray/util/print_versions.py
122+
90123
- name: Import xarray
91124
run: |
92125
python -c "import xarray"
126+
93127
- name: Run tests
94128
run: python -m pytest -n 4
95129
--cov=xarray
96130
--cov-report=xml
97131
--junitxml=pytest.xml
132+
$PYTEST_EXTRA_FLAGS
98133

99134
- name: Upload test results
100135
if: always()
101-
uses: actions/upload-artifact@v2
136+
uses: actions/upload-artifact@v3
102137
with:
103138
name: Test results for ${{ runner.os }}-${{ matrix.python-version }}
104139
path: pytest.xml
105140

106141
- name: Upload code coverage to Codecov
107-
uses: codecov/codecov-action@v2.1.0
142+
uses: codecov/codecov-action@v3.1.0
108143
with:
109144
file: ./coverage.xml
110145
flags: unittests
@@ -118,7 +153,7 @@ jobs:
118153
if: github.repository == 'pydata/xarray'
119154
steps:
120155
- name: Upload
121-
uses: actions/upload-artifact@v2
156+
uses: actions/upload-artifact@v3
122157
with:
123158
name: Event File
124159
path: ${{ github.event_path }}

0 commit comments

Comments
 (0)