Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream changes #6

Merged
merged 35 commits into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
16a2c03
Allow expand_dims() method to support inserting/broadcasting dimensio…
pletchm Mar 26, 2019
7d0e895
Fixing deepcopy for Dataset.attrs (#2839)
kefirbandi Mar 30, 2019
aaae999
Fix minor typo in docstring (#2860)
lumbric Apr 1, 2019
31619d7
Various fixes for explicit Dataset.indexes (#2858)
shoyer Apr 4, 2019
aa6abb5
0.12.1 release
shoyer Apr 5, 2019
23d54a8
revert to 0.12.2 dev
shoyer Apr 5, 2019
e7ec087
update links to https (#2872)
lpmi-13 Apr 7, 2019
3435b03
Fix mypy typing error in cftime_offsets.py (#2878)
shoyer Apr 8, 2019
2c10d14
decreased pytest verbosity (#2881)
rabernat Apr 9, 2019
3fb22cb
WIP: type annotations (#2877)
crusaderky Apr 10, 2019
b9a920e
Reduce length of cftime resample tests (#2879)
spencerkclark Apr 11, 2019
a4305e7
BUG: Fix #2864 by adding the missing vrt parameters (#2865)
jmichel-otb Apr 11, 2019
3354059
Indexing with an empty array (#2883)
mdavezac Apr 12, 2019
fad6d62
Return correct count for scalar datetime64 arrays (#2892)
dnowacki-usgs Apr 14, 2019
64d2720
Bugfix for docs build instructions (#2897)
Apr 16, 2019
08942c2
Added docs example for `xarray.Dataset.get()` (#2894)
Apr 16, 2019
1cd262d
Fix minor typos in docstrings (#2903)
lumbric Apr 17, 2019
aebe60c
Minor improvement of docstring for Dataset (#2904)
lumbric Apr 17, 2019
baf81b4
Manually specify chunks in open_zarr (#2530)
lilyminium Apr 18, 2019
f8ae987
docs: Move quick overview one level up (#2890)
dcherian Apr 19, 2019
c8251e3
Partial fix for #2841 to improve formatting. (#2906)
dnowacki-usgs Apr 19, 2019
6d93a95
Handle the character array dim name (#2896)
jmccreight Apr 19, 2019
2633b1e
DOC: Avoid downloading .tif file (#2919)
grinsted May 3, 2019
dd99b7d
List formatting in docs (#2939)
max-sixty May 3, 2019
ccd0b04
Attempt to fix py35 build on Travis (#2925)
shoyer May 4, 2019
5aaa654
[WIP] Custom fill value for reindex, align, and merge operations (#2920)
zdgriffith May 5, 2019
c04234d
BUGFIX: deep-copy wasn't copying coords, bug fixed within IndexVariab…
pletchm May 8, 2019
24d49fc
Base classes in Python 3 don't need to subclass object (#2950)
crusaderky May 9, 2019
ab39722
plot: If provided with colormap do not modify it. (#2935)
dcherian May 9, 2019
698293e
Mark test for copying coords of dataarray and dataset with xfail. It …
pletchm May 9, 2019
1e35327
DOC: Added xclim to related projects (#2957)
Zeitsperre May 13, 2019
7dfca70
Less verbose tests on Windows (#2952)
shoyer May 13, 2019
4e778f0
fix documentation to avoid failures when updating to numpydoc>=0.9 (#…
MaxBo May 14, 2019
bd78b7f
Implement load_dataset() and load_dataarray() (#2917)
dnowacki-usgs May 16, 2019
6658108
Fix rolling.constuct() example (#2967)
kmsquire May 16, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ matrix:
fast_finish: true
include:
- env: CONDA_ENV=py35-min
- env: CONDA_ENV=py35
- env: CONDA_ENV=py36
- env: CONDA_ENV=py37
- env:
Expand Down Expand Up @@ -65,7 +64,7 @@ script:
elif [[ "$CONDA_ENV" == "py36-hypothesis" ]]; then
pytest properties ;
else
py.test xarray --cov=xarray --cov-config ci/.coveragerc --cov-report term-missing --verbose $EXTRA_FLAGS;
py.test xarray --cov=xarray --cov-config ci/.coveragerc --cov-report term-missing $EXTRA_FLAGS;
fi

after_success:
Expand Down
24 changes: 12 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ xarray: N-D labeled arrays and datasets
.. image:: https://coveralls.io/repos/pydata/xarray/badge.svg
:target: https://coveralls.io/r/pydata/xarray
.. image:: https://readthedocs.org/projects/xray/badge/?version=latest
:target: http://xarray.pydata.org/
.. image:: http://img.shields.io/badge/benchmarked%20by-asv-green.svg?style=flat
:target: http://pandas.pydata.org/speed/xarray/
:target: https://xarray.pydata.org/
.. image:: https://img.shields.io/badge/benchmarked%20by-asv-green.svg?style=flat
:target: https://pandas.pydata.org/speed/xarray/
.. image:: https://img.shields.io/pypi/v/xarray.svg
:target: https://pypi.python.org/pypi/xarray/

Expand All @@ -30,10 +30,10 @@ 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
.. _pandas: http://pandas.pydata.org
.. _dask: http://dask.org
.. _netCDF: http://www.unidata.ucar.edu/software/netcdf
.. _NumPy: https://www.numpy.org
.. _pandas: https://pandas.pydata.org
.. _dask: https://dask.org
.. _netCDF: https://www.unidata.ucar.edu/software/netcdf

Why xarray?
-----------
Expand Down Expand Up @@ -66,12 +66,12 @@ powerful and concise interface. For example:
Documentation
-------------

Learn more about xarray in its official documentation at http://xarray.pydata.org/
Learn more about xarray in its official documentation at https://xarray.pydata.org/

Contributing
------------

You can find information about contributing to xarray at our `Contributing page <http://xarray.pydata.org/en/latest/contributing.html#>`_.
You can find information about contributing to xarray at our `Contributing page <https://xarray.pydata.org/en/latest/contributing.html#>`_.

Get in touch
------------
Expand All @@ -81,9 +81,9 @@ Get in touch
- For less well defined questions or ideas, or to announce other projects of
interest to xarray users, use the `mailing list`_.

.. _StackOverFlow: http://stackoverflow.com/questions/tagged/python-xarray
.. _StackOverFlow: https://stackoverflow.com/questions/tagged/python-xarray
.. _mailing list: https://groups.google.com/forum/#!forum/xarray
.. _on GitHub: http://github.com/pydata/xarray
.. _on GitHub: https://github.com/pydata/xarray

NumFOCUS
--------
Expand Down Expand Up @@ -120,7 +120,7 @@ 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

http://www.apache.org/licenses/LICENSE-2.0
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,
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ install:
build: false

test_script:
- "py.test xarray --verbose"
- "py.test xarray"
8 changes: 4 additions & 4 deletions asv_bench/benchmarks/dataset_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
os.environ['HDF5_USE_FILE_LOCKING'] = 'FALSE'


class IOSingleNetCDF(object):
class IOSingleNetCDF:
"""
A few examples that benchmark reading/writing a single netCDF file with
xarray
Expand Down Expand Up @@ -214,7 +214,7 @@ def time_load_dataset_scipy_with_time_chunks(self):
chunks=self.time_chunks).load()


class IOMultipleNetCDF(object):
class IOMultipleNetCDF:
"""
A few examples that benchmark reading/writing multiple netCDF files with
xarray
Expand Down Expand Up @@ -419,7 +419,7 @@ def create_delayed_write():
return ds.to_netcdf('file.nc', engine='netcdf4', compute=False)


class IOWriteNetCDFDask(object):
class IOWriteNetCDFDask:
timeout = 60
repeat = 1
number = 5
Expand All @@ -432,7 +432,7 @@ def time_write(self):
self.write.compute()


class IOWriteNetCDFDaskDistributed(object):
class IOWriteNetCDFDaskDistributed:
def setup(self):
try:
import distributed
Expand Down
2 changes: 1 addition & 1 deletion asv_bench/benchmarks/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}


class Base(object):
class Base:
def setup(self, key):
self.ds = xr.Dataset(
{'var1': (('x', 'y'), randn((nx, ny), frac_nan=0.1)),
Expand Down
2 changes: 1 addition & 1 deletion asv_bench/benchmarks/interp.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
new_y_long = np.linspace(0.1, 0.9, 1000)


class Interpolation(object):
class Interpolation:
def setup(self, *args, **kwargs):
self.ds = xr.Dataset(
{'var1': (('x', 'y'), randn_xy),
Expand Down
2 changes: 1 addition & 1 deletion asv_bench/benchmarks/reindexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from . import requires_dask


class Reindex(object):
class Reindex:
def setup(self):
data = np.random.RandomState(0).randn(1000, 100, 100)
self.ds = xr.Dataset({'temperature': (('time', 'x', 'y'), data)},
Expand Down
2 changes: 1 addition & 1 deletion asv_bench/benchmarks/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
randn_long = randn((long_nx, ), frac_nan=0.1)


class Rolling(object):
class Rolling:
def setup(self, *args, **kwargs):
self.ds = xr.Dataset(
{'var1': (('x', 'y'), randn_xy),
Expand Down
2 changes: 1 addition & 1 deletion asv_bench/benchmarks/unstacking.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from . import requires_dask


class Unstacking(object):
class Unstacking:
def setup(self):
data = np.random.RandomState(0).randn(1, 1000, 500)
self.ds = xr.DataArray(data).stack(flat_dim=['dim_1', 'dim_2'])
Expand Down
23 changes: 0 additions & 23 deletions ci/requirements-py35.yml

This file was deleted.

4 changes: 2 additions & 2 deletions ci/requirements-py36-dask-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ dependencies:
- pytest-env
- coveralls
- flake8
- numpy
- pandas
- numpy>=1.12
- pandas>=0.19
- scipy
- seaborn
- toolz
Expand Down
4 changes: 2 additions & 2 deletions ci/requirements-py36-hypothesis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ dependencies:
- coveralls
- hypothesis
- flake8
- numpy
- pandas
- numpy>=1.12
- pandas>=0.19
- scipy
- seaborn
- toolz
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements-py36-pandas-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
- pytest-env
- coveralls
- flake8
- numpy
- numpy>=1.12
- scipy
- toolz
- pip:
Expand Down
4 changes: 2 additions & 2 deletions ci/requirements-py36-rasterio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ dependencies:
- pytest-cov
- pytest-env
- coveralls
- numpy
- pandas
- numpy>=1.12
- pandas>=0.19
- scipy
- seaborn
- toolz
Expand Down
5 changes: 2 additions & 3 deletions ci/requirements-py36-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ dependencies:
- netcdf4
- pytest
- pytest-env
- numpy
- pandas
- numpy>=1.12
- pandas>=0.19
- scipy
- seaborn
- toolz
- rasterio
- zarr

4 changes: 2 additions & 2 deletions ci/requirements-py36-zarr-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ dependencies:
- pytest-env
- coveralls
- flake8
- numpy
- pandas
- numpy>=1.12
- pandas>=0.19
- scipy
- seaborn
- toolz
Expand Down
4 changes: 2 additions & 2 deletions ci/requirements-py36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ dependencies:
- pytest-env
- coveralls
- pycodestyle
- numpy
- pandas
- numpy>=1.12
- pandas>=0.19
- scipy
- seaborn
- toolz
Expand Down
4 changes: 2 additions & 2 deletions ci/requirements-py37-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ dependencies:
- netcdf4
- pytest
- pytest-env
- numpy
- pandas
- numpy>=1.12
- pandas>=0.19
- scipy
- seaborn
- toolz
Expand Down
4 changes: 2 additions & 2 deletions ci/requirements-py37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ dependencies:
- pytest-env
- coveralls
- pycodestyle
- numpy
- pandas
- numpy>=1.12
- pandas>=0.19
- scipy
- seaborn
- toolz
Expand Down
2 changes: 2 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ Dataset methods
:toctree: generated/

open_dataset
load_dataset
open_mfdataset
open_rasterio
open_zarr
Expand Down Expand Up @@ -487,6 +488,7 @@ DataArray methods
:toctree: generated/

open_dataarray
load_dataarray
DataArray.to_dataset
DataArray.to_netcdf
DataArray.to_pandas
Expand Down
22 changes: 14 additions & 8 deletions doc/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,23 @@ How to build the *xarray* documentation

Requirements
~~~~~~~~~~~~
Make sure to follow the instructions on :ref:`creating a development environment above <contributing.dev_env>`, but
to build the docs you need to use the environment file ``doc/environment.yml``.

First, you need to have a development environment to be able to build xarray
(see the docs on :ref:`creating a development environment above <contributing.dev_env>`).
.. code-block:: none

Building the documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~
# Create and activate the docs environment
conda env create -f doc/environment.yml
conda activate xarray-docs

In your development environment, install ``sphinx``, ``sphinx_rtd_theme``,
``sphinx-gallery`` and ``numpydoc``::
# or with older versions of Anaconda:
source activate xarray-docs

conda install -c conda-forge sphinx sphinx_rtd_theme sphinx-gallery numpydoc
# Build and install xarray
pip install -e .

Building the documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~

Navigate to your local ``xarray/doc/`` directory in the console and run::

Expand Down Expand Up @@ -451,7 +457,7 @@ typically find tests wrapped in a class.

.. code-block:: python

class TestReallyCoolFeature(object):
class TestReallyCoolFeature:
....

Going forward, we are moving to a more *functional* style using the
Expand Down
7 changes: 4 additions & 3 deletions doc/data-structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ example, to create this example dataset from scratch, we could have written:

ds = xr.Dataset()
ds['temperature'] = (('x', 'y', 'time'), temp)
ds['temperature_double'] = (('x', 'y', 'time'), temp * 2 )
ds['precipitation'] = (('x', 'y', 'time'), precip)
ds.coords['lat'] = (('x', 'y'), lat)
ds.coords['lon'] = (('x', 'y'), lon)
Expand Down Expand Up @@ -397,9 +398,9 @@ operations keep around coordinates:

.. ipython:: python

list(ds[['temperature']])
list(ds[['x']])
list(ds.drop('temperature'))
ds[['temperature']]
ds[['temperature', 'temperature_double']]
ds.drop('temperature')

To remove a dimension, you can use :py:meth:`~xarray.Dataset.drop_dims` method.
Any variables using that dimension are dropped:
Expand Down
1 change: 0 additions & 1 deletion doc/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Examples
.. toctree::
:maxdepth: 2

examples/quick-overview
examples/weather-data
examples/monthly-means
examples/multidimensional-coords
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/_code/accessor_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


@xr.register_dataset_accessor('geo')
class GeoAccessor(object):
class GeoAccessor:
def __init__(self, xarray_obj):
self._obj = xarray_obj
self._center = None
Expand Down
Loading