Skip to content
forked from pydata/xarray

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into refactor-plot-utils
Browse files Browse the repository at this point in the history
* upstream/master:
  xfail cftimeindex multiindex test (pydata#2669)
  DOC: refresh "Why xarray" and shorten top-level description (pydata#2657)
  Remove broken Travis-CI builds (pydata#2661)
  Type checking with mypy (pydata#2655)
  Added Coarsen (pydata#2612)
  • Loading branch information
dcherian committed Jan 14, 2019
2 parents 159bb25 + 44a8c97 commit 29d276a
Show file tree
Hide file tree
Showing 53 changed files with 838 additions and 404 deletions.
19 changes: 1 addition & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,9 @@ matrix:
- env:
- CONDA_ENV=py36
- EXTRA_FLAGS="--run-flaky --run-network-tests"
- env: CONDA_ENV=py36-netcdf4-dev
addons:
apt_packages:
- libhdf5-serial-dev
- netcdf-bin
- libnetcdf-dev
- env: CONDA_ENV=py36-dask-dev
- env: CONDA_ENV=py36-pandas-dev
- env: CONDA_ENV=py36-bottleneck-dev
- env: CONDA_ENV=py36-condaforge-rc
- env: CONDA_ENV=py36-pynio-dev
- env: CONDA_ENV=py36-rasterio
- env: CONDA_ENV=py36-zarr-dev
- env: CONDA_ENV=docs
Expand All @@ -38,25 +30,16 @@ matrix:
- env:
- CONDA_ENV=py36
- EXTRA_FLAGS="--run-flaky --run-network-tests"
- env: CONDA_ENV=py36-netcdf4-dev
addons:
apt_packages:
- libhdf5-serial-dev
- netcdf-bin
- libnetcdf-dev
- env: CONDA_ENV=py36-pandas-dev
- env: CONDA_ENV=py36-bottleneck-dev
- env: CONDA_ENV=py36-condaforge-rc
- env: CONDA_ENV=py36-pynio-dev
- env: CONDA_ENV=py36-zarr-dev

before_install:
- wget http://repo.continuum.io/miniconda/Miniconda3-3.16.0-Linux-x86_64.sh -O miniconda.sh;
- wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no --set show_channel_urls true
- conda update -q conda
- conda info -a

install:
Expand Down
84 changes: 25 additions & 59 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,47 @@ xarray: N-D labeled arrays and datasets
:target: https://coveralls.io/r/pydata/xarray
.. image:: https://readthedocs.org/projects/xray/badge/?version=latest
:target: http://xarray.pydata.org/
.. image:: https://img.shields.io/pypi/v/xarray.svg
:target: https://pypi.python.org/pypi/xarray/
.. image:: https://zenodo.org/badge/13221727.svg
:target: https://zenodo.org/badge/latestdoi/13221727
.. image:: http://img.shields.io/badge/benchmarked%20by-asv-green.svg?style=flat
:target: http://pandas.pydata.org/speed/xarray/
.. image:: https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A
:target: http://numfocus.org
.. image:: https://img.shields.io/pypi/v/xarray.svg
:target: https://pypi.python.org/pypi/xarray/

**xarray** (formerly **xray**) is an open source project and Python package
that makes working with labelled multi-dimensional arrays simple,
efficient, and fun!

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_ 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 introduces labels in the form of dimensions, coordinates and
attributes on top of raw NumPy_-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.

By introducing *dimensions*, *coordinates*, and *attributes* on top of raw
NumPy-like arrays, xarray is able to understand these labels and use them to
provide a more intuitive, more concise, and less error-prone experience.
Xarray also provides a large and growing library of functions for advanced
analytics and visualization with these data structures.
Xarray was inspired by and borrows heavily from pandas_, the popular data
analysis package focused on labelled tabular data.
Xarray can read and write data from most common labeled ND-array storage
formats and is particularly tailored to working with netCDF_ files, which were
the source of xarray's data model.
It is particularly tailored to working with netCDF_ files, which were the
source of xarray's data model, and integrates tightly with dask_ for parallel
computing.

.. _NumPy: http://www.numpy.org/
.. _NumPy: http://www.numpy.org
.. _pandas: http://pandas.pydata.org
.. _dask: http://dask.org
.. _netCDF: http://www.unidata.ucar.edu/software/netcdf

Why xarray?
-----------

Adding dimensions names and coordinate indexes to numpy's ndarray_ makes many
powerful array operations possible:
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_ 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:
Expand All @@ -65,42 +63,10 @@ powerful array operations possible:
- Keep track of arbitrary metadata in the form of a Python dictionary:
``x.attrs``.

pandas_ provides many of these features, but it does not make use of dimension
names, and its core data structures are fixed dimensional arrays.

Why isn't pandas enough?
------------------------

pandas_ excels at working with tabular data. That suffices for many statistical
analyses, but physical scientists rely on N-dimensional arrays -- which is
where xarray comes in.

xarray aims to provide a data analysis toolkit as powerful as pandas_ but
designed for working with homogeneous N-dimensional arrays
instead of tabular data. When possible, we copy the pandas API and rely on
pandas's highly optimized internals (in particular, for fast indexing).

Why netCDF?
-----------

Because xarray implements the same data model as the netCDF_ file format,
xarray datasets have a natural and portable serialization format. But it is also
easy to robustly convert an xarray ``DataArray`` to and from a numpy ``ndarray``
or a pandas ``DataFrame`` or ``Series``, providing compatibility with the full
`PyData ecosystem <http://pydata.org/>`__.

Our target audience is anyone who needs N-dimensional labeled arrays, but we
are particularly focused on the data analysis needs of physical scientists --
especially geoscientists who already know and love netCDF_.

.. _ndarray: http://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html
.. _pandas: http://pandas.pydata.org
.. _netCDF: http://www.unidata.ucar.edu/software/netcdf

Documentation
-------------

The official documentation is hosted on ReadTheDocs at http://xarray.pydata.org/
Learn more about xarray in its official documentation at http://xarray.pydata.org/

Contributing
------------
Expand Down
8 changes: 4 additions & 4 deletions ci/install_python.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# Authors: Olivier Grisel, Jonathan Helmus and Kyle Kastner
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/

$MINICONDA_URL = "http://repo.continuum.io/miniconda/"
$MINICONDA_URL = "https://repo.anaconda.com/miniconda/"
$BASE_URL = "https://www.python.org/ftp/python/"


function DownloadMiniconda ($python_version, $platform_suffix) {
$webclient = New-Object System.Net.WebClient
if ($python_version -match "3.6") {
$filename = "Miniconda3-latest-Windows-" + $platform_suffix + ".exe"
} else {
if ($python_version -match "2.7") {
$filename = "Miniconda2-latest-Windows-" + $platform_suffix + ".exe"
} else {
$filename = "Miniconda3-latest-Windows-" + $platform_suffix + ".exe"
}
$url = $MINICONDA_URL + $filename

Expand Down
2 changes: 1 addition & 1 deletion ci/requirements-py35.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies:
- matplotlib=1.5
- netcdf4
- pytest
- pytest-env
- pytest-cov
- pytest-env
- coveralls
- flake8
- numpy
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements-py36-bottleneck-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ dependencies:
- matplotlib
- netcdf4
- pytest
- pytest-env
- pytest-cov
- pytest-env
- coveralls
- flake8
- numpy
Expand Down
23 changes: 0 additions & 23 deletions ci/requirements-py36-condaforge-rc.yml

This file was deleted.

2 changes: 1 addition & 1 deletion ci/requirements-py36-dask-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ dependencies:
- matplotlib
- netcdf4
- pytest
- pytest-env
- pytest-cov
- pytest-env
- coveralls
- flake8
- numpy
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements-py36-hypothesis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies:
- matplotlib
- netcdf4
- pytest
- pytest-env
- pytest-cov
- pytest-env
- coveralls
- hypothesis
- flake8
Expand Down
23 changes: 0 additions & 23 deletions ci/requirements-py36-netcdf4-dev.yml

This file was deleted.

2 changes: 1 addition & 1 deletion ci/requirements-py36-pandas-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ dependencies:
- matplotlib
- netcdf4
- pytest
- pytest-env
- pytest-cov
- pytest-env
- coveralls
- flake8
- numpy
Expand Down
26 changes: 0 additions & 26 deletions ci/requirements-py36-pynio-dev.yml

This file was deleted.

2 changes: 1 addition & 1 deletion ci/requirements-py36-rasterio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ dependencies:
- matplotlib
- netcdf4
- pytest
- pytest-env
- pytest-cov
- pytest-env
- coveralls
- numpy
- pandas
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements-py36-zarr-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ dependencies:
- distributed
- matplotlib
- pytest
- pytest-env
- pytest-cov
- pytest-env
- coveralls
- flake8
- numpy
Expand Down
3 changes: 2 additions & 1 deletion ci/requirements-py36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
- pytest-cov
- pytest-env
- coveralls
- flake8
- pycodestyle
- numpy
- pandas
- scipy
Expand All @@ -32,3 +32,4 @@ dependencies:
- lxml
- pip:
- cfgrib>=0.9.2
- mypy==0.650
1 change: 1 addition & 0 deletions ci/requirements-py37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ dependencies:
- pydap
- pip:
- cfgrib>=0.9.2
- mypy==0.650
2 changes: 2 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ Computation
Dataset.groupby
Dataset.groupby_bins
Dataset.rolling
Dataset.coarsen
Dataset.resample
Dataset.diff
Dataset.quantile
Expand Down Expand Up @@ -312,6 +313,7 @@ Computation
DataArray.groupby
DataArray.groupby_bins
DataArray.rolling
DataArray.coarsen
DataArray.dt
DataArray.resample
DataArray.get_axis_num
Expand Down
Loading

0 comments on commit 29d276a

Please sign in to comment.