Skip to content

Commit 5337bd4

Browse files
committed
Merge remote-tracking branch 'upstream/main' into groupby-aggs-using-numpy-groupies
* upstream/main: [pre-commit.ci] pre-commit autoupdate (pydata#6562) Run mypy tests (but always pass) (pydata#6557) Update issue template to include a checklist (pydata#6522) Remove duplicate tests, v3 (pydata#6550) Skip mypy tests in CI (pydata#6552) Direct usage questions to GH discussions (pydata#6539) Revert "Attempt to improve CI caching (pydata#6534)" (pydata#6543) Revert "Remove duplicate tests (pydata#6536)" (pydata#6540) Remove duplicate tests (pydata#6536) Add a slighly cheesy contributors panel to readme (pydata#6520) Fix doctest & mypy CI jobs (pydata#6535) Attempt to improve CI caching (pydata#6534) Attempt to consolidate tests in CI (pydata#6533) Restrict annotations to a single run in GHA (pydata#6532) Fix some mypy issues (pydata#6531) Pin version of black in pre-commit blackdoc (pydata#6492) Scale numfocus image in readme (pydata#6519) Use new importlib.metadata.entry_points interface where available. (pydata#6516) Add a badge for binder (pydata#6518) Bump codecov/codecov-action from 3.0.0 to 3.1.0 (pydata#6509)
2 parents 5583e34 + cf8f1d6 commit 5337bd4

22 files changed

+212
-144
lines changed

.github/ISSUE_TEMPLATE/bugreport.yml

Lines changed: 15 additions & 5 deletions
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

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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
9+
- name: 🗺️ Raster analysis usage question
1010
url: https://github.com/corteva/rioxarray/discussions
1111
about: |
1212
If you are using the rioxarray extension (engine='rasterio'), or have questions about

.github/ISSUE_TEMPLATE/misc.yml

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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/workflows/ci-additional.yaml

Lines changed: 23 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -30,96 +30,50 @@ 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@v3
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"
122-
if: needs.detect-ci-trigger.outputs.triggered == 'false'
73+
needs: detect-ci-trigger
74+
# temporarily skipping due to https://github.com/pydata/xarray/issues/6551
75+
# if: needs.detect-ci-trigger.outputs.triggered == 'false'
76+
if: false
12377
defaults:
12478
run:
12579
shell: bash -l {0}
@@ -148,9 +102,15 @@ jobs:
148102
conda info -a
149103
conda list
150104
python xarray/util/print_versions.py
151-
- name: Run doctests
105+
- name: Install mypy
152106
run: |
153-
python -m pytest --doctest-modules xarray --ignore xarray/tests
107+
python -m pip install mypy
108+
109+
# Temporarily overriding to be true due to https://github.com/pydata/xarray/issues/6551
110+
# python -m mypy --install-types --non-interactive
111+
- name: Run mypy
112+
run: |
113+
python -m mypy --install-types --non-interactive || true
154114
155115
min-version-policy:
156116
name: Minimum Version Policy
@@ -176,5 +136,5 @@ jobs:
176136
- name: minimum versions policy
177137
run: |
178138
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
139+
python ci/min_deps_check.py ci/requirements/bare-minimum.yml
140+
python ci/min_deps_check.py ci/requirements/min-all-deps.yml

.github/workflows/ci.yaml

Lines changed: 40 additions & 5 deletions
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'
@@ -43,6 +43,22 @@ jobs:
4343
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
4444
# Bookend python versions
4545
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
6287
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,14 +119,17 @@ 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()
@@ -104,7 +139,7 @@ jobs:
104139
path: pytest.xml
105140

106141
- name: Upload code coverage to Codecov
107-
uses: codecov/codecov-action@v3.0.0
142+
uses: codecov/codecov-action@v3.1.0
108143
with:
109144
file: ./coverage.xml
110145
flags: unittests

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ repos:
3535
hooks:
3636
- id: blackdoc
3737
exclude: "generate_reductions.py"
38+
additional_dependencies: ["black==22.3.0"]
3839
- repo: https://github.com/PyCQA/flake8
3940
rev: 4.0.1
4041
hooks:
@@ -45,7 +46,7 @@ repos:
4546
# - id: velin
4647
# args: ["--write", "--compact"]
4748
- repo: https://github.com/pre-commit/mirrors-mypy
48-
rev: v0.942
49+
rev: v0.950
4950
hooks:
5051
- id: mypy
5152
# Copied from setup.cfg

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[![image](https://img.shields.io/pypi/v/xarray.svg)](https://pypi.python.org/pypi/xarray/)
88
[![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
99
[![image](https://zenodo.org/badge/DOI/10.5281/zenodo.598201.svg)](https://doi.org/10.5281/zenodo.598201)
10+
[![badge](https://img.shields.io/badge/launch-binder-579ACA.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6jbh7jbiDirOEibOGnKaMhq+PnaCVg6qWg6qegKaff6WhnpKofKGtnomxeZy3noG6dZi+n3vCcpPDcpPGn3bLb4/Mb47UbIrVa4rYoGjdaIbeaIXhoWHmZYHobXvpcHjqdHXreHLroVrsfG/uhGnuh2bwj2Hxk17yl1vzmljzm1j0nlX1olL3AJXWAAAAbXRSTlMAEBAQHx8gICAuLjAwMDw9PUBAQEpQUFBXV1hgYGBkcHBwcXl8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IiF6PnTusOqcMl57gm0Z8kanKMAQg0qSyuZfn7zItsbGyO9QlnxY0eCuD1XL2ys/MsrQhltE7Ug0uFOzufJFE2PxBo/YAx8XPPdDwWN0MrDRYIZF0mSMKCNHgaIVFoBbNoLJ7tEQDKxGF0kcLQimojCZopv0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC)](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/weather-data.ipynb)
1011
[![image](https://img.shields.io/twitter/follow/xarray_dev?style=social)](https://twitter.com/xarray_dev)
1112

1213
**xarray** (formerly **xray**) is an open source project and Python
@@ -71,7 +72,7 @@ page](https://docs.xarray.dev/en/latest/contributing.html#).
7172
## Get in touch
7273

7374
- Ask usage questions ("How do I?") on
74-
[StackOverflow](https://stackoverflow.com/questions/tagged/python-xarray).
75+
[GitHub Discussions](https://github.com/pydata/xarray/discussions).
7576
- Report bugs, suggest features or view the source code [on
7677
GitHub](https://github.com/pydata/xarray).
7778
- For less well defined questions or ideas, or to announce other
@@ -80,7 +81,7 @@ page](https://docs.xarray.dev/en/latest/contributing.html#).
8081

8182
## NumFOCUS
8283

83-
[![image](https://numfocus.org/wp-content/uploads/2017/07/NumFocus_LRG.png)](https://numfocus.org/)
84+
<img src="https://numfocus.org/wp-content/uploads/2017/07/NumFocus_LRG.png" width="200" href="https://numfocus.org/">
8485

8586
Xarray is a fiscally sponsored project of
8687
[NumFOCUS](https://numfocus.org), a nonprofit dedicated to supporting
@@ -98,6 +99,12 @@ released as open source in May 2014. The project was renamed from
9899
"xray" in January 2016. Xarray became a fiscally sponsored project of
99100
[NumFOCUS](https://numfocus.org) in August 2018.
100101

102+
## Contributors
103+
104+
Thanks to our many contributors!
105+
106+
[![Contributors](https://contrib.rocks/image?repo=pydata/xarray)](https://github.com/pydata/xarray/graphs/contributors)
107+
101108
## License
102109

103110
Copyright 2014-2019, xarray Developers

ci/requirements/py39-all-but-dask.yml renamed to ci/requirements/all-but-dask.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
- conda-forge
44
- nodefaults
55
dependencies:
6-
- python=3.9
6+
- python=3.10
77
- black
88
- aiobotocore
99
- boto3
@@ -18,7 +18,7 @@ dependencies:
1818
- h5py
1919
- hdf5
2020
- hypothesis
21-
- lxml # Optional dep of pydap
21+
- lxml # Optional dep of pydap
2222
- matplotlib-base
2323
- nc-time-axis
2424
- netcdf4
@@ -43,4 +43,4 @@ dependencies:
4343
- typing_extensions
4444
- zarr
4545
- pip:
46-
- numbagg
46+
- numbagg

ci/requirements/environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ dependencies:
3838
- pytest
3939
- pytest-cov
4040
- pytest-env
41-
- pytest-github-actions-annotate-failures
4241
- pytest-xdist
4342
- rasterio
4443
- scipy

0 commit comments

Comments
 (0)