Skip to content

Commit 995bb4b

Browse files
authored
Merge pull request #2 from pydata/master
Sync with upstream master
2 parents d634f64 + 6d93a95 commit 995bb4b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+4182
-1573
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pip-log.txt
3535
.tox
3636
nosetests.xml
3737
.cache
38+
.mypy_cache
3839
.ropeproject/
3940
.tags*
4041
.testmon*

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ matrix:
1919
- EXTRA_FLAGS="--run-flaky --run-network-tests"
2020
- env: CONDA_ENV=py36-dask-dev
2121
- env: CONDA_ENV=py36-pandas-dev
22-
- env: CONDA_ENV=py36-bottleneck-dev
2322
- env: CONDA_ENV=py36-rasterio
2423
- env: CONDA_ENV=py36-zarr-dev
2524
- env: CONDA_ENV=docs
@@ -31,7 +30,6 @@ matrix:
3130
- CONDA_ENV=py36
3231
- EXTRA_FLAGS="--run-flaky --run-network-tests"
3332
- env: CONDA_ENV=py36-pandas-dev
34-
- env: CONDA_ENV=py36-bottleneck-dev
3533
- env: CONDA_ENV=py36-zarr-dev
3634

3735
before_install:
@@ -67,7 +65,7 @@ script:
6765
elif [[ "$CONDA_ENV" == "py36-hypothesis" ]]; then
6866
pytest properties ;
6967
else
70-
py.test xarray --cov=xarray --cov-config ci/.coveragerc --cov-report term-missing --verbose $EXTRA_FLAGS;
68+
py.test xarray --cov=xarray --cov-config ci/.coveragerc --cov-report term-missing $EXTRA_FLAGS;
7169
fi
7270

7371
after_success:

README.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ xarray: N-D labeled arrays and datasets
88
.. image:: https://coveralls.io/repos/pydata/xarray/badge.svg
99
:target: https://coveralls.io/r/pydata/xarray
1010
.. image:: https://readthedocs.org/projects/xray/badge/?version=latest
11-
:target: http://xarray.pydata.org/
12-
.. image:: http://img.shields.io/badge/benchmarked%20by-asv-green.svg?style=flat
13-
:target: http://pandas.pydata.org/speed/xarray/
11+
:target: https://xarray.pydata.org/
12+
.. image:: https://img.shields.io/badge/benchmarked%20by-asv-green.svg?style=flat
13+
:target: https://pandas.pydata.org/speed/xarray/
1414
.. image:: https://img.shields.io/pypi/v/xarray.svg
1515
:target: https://pypi.python.org/pypi/xarray/
1616

@@ -30,10 +30,10 @@ It is particularly tailored to working with netCDF_ files, which were the
3030
source of xarray's data model, and integrates tightly with dask_ for parallel
3131
computing.
3232

33-
.. _NumPy: http://www.numpy.org
34-
.. _pandas: http://pandas.pydata.org
35-
.. _dask: http://dask.org
36-
.. _netCDF: http://www.unidata.ucar.edu/software/netcdf
33+
.. _NumPy: https://www.numpy.org
34+
.. _pandas: https://pandas.pydata.org
35+
.. _dask: https://dask.org
36+
.. _netCDF: https://www.unidata.ucar.edu/software/netcdf
3737

3838
Why xarray?
3939
-----------
@@ -66,12 +66,12 @@ powerful and concise interface. For example:
6666
Documentation
6767
-------------
6868

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

7171
Contributing
7272
------------
7373

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

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

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

8888
NumFOCUS
8989
--------
@@ -97,7 +97,7 @@ to supporting the open source scientific computing community. If you like
9797
Xarray and want to support our mission, please consider making a donation_
9898
to support our efforts.
9999

100-
.. _donation: https://www.flipcause.com/secure/cause_pdetails/NDE2NTU=
100+
.. _donation: https://numfocus.salsalabs.org/donate-to-xarray/
101101

102102
History
103103
-------
@@ -120,7 +120,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
120120
you may not use this file except in compliance with the License.
121121
You may obtain a copy of the License at
122122

123-
http://www.apache.org/licenses/LICENSE-2.0
123+
https://www.apache.org/licenses/LICENSE-2.0
124124

125125
Unless required by applicable law or agreed to in writing, software
126126
distributed under the License is distributed on an "AS IS" BASIS,

ci/requirements-py35-min.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: test_env
22
dependencies:
3-
- python=3.5
3+
- python=3.5.0
44
- pytest
55
- flake8
66
- mock

ci/requirements-py36-bottleneck-dev.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

ci/requirements-py36.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ dependencies:
2020
- scipy
2121
- seaborn
2222
- toolz
23-
# - rasterio # xref #2683
23+
- rasterio
2424
- bottleneck
2525
- zarr
2626
- pseudonetcdf>=3.0.1
2727
- eccodes
2828
- cdms2
29-
# - pynio # xref #2683
30-
# - iris>=1.10 # xref #2683
29+
- pynio
30+
- iris>=1.10
3131
- pydap
3232
- lxml
3333
- pip:
3434
- cfgrib>=0.9.2
35-
- mypy==0.650
35+
- mypy==0.660

ci/requirements-py37-windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ channels:
44
dependencies:
55
- python=3.7
66
- cftime
7+
- nc-time-axis
78
- dask
89
- distributed
910
- h5py

ci/requirements-py37.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ channels:
44
dependencies:
55
- python=3.7
66
- cftime
7+
- nc-time-axis
78
- dask
89
- distributed
910
- h5py

doc/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Dataset contents
8787
Dataset.swap_dims
8888
Dataset.expand_dims
8989
Dataset.drop
90+
Dataset.drop_dims
9091
Dataset.set_coords
9192
Dataset.reset_coords
9293

doc/contributing.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -285,17 +285,23 @@ How to build the *xarray* documentation
285285

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

289-
First, you need to have a development environment to be able to build xarray
290-
(see the docs on :ref:`creating a development environment above <contributing.dev_env>`).
291+
.. code-block:: none
291292
292-
Building the documentation
293-
~~~~~~~~~~~~~~~~~~~~~~~~~~
293+
# Create and activate the docs environment
294+
conda env create -f doc/environment.yml
295+
conda activate xarray-docs
294296
295-
In your development environment, install ``sphinx``, ``sphinx_rtd_theme``,
296-
``sphinx-gallery`` and ``numpydoc``::
297+
# or with older versions of Anaconda:
298+
source activate xarray-docs
297299
298-
conda install -c conda-forge sphinx sphinx_rtd_theme sphinx-gallery numpydoc
300+
# Build and install xarray
301+
pip install -e .
302+
303+
Building the documentation
304+
~~~~~~~~~~~~~~~~~~~~~~~~~~
299305

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

doc/data-structures.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,6 @@ setting) variables and attributes:
353353
This is particularly useful in an exploratory context, because you can
354354
tab-complete these variable names with tools like IPython.
355355

356-
.. warning::
357-
358-
We are changing the behavior of iterating over a Dataset the next major
359-
release of xarray, to only include data variables instead of both data
360-
variables and coordinates. In the meantime, prefer iterating over
361-
``ds.data_vars`` or ``ds.coords``.
362-
363356
Dictionary like methods
364357
~~~~~~~~~~~~~~~~~~~~~~~
365358

@@ -370,6 +363,7 @@ example, to create this example dataset from scratch, we could have written:
370363
371364
ds = xr.Dataset()
372365
ds['temperature'] = (('x', 'y', 'time'), temp)
366+
ds['temperature_double'] = (('x', 'y', 'time'), temp * 2 )
373367
ds['precipitation'] = (('x', 'y', 'time'), precip)
374368
ds.coords['lat'] = (('x', 'y'), lat)
375369
ds.coords['lon'] = (('x', 'y'), lon)
@@ -404,9 +398,16 @@ operations keep around coordinates:
404398

405399
.. ipython:: python
406400
407-
list(ds[['temperature']])
408-
list(ds[['x']])
409-
list(ds.drop('temperature'))
401+
ds[['temperature']]
402+
ds[['temperature', 'temperature_double']]
403+
ds.drop('temperature')
404+
405+
To remove a dimension, you can use :py:meth:`~xarray.Dataset.drop_dims` method.
406+
Any variables using that dimension are dropped:
407+
408+
.. ipython:: python
409+
410+
ds.drop_dims('time')
410411
411412
As an alternate to dictionary-like modifications, you can use
412413
:py:meth:`~xarray.Dataset.assign` and :py:meth:`~xarray.Dataset.assign_coords`.

doc/examples.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Examples
44
.. toctree::
55
:maxdepth: 2
66

7-
examples/quick-overview
87
examples/weather-data
98
examples/monthly-means
109
examples/multidimensional-coords

0 commit comments

Comments
 (0)