Skip to content
forked from pydata/xarray

Commit

Permalink
Merge branch 'main' into groupby-aggs-using-numpy-groupies
Browse files Browse the repository at this point in the history
* main: (26 commits)
  Remove xarray.ufuncs (pydata#6491)
  Convert readme to markdown (pydata#6495)
  HTML repr fix for Furo Sphinx theme (pydata#6501)
  Restrict stalebot on projects & milestones (pydata#6498)
  Ensure datetime-like variables are left unmodified by `decode_cf_variable` (pydata#6489)
  Add link to xarray binder to readme (pydata#6494)
  Add details section to issue template (pydata#6486)
  [skip-ci] Redirect raster analysis questions to rioxarray (pydata#6455)
  Accessing the Exception message via e.args[0] (pydata#6451)
  Add support in the "zarr" backend for reading NCZarr data (pydata#6420)
  Propagate MultiIndex variables in broadcast (pydata#6477)
  Fix whatnsew build error (pydata#6480)
  allow other and drop arguments in where (gh#6466) (pydata#6467)
  [pre-commit.ci] pre-commit autoupdate (pydata#6472)
  Fix `xr.where(..., keep_attrs=True)` bug (pydata#6461)
  Fix `Number` import (pydata#6474)
  Support **kwargs form in `.chunk()` (pydata#6471)
  Bump actions/upload-artifact from 2 to 3 (pydata#6468)
  Bump codecov/codecov-action from 2.1.0 to 3.0.0 (pydata#6470)
  Bump actions/download-artifact from 2 to 3 (pydata#6469)
  ...
  • Loading branch information
dcherian committed Apr 24, 2022
2 parents d613779 + 33cdabd commit 5627277
Show file tree
Hide file tree
Showing 43 changed files with 714 additions and 698 deletions.
8 changes: 7 additions & 1 deletion .github/ISSUE_TEMPLATE/bugreport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,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
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ contact_links:
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.
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
$PYTEST_EXTRA_FLAGS
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v2.1.0
uses: codecov/codecov-action@v3.0.0
with:
file: ./coverage.xml
flags: unittests,${{ matrix.env }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ jobs:

- 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.0.0
with:
file: ./coverage.xml
flags: unittests
Expand All @@ -118,7 +118,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 }}
6 changes: 3 additions & 3 deletions .github/workflows/pypi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
else
echo "✅ Looks good"
fi
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: releases
path: dist
Expand All @@ -54,7 +54,7 @@ jobs:
name: Install Python
with:
python-version: 3.8
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: releases
path: dist
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: releases
path: dist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
&& steps.status.outcome == 'failure'
&& github.event_name == 'schedule'
&& github.repository == 'pydata/xarray'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: output-${{ matrix.python-version }}-log
path: output-${{ matrix.python-version }}-log
Expand All @@ -114,7 +114,7 @@ jobs:
- uses: actions/setup-python@v3
with:
python-version: "3.x"
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
path: /tmp/workspace/logs
- name: Move all log files into a single directory
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# https://pre-commit.com/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -19,7 +19,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
rev: v2.32.0
hooks:
- id: pyupgrade
args:
Expand Down
130 changes: 130 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# xarray: N-D labeled arrays and datasets

[![image](https://github.com/pydata/xarray/workflows/CI/badge.svg?branch=main)](https://github.com/pydata/xarray/actions?query=workflow%3ACI)
[![image](https://codecov.io/gh/pydata/xarray/branch/main/graph/badge.svg)](https://codecov.io/gh/pydata/xarray)
[![image](https://readthedocs.org/projects/xray/badge/?version=latest)](https://docs.xarray.dev/)
[![image](https://img.shields.io/badge/benchmarked%20by-asv-green.svg?style=flat)](https://pandas.pydata.org/speed/xarray/)
[![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)
[![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
package that makes working with labelled multi-dimensional arrays
simple, efficient, and fun!

Xarray introduces labels in the form of dimensions, coordinates and
attributes on top of raw [NumPy](https://www.numpy.org)-like arrays,
which allows for a more intuitive, more concise, and less error-prone
developer experience. The package includes a large and growing library
of domain-agnostic functions for advanced analytics and visualization
with these data structures.

Xarray was inspired by and borrows heavily from
[pandas](https://pandas.pydata.org), the popular data analysis package
focused on labelled tabular data. It is particularly tailored to working
with [netCDF](https://www.unidata.ucar.edu/software/netcdf) files, which
were the source of xarray\'s data model, and integrates tightly with
[dask](https://dask.org) for parallel computing.

## Why xarray?

Multi-dimensional (a.k.a. N-dimensional, ND) arrays (sometimes called
"tensors") are an essential part of computational science. They are
encountered in a wide range of fields, including physics, astronomy,
geoscience, bioinformatics, engineering, finance, and deep learning. In
Python, [NumPy](https://www.numpy.org) provides the fundamental data
structure and API for working with raw ND arrays. However, real-world
datasets are usually more than just raw numbers; they have labels which
encode information about how the array values map to locations in space,
time, etc.

Xarray doesn\'t just keep track of labels on arrays \-- it uses them to
provide a powerful and concise interface. For example:

- Apply operations over dimensions by name: `x.sum('time')`.
- Select values by label instead of integer location:
`x.loc['2014-01-01']` or `x.sel(time='2014-01-01')`.
- Mathematical operations (e.g., `x - y`) vectorize across multiple
dimensions (array broadcasting) based on dimension names, not shape.
- Flexible split-apply-combine operations with groupby:
`x.groupby('time.dayofyear').mean()`.
- Database like alignment based on coordinate labels that smoothly
handles missing values: `x, y = xr.align(x, y, join='outer')`.
- Keep track of arbitrary metadata in the form of a Python dictionary:
`x.attrs`.

## Documentation

Learn more about xarray in its official documentation at
<https://docs.xarray.dev/>.

Try out an [interactive Jupyter
notebook](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/weather-data.ipynb).

## Contributing

You can find information about contributing to xarray at our
[Contributing
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).
- 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
projects of interest to xarray users, use the [mailing
list](https://groups.google.com/forum/#!forum/xarray).

## NumFOCUS

[![image](https://numfocus.org/wp-content/uploads/2017/07/NumFocus_LRG.png)](https://numfocus.org/)

Xarray is a fiscally sponsored project of
[NumFOCUS](https://numfocus.org), a nonprofit dedicated to supporting
the open source scientific computing community. If you like Xarray and
want to support our mission, please consider making a
[donation](https://numfocus.salsalabs.org/donate-to-xarray/) to support
our efforts.

## History

Xarray is an evolution of an internal tool developed at [The Climate
Corporation](http://climate.com/). It was originally written by Climate
Corp researchers Stephan Hoyer, Alex Kleeman and Eugene Brevdo and was
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.

## License

Copyright 2014-2019, xarray Developers

Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You may
obtain a copy of the License at

<https://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Xarray bundles portions of pandas, NumPy and Seaborn, all of which are
available under a "3-clause BSD" license:

- pandas: setup.py, xarray/util/print_versions.py
- NumPy: xarray/core/npcompat.py
- Seaborn: _determine_cmap_params in xarray/core/plot/utils.py

Xarray also bundles portions of CPython, which is available under the
"Python Software Foundation License" in xarray/core/pycompat.py.

Xarray uses icons from the icomoon package (free version), which is
available under the "CC BY 4.0" license.

The full text of these licenses are included in the licenses directory.
Loading

0 comments on commit 5627277

Please sign in to comment.