Skip to content

Commit

Permalink
Merge pull request #6 from pydata/master
Browse files Browse the repository at this point in the history
Merge upstream changes
  • Loading branch information
phausamann authored May 21, 2019
2 parents 788121c + 6658108 commit 82d86c5
Show file tree
Hide file tree
Showing 97 changed files with 1,804 additions and 933 deletions.
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

0 comments on commit 82d86c5

Please sign in to comment.