Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into groupby-aggs-using-…
Browse files Browse the repository at this point in the history
…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)
  • Loading branch information
dcherian committed May 2, 2022
2 parents 5583e34 + cf8f1d6 commit 5337bd4
Show file tree
Hide file tree
Showing 22 changed files with 212 additions and 144 deletions.
20 changes: 15 additions & 5 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 Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
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
- 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
Expand Down
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
86 changes: 23 additions & 63 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,96 +30,50 @@ 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@v3
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/[email protected]
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"
if: needs.detect-ci-trigger.outputs.triggered == 'false'
needs: detect-ci-trigger
# temporarily skipping due to https://github.com/pydata/xarray/issues/6551
# if: needs.detect-ci-trigger.outputs.triggered == 'false'
if: false
defaults:
run:
shell: bash -l {0}
Expand Down Expand Up @@ -148,9 +102,15 @@ 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
# Temporarily overriding to be true due to https://github.com/pydata/xarray/issues/6551
# python -m mypy --install-types --non-interactive
- name: Run mypy
run: |
python -m mypy --install-types --non-interactive || true
min-version-policy:
name: Minimum Version Policy
Expand All @@ -176,5 +136,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
45 changes: 40 additions & 5 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 @@ -43,6 +43,22 @@ jobs:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
# Bookend python versions
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@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,14 +119,17 @@ 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()
Expand All @@ -104,7 +139,7 @@ jobs:
path: pytest.xml

- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3.0.0
uses: codecov/codecov-action@v3.1.0
with:
file: ./coverage.xml
flags: unittests
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ repos:
hooks:
- id: blackdoc
exclude: "generate_reductions.py"
additional_dependencies: ["black==22.3.0"]
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
Expand All @@ -45,7 +46,7 @@ repos:
# - id: velin
# args: ["--write", "--compact"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
rev: v0.950
hooks:
- id: mypy
# Copied from setup.cfg
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[![image](https://img.shields.io/pypi/v/xarray.svg)](https://pypi.python.org/pypi/xarray/)
[![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
[![image](https://zenodo.org/badge/DOI/10.5281/zenodo.598201.svg)](https://doi.org/10.5281/zenodo.598201)
[![badge](https://img.shields.io/badge/launch-binder-579ACA.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7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qQxpP3/Tj//c3yB0tqzaml05/+orHLksVO+95kX7/7qgJvnjlrfr2Ggsyx0eoy9uPzN5SPd86aXggOsEKW2Prz7du3VID3/tzs/sSRs2w7ovVHKtjrX2pd7ZMlTxAYfBAL9jiDwfLkq55Tm7ifhMlTGPyCAs7RFRhn47JnlcB9RM5T97ASuZXIcVNuUDIndpDbdsfrqsOppeXl5Y+XVKdjFCTh+zGaVuj0d9zy05PPK3QzBamxdwtTCrzyg/2Rvf2EstUjordGwa/kx9mSJLr8mLLtCW8HHGJc2R5hS219IiF6PnTusOqcMl57gm0Z8kanKMAQg0qSyuZfn7zItsbGyO9QlnxY0eCuD1XL2ys/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)
[![image](https://img.shields.io/twitter/follow/xarray_dev?style=social)](https://twitter.com/xarray_dev)

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

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

## NumFOCUS

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

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

## Contributors

Thanks to our many contributors!

[![Contributors](https://contrib.rocks/image?repo=pydata/xarray)](https://github.com/pydata/xarray/graphs/contributors)

## License

Copyright 2014-2019, xarray Developers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python=3.9
- python=3.10
- black
- aiobotocore
- boto3
Expand All @@ -18,7 +18,7 @@ dependencies:
- h5py
- hdf5
- hypothesis
- lxml # Optional dep of pydap
- lxml # Optional dep of pydap
- matplotlib-base
- nc-time-axis
- netcdf4
Expand All @@ -43,4 +43,4 @@ dependencies:
- typing_extensions
- zarr
- pip:
- numbagg
- numbagg
File renamed without changes.
1 change: 0 additions & 1 deletion ci/requirements/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ dependencies:
- pytest
- pytest-cov
- pytest-env
- pytest-github-actions-annotate-failures
- pytest-xdist
- rasterio
- scipy
Expand Down
File renamed without changes.
Loading

0 comments on commit 5337bd4

Please sign in to comment.