Skip to content

Commit ebe9985

Browse files
committed
Merge branch 'main' into generate-reductions-class
* main: (71 commits) Bump actions/setup-python from 2 to 3 (#6338) Bump actions/checkout from 2 to 3 (#6337) In documentation on adding a new backend, add missing import and tweak headings (#6330) Lengthen underline, correct spelling, and reword (#6326) quantile: use skipna=None (#6303) New whatsnew section v2022.03.0 release notes (#6319) fix typos (using codespell) (#6316) Add General issue template (#6314) Disable CI runs on forks (#6315) Enable running sphinx-build on Windows (#6237) Fix class attributes versus init parameters (#6312) On Windows, enable successful test of opening a dataset containing a cftime index (#6305) from_dict: doctest (#6302) Drop duplicates over multiple dims, and add Dataset.drop_duplicates (#6307) Amended docs on how to add a new backend (#6292) Adding the new wrapper gsw-xarray (#6294) Amended docstring to reflect the actual behaviour of Dataset.map (#6232) Align language def in bugreport.yml with schema (#6290) Move Zarr up in io.rst (#6289) ...
2 parents 1fcd080 + d293f50 commit ebe9985

File tree

131 files changed

+3581
-4912
lines changed

Some content is hidden

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

131 files changed

+3581
-4912
lines changed

.binder/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies:
2323
- netcdf4
2424
- numba
2525
- numpy
26+
- packaging
2627
- pandas
2728
- pint
2829
- pip

.github/ISSUE_TEMPLATE/bugreport.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Bug Report
22
description: File a bug report to help us improve
3-
title: '[Bug]: '
4-
labels: [bug, 'needs triage']
5-
assignees: []
3+
labels: [bug, "needs triage"]
64
body:
75
- type: textarea
86
id: what-happened
@@ -35,14 +33,14 @@ body:
3533
3634
Bug reports that follow these guidelines are easier to diagnose, and so are often handled much more quickly.
3735
This will be automatically formatted into code, so no need for markdown backticks.
38-
render: python
36+
render: Python
3937

4038
- type: textarea
4139
id: log-output
4240
attributes:
4341
label: Relevant log output
4442
description: Please copy and paste any relevant output. This will be automatically formatted into code, so no need for markdown backticks.
45-
render: python
43+
render: Python
4644

4745
- type: textarea
4846
id: extra
@@ -54,8 +52,8 @@ body:
5452
- type: textarea
5553
id: show-versions
5654
attributes:
57-
label: Environment
58-
description: |
59-
Paste the output of `xr.show_versions()` here
55+
label: Environment
56+
description: |
57+
Paste the output of `xr.show_versions()` here
6058
validations:
6159
required: true

.github/ISSUE_TEMPLATE/misc.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Issue
2+
description: General Issue or discussion topic. For usage questions, please follow the "Usage question" link
3+
labels: ["needs triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Please describe your issue here.
9+
- type: textarea
10+
id: issue-description
11+
attributes:
12+
label: What is your issue?
13+
description: |
14+
Thank you for filing an issue! Please give us further information on how we can help you.
15+
placeholder: Please describe your issue.
16+
validations:
17+
required: true

.github/ISSUE_TEMPLATE/newfeature.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Feature Request
22
description: Suggest an idea for xarray
3-
title: '[FEATURE]: '
43
labels: [enhancement]
5-
assignees: []
64
body:
75
- type: textarea
86
id: description

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
# We need the full repo to avoid this issue
1818
# https://github.com/actions/checkout/issues/23
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
2020
with:
2121
fetch-depth: 0
2222

.github/workflows/cancel-duplicate-runs.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/ci-additional.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
- "*"
99
workflow_dispatch: # allows you to trigger manually
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
1115
jobs:
1216
detect-ci-trigger:
1317
name: detect ci trigger
@@ -18,7 +22,7 @@ jobs:
1822
outputs:
1923
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
2024
steps:
21-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
2226
with:
2327
fetch-depth: 2
2428
- uses: xarray-contrib/[email protected]
@@ -49,7 +53,7 @@ jobs:
4953
"py39-flaky",
5054
]
5155
steps:
52-
- uses: actions/checkout@v2
56+
- uses: actions/checkout@v3
5357
with:
5458
fetch-depth: 0 # Fetch all history for all branches and tags.
5559

@@ -115,13 +119,13 @@ jobs:
115119
doctest:
116120
name: Doctests
117121
runs-on: "ubuntu-latest"
118-
if: github.repository == 'pydata/xarray'
122+
if: needs.detect-ci-trigger.outputs.triggered == 'false'
119123
defaults:
120124
run:
121125
shell: bash -l {0}
122126

123127
steps:
124-
- uses: actions/checkout@v2
128+
- uses: actions/checkout@v3
125129
with:
126130
fetch-depth: 0 # Fetch all history for all branches and tags.
127131
- uses: conda-incubator/setup-miniconda@v2
@@ -158,7 +162,7 @@ jobs:
158162
shell: bash -l {0}
159163

160164
steps:
161-
- uses: actions/checkout@v2
165+
- uses: actions/checkout@v3
162166
with:
163167
fetch-depth: 0 # Fetch all history for all branches and tags.
164168
- uses: conda-incubator/setup-miniconda@v2

.github/workflows/ci.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
- "*"
99
workflow_dispatch: # allows you to trigger manually
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
1115
jobs:
1216
detect-ci-trigger:
1317
name: detect ci trigger
@@ -18,7 +22,7 @@ jobs:
1822
outputs:
1923
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
2024
steps:
21-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
2226
with:
2327
fetch-depth: 2
2428
- uses: xarray-contrib/[email protected]
@@ -38,9 +42,9 @@ jobs:
3842
matrix:
3943
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
4044
# Bookend python versions
41-
python-version: ["3.8", "3.9"]
45+
python-version: ["3.8", "3.9", "3.10"]
4246
steps:
43-
- uses: actions/checkout@v2
47+
- uses: actions/checkout@v3
4448
with:
4549
fetch-depth: 0 # Fetch all history for all branches and tags.
4650
- name: Set environment variables
@@ -111,6 +115,7 @@ jobs:
111115
event_file:
112116
name: "Event File"
113117
runs-on: ubuntu-latest
118+
if: github.repository == 'pydata/xarray'
114119
steps:
115120
- name: Upload
116121
uses: actions/upload-artifact@v2

.github/workflows/publish-test-results.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
types:
99
- completed
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
1115
jobs:
1216
publish-test-results:
1317
name: Publish test results

.github/workflows/pypi-release.yaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313
if: github.repository == 'pydata/xarray'
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
with:
1717
fetch-depth: 0
18-
- uses: actions/setup-python@v2
18+
- uses: actions/setup-python@v3
1919
name: Install Python
2020
with:
2121
python-version: 3.8
@@ -50,7 +50,7 @@ jobs:
5050
needs: build-artifacts
5151
runs-on: ubuntu-latest
5252
steps:
53-
- uses: actions/setup-python@v2
53+
- uses: actions/setup-python@v3
5454
name: Install Python
5555
with:
5656
python-version: 3.8
@@ -62,6 +62,14 @@ jobs:
6262
run: |
6363
ls -ltrh
6464
ls -ltrh dist
65+
66+
- name: Verify the built dist/wheel is valid
67+
if: github.event_name == 'push'
68+
run: |
69+
python -m pip install --upgrade pip
70+
python -m pip install dist/xarray*.whl
71+
python -m xarray.util.print_versions
72+
6573
- name: Publish package to TestPyPI
6674
if: github.event_name == 'push'
6775
uses: pypa/[email protected]
@@ -71,13 +79,6 @@ jobs:
7179
repository_url: https://test.pypi.org/legacy/
7280
verbose: true
7381

74-
- name: Check uploaded package
75-
if: github.event_name == 'push'
76-
run: |
77-
sleep 3
78-
python -m pip install --upgrade pip
79-
python -m pip install --extra-index-url https://test.pypi.org/simple --upgrade xarray
80-
python -m xarray.util.print_versions
8182

8283
upload-to-pypi:
8384
needs: test-built-dist

.github/workflows/upstream-dev-ci.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
- cron: "0 0 * * *" # Daily “At 00:00” UTC
1111
workflow_dispatch: # allows you to trigger the workflow run manually
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
detect-ci-trigger:
1519
name: detect upstream-dev ci trigger
@@ -20,7 +24,7 @@ jobs:
2024
outputs:
2125
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
2226
steps:
23-
- uses: actions/checkout@v2
27+
- uses: actions/checkout@v3
2428
with:
2529
fetch-depth: 2
2630
- uses: xarray-contrib/[email protected]
@@ -44,11 +48,11 @@ jobs:
4448
strategy:
4549
fail-fast: false
4650
matrix:
47-
python-version: ["3.9"]
51+
python-version: ["3.10"]
4852
outputs:
4953
artifacts_availability: ${{ steps.status.outputs.ARTIFACTS_AVAILABLE }}
5054
steps:
51-
- uses: actions/checkout@v2
55+
- uses: actions/checkout@v3
5256
with:
5357
fetch-depth: 0 # Fetch all history for all branches and tags.
5458
- uses: conda-incubator/setup-miniconda@v2
@@ -106,8 +110,8 @@ jobs:
106110
run:
107111
shell: bash
108112
steps:
109-
- uses: actions/checkout@v2
110-
- uses: actions/setup-python@v2
113+
- uses: actions/checkout@v3
114+
- uses: actions/setup-python@v3
111115
with:
112116
python-version: "3.x"
113117
- uses: actions/download-artifact@v2
@@ -122,7 +126,7 @@ jobs:
122126
shopt -s globstar
123127
python .github/workflows/parse_logs.py logs/**/*-log
124128
- name: Report failures
125-
uses: actions/github-script@v5
129+
uses: actions/github-script@v6
126130
with:
127131
github-token: ${{ secrets.GITHUB_TOKEN }}
128132
script: |

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ __pycache__
55
.hypothesis/
66

77
# temp files from docs build
8+
doc/*.nc
89
doc/auto_gallery
9-
doc/example.nc
10+
doc/rasm.zarr
1011
doc/savefig
1112

1213
# C extensions
@@ -72,4 +73,3 @@ xarray/tests/data/*.grib.*.idx
7273
Icon*
7374

7475
.ipynb_checkpoints
75-
doc/rasm.zarr

.pre-commit-config.yaml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,27 @@ repos:
66
- id: trailing-whitespace
77
- id: end-of-file-fixer
88
- id: check-yaml
9-
# isort should run before black as black sometimes tweaks the isort output
9+
- id: debug-statements
10+
- id: mixed-line-ending
11+
# This wants to go before isort & flake8
12+
- repo: https://github.com/myint/autoflake
13+
rev: "v1.4"
14+
hooks:
15+
- id: autoflake # isort should run before black as black sometimes tweaks the isort output
16+
args: ["--in-place", "--ignore-init-module-imports"]
1017
- repo: https://github.com/PyCQA/isort
1118
rev: 5.10.1
1219
hooks:
1320
- id: isort
21+
- repo: https://github.com/asottile/pyupgrade
22+
rev: v2.31.0
23+
hooks:
24+
- id: pyupgrade
25+
args:
26+
- "--py38-plus"
1427
# https://github.com/python/black#version-control-integration
1528
- repo: https://github.com/psf/black
16-
rev: 21.12b0
29+
rev: 22.1.0
1730
hooks:
1831
- id: black
1932
- id: black-jupyter
@@ -35,23 +48,17 @@ repos:
3548
rev: v0.931
3649
hooks:
3750
- id: mypy
38-
# `properies` & `asv_bench` are copied from setup.cfg.
39-
# `_typed_ops.py` is added since otherwise mypy will complain (but notably only in pre-commit)
40-
exclude: "properties|asv_bench|_typed_ops.py"
51+
# Copied from setup.cfg
52+
exclude: "properties|asv_bench"
53+
# This is slow and so we take it out of the fast-path; requires passing
54+
# `--hook-stage manual` to pre-commit
55+
stages: [manual]
4156
additional_dependencies: [
4257
# Type stubs
4358
types-python-dateutil,
4459
types-pkg_resources,
4560
types-PyYAML,
4661
types-pytz,
4762
typing-extensions==3.10.0.0,
63+
numpy,
4864
]
49-
# run this occasionally, ref discussion https://github.com/pydata/xarray/pull/3194
50-
# - repo: https://github.com/asottile/pyupgrade
51-
# rev: v1.22.1
52-
# hooks:
53-
# - id: pyupgrade
54-
# args:
55-
# - "--py3-only"
56-
# # remove on f-strings in Py3.7
57-
# - "--keep-percent-format"

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Xarray's contributor guidelines [can be found in our online documentation](http://xarray.pydata.org/en/stable/contributing.html)
1+
Xarray's contributor guidelines [can be found in our online documentation](http://docs.xarray.dev/en/stable/contributing.html)

0 commit comments

Comments
 (0)