Skip to content
forked from pydata/xarray

Commit

Permalink
Merge branch 'master' into fix/plot-broadcast
Browse files Browse the repository at this point in the history
* master: (24 commits)
  Tweaks to release instructions (pydata#3555)
  Clarify conda environments for new contributors (pydata#3551)
  Revert to dev version
  0.14.1 whatsnew (pydata#3547)
  sparse option to reindex and unstack (pydata#3542)
  Silence sphinx warnings (pydata#3516)
  Numpy 1.18 support (pydata#3537)
  tweak whats-new. (pydata#3540)
  small simplification of rename from pydata#3532 (pydata#3539)
  Added fill_value for unstack (pydata#3541)
  Add DatasetGroupBy.quantile (pydata#3527)
  ensure rename does not change index type (pydata#3532)
  Leave empty slot when not using accessors
  interpolate_na: Add max_gap support. (pydata#3302)
  units & deprecation merge (pydata#3530)
  Fix set_index when an existing dimension becomes a level (pydata#3520)
  add Variable._replace (pydata#3528)
  Tests for module-level functions with units (pydata#3493)
  Harmonize `FillValue` and `missing_value` during encoding and decoding steps (pydata#3502)
  FUNDING.yml (pydata#3523)
  ...
  • Loading branch information
dcherian committed Nov 22, 2019
2 parents d430ae0 + 8d09879 commit 9706b5a
Show file tree
Hide file tree
Showing 43 changed files with 2,208 additions and 430 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: numfocus
custom: http://numfocus.org/donate-to-xarray
51 changes: 40 additions & 11 deletions HOW_TO_RELEASE → HOW_TO_RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
How to issue an xarray release in 15 easy steps
How to issue an xarray release in 14 easy steps

Time required: about an hour.

1. Ensure your master branch is synced to upstream:
git pull upstream master
```
git pull upstream master
```
2. Look over whats-new.rst and the docs. Make sure "What's New" is complete
(check the date!) and consider adding a brief summary note describing the
release at the top.
Expand All @@ -12,37 +14,53 @@ Time required: about an hour.
- Function/method references should include links to the API docs.
- Sometimes notes get added in the wrong section of whats-new, typically
due to a bad merge. Check for these before a release by using git diff,
e.g., ``git diff v0.X.Y whats-new.rst`` where 0.X.Y is the previous
e.g., `git diff v0.X.Y whats-new.rst` where 0.X.Y is the previous
release.
3. If you have any doubts, run the full test suite one final time!
py.test
```
pytest
```
4. On the master branch, commit the release in git:
```
git commit -a -m 'Release v0.X.Y'
```
5. Tag the release:
```
git tag -a v0.X.Y -m 'v0.X.Y'
```
6. Build source and binary wheels for pypi:
```
git clean -xdf # this deletes all uncommited changes!
python setup.py bdist_wheel sdist
```
7. Use twine to register and upload the release on pypi. Be careful, you can't
take this back!
```
twine upload dist/xarray-0.X.Y*
```
You will need to be listed as a package owner at
https://pypi.python.org/pypi/xarray for this to work.
8. Push your changes to master:
```
git push upstream master
git push upstream --tags
```
9. Update the stable branch (used by ReadTheDocs) and switch back to master:
```
git checkout stable
git rebase master
git push upstream stable
git checkout master
It's OK to force push to 'stable' if necessary.
We also update the stable branch with `git cherrypick` for documentation
only fixes that apply the current released version.
```
It's OK to force push to 'stable' if necessary. (We also update the stable
branch with `git cherrypick` for documentation only fixes that apply the
current released version.)
10. Add a section for the next release (v.X.(Y+1)) to doc/whats-new.rst.
11. Commit your changes and push to master again:
git commit -a -m 'Revert to dev version'
```
git commit -a -m 'New whatsnew section'
git push upstream master
```
You're done pushing to master!
12. Issue the release on GitHub. Click on "Draft a new release" at
https://github.com/pydata/xarray/releases. Type in the version number, but
Expand All @@ -53,11 +71,22 @@ Time required: about an hour.
14. Issue the release announcement! For bug fix releases, I usually only email
xarray@googlegroups.com. For major/feature releases, I will email a broader
list (no more than once every 3-6 months):
pydata@googlegroups.com, xarray@googlegroups.com,
numpy-discussion@scipy.org, scipy-user@scipy.org,
pyaos@lists.johnny-lin.com
- pydata@googlegroups.com
- xarray@googlegroups.com
- numpy-discussion@scipy.org
- scipy-user@scipy.org
- pyaos@lists.johnny-lin.com

Google search will turn up examples of prior release announcements (look for
"ANN xarray").
You can get a list of contributors with:
```
git log "$(git tag --sort="v:refname" | sed -n 'x;$p').." --format="%aN" | sort -u
```
or by replacing `v0.X.Y` with the _previous_ release in:
```
git log v0.X.Y.. --format="%aN" | sort -u
```

Note on version numbering:

Expand Down
2 changes: 1 addition & 1 deletion ci/azure/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ steps:
--pre \
--upgrade \
matplotlib \
numpy \
pandas \
scipy
# numpy \ # FIXME https://github.com/pydata/xarray/issues/3409
pip install \
--no-deps \
--upgrade \
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements/py36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies:
- nc-time-axis
- netcdf4
- numba
- numpy<1.18 # FIXME https://github.com/pydata/xarray/issues/3409
- numpy
- pandas
- pint
- pip
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements/py37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies:
- nc-time-axis
- netcdf4
- numba
- numpy<1.18 # FIXME https://github.com/pydata/xarray/issues/3409
- numpy
- pandas
- pint
- pip
Expand Down
2 changes: 2 additions & 0 deletions doc/README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
:orphan:

xarray
------

Expand Down
5 changes: 5 additions & 0 deletions doc/api-hidden.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.. This extra page is a work around for sphinx not having any support for
.. hiding an autosummary table.
:orphan:

.. currentmodule:: xarray

.. autosummary::
Expand Down Expand Up @@ -30,9 +32,11 @@
core.groupby.DatasetGroupBy.first
core.groupby.DatasetGroupBy.last
core.groupby.DatasetGroupBy.fillna
core.groupby.DatasetGroupBy.quantile
core.groupby.DatasetGroupBy.where

Dataset.argsort
Dataset.astype
Dataset.clip
Dataset.conj
Dataset.conjugate
Expand Down Expand Up @@ -71,6 +75,7 @@
core.groupby.DataArrayGroupBy.first
core.groupby.DataArrayGroupBy.last
core.groupby.DataArrayGroupBy.fillna
core.groupby.DataArrayGroupBy.quantile
core.groupby.DataArrayGroupBy.where

DataArray.argsort
Expand Down
6 changes: 3 additions & 3 deletions doc/combining.rst
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ Combining along multiple dimensions
``combine_nested``.

For combining many objects along multiple dimensions xarray provides
:py:func:`~xarray.combine_nested`` and :py:func:`~xarray.combine_by_coords`. These
:py:func:`~xarray.combine_nested` and :py:func:`~xarray.combine_by_coords`. These
functions use a combination of ``concat`` and ``merge`` across different
variables to combine many objects into one.

:py:func:`~xarray.combine_nested`` requires specifying the order in which the
:py:func:`~xarray.combine_nested` requires specifying the order in which the
objects should be combined, while :py:func:`~xarray.combine_by_coords` attempts to
infer this ordering automatically from the coordinates in the data.

Expand Down Expand Up @@ -310,4 +310,4 @@ These functions can be used by :py:func:`~xarray.open_mfdataset` to open many
files as one dataset. The particular function used is specified by setting the
argument ``'combine'`` to ``'by_coords'`` or ``'nested'``. This is useful for
situations where your data is split across many files in multiple locations,
which have some known relationship between one another.
which have some known relationship between one another.
9 changes: 6 additions & 3 deletions doc/computation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ for filling missing values via 1D interpolation.
Note that xarray slightly diverges from the pandas ``interpolate`` syntax by
providing the ``use_coordinate`` keyword which facilitates a clear specification
of which values to use as the index in the interpolation.
xarray also provides the ``max_gap`` keyword argument to limit the interpolation to
data gaps of length ``max_gap`` or smaller. See :py:meth:`~xarray.DataArray.interpolate_na`
for more.

Aggregation
===========
Expand Down Expand Up @@ -322,8 +325,8 @@ Broadcasting by dimension name
``DataArray`` objects are automatically align themselves ("broadcasting" in
the numpy parlance) by dimension name instead of axis order. With xarray, you
do not need to transpose arrays or insert dimensions of length 1 to get array
operations to work, as commonly done in numpy with :py:func:`np.reshape` or
:py:const:`np.newaxis`.
operations to work, as commonly done in numpy with :py:func:`numpy.reshape` or
:py:data:`numpy.newaxis`.

This is best illustrated by a few examples. Consider two one-dimensional
arrays with different sizes aligned along different dimensions:
Expand Down Expand Up @@ -563,7 +566,7 @@ to set ``axis=-1``. As an example, here is how we would wrap
Because ``apply_ufunc`` follows a standard convention for ufuncs, it plays
nicely with tools for building vectorized functions, like
:func:`numpy.broadcast_arrays` and :func:`numpy.vectorize`. For high performance
:py:func:`numpy.broadcast_arrays` and :py:class:`numpy.vectorize`. For high performance
needs, consider using Numba's :doc:`vectorize and guvectorize <numba:user/vectorize>`.

In addition to wrapping functions, ``apply_ufunc`` can automatically parallelize
Expand Down
12 changes: 7 additions & 5 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,11 @@
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
"iris": ("http://scitools.org.uk/iris/docs/latest/", None),
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
"numba": ("https://numba.pydata.org/numba-doc/latest/", None),
"matplotlib": ("https://matplotlib.org/", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
"iris": ("https://scitools.org.uk/iris/docs/latest", None),
"numpy": ("https://docs.scipy.org/doc/numpy", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
"numba": ("https://numba.pydata.org/numba-doc/latest", None),
"matplotlib": ("https://matplotlib.org", None),
"dask": ("https://docs.dask.org/en/latest", None),
}
4 changes: 3 additions & 1 deletion doc/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ We'll now kick off a two-step process:
.. code-block:: none
# Create and activate the build environment
conda env create -f ci/requirements/py36.yml
# This is for Linux and MacOS. On Windows, use py37-windows.yml instead.
conda env create -f ci/requirements/py37.yml
conda activate xarray-tests
# or with older versions of Anaconda:
Expand Down
2 changes: 1 addition & 1 deletion doc/dask.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ automate `embarrassingly parallel
<https://en.wikipedia.org/wiki/Embarrassingly_parallel>`__ "map" type operations
where a function written for processing NumPy arrays should be repeatedly
applied to xarray objects containing Dask arrays. It works similarly to
:py:func:`dask.array.map_blocks` and :py:func:`dask.array.atop`, but without
:py:func:`dask.array.map_blocks` and :py:func:`dask.array.blockwise`, but without
requiring an intermediate layer of abstraction.

For the best performance when using Dask's multi-threaded scheduler, wrap a
Expand Down
6 changes: 3 additions & 3 deletions doc/data-structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Creating a DataArray
The :py:class:`~xarray.DataArray` constructor takes:

- ``data``: a multi-dimensional array of values (e.g., a numpy ndarray,
:py:class:`~pandas.Series`, :py:class:`~pandas.DataFrame` or :py:class:`~pandas.Panel`)
:py:class:`~pandas.Series`, :py:class:`~pandas.DataFrame` or ``pandas.Panel``)
- ``coords``: a list or dictionary of coordinates. If a list, it should be a
list of tuples where the first element is the dimension name and the second
element is the corresponding coordinate array_like object.
Expand Down Expand Up @@ -125,7 +125,7 @@ As a dictionary with coords across multiple dimensions:
If you create a ``DataArray`` by supplying a pandas
:py:class:`~pandas.Series`, :py:class:`~pandas.DataFrame` or
:py:class:`~pandas.Panel`, any non-specified arguments in the
``pandas.Panel``, any non-specified arguments in the
``DataArray`` constructor will be filled in from the pandas object:

.. ipython:: python
Expand Down Expand Up @@ -301,7 +301,7 @@ names, and its data is aligned to any existing dimensions.

You can also create an dataset from:

- A :py:class:`pandas.DataFrame` or :py:class:`pandas.Panel` along its columns and items
- A :py:class:`pandas.DataFrame` or ``pandas.Panel`` along its columns and items
respectively, by passing it into the :py:class:`~xarray.Dataset` directly
- A :py:class:`pandas.DataFrame` with :py:meth:`Dataset.from_dataframe <xarray.Dataset.from_dataframe>`,
which will additionally handle MultiIndexes See :ref:`pandas`
Expand Down
2 changes: 1 addition & 1 deletion doc/pandas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ automatically stacking them into a ``MultiIndex``.
:py:meth:`DataArray.to_pandas() <xarray.DataArray.to_pandas>` is a shortcut that
lets you convert a DataArray directly into a pandas object with the same
dimensionality (i.e., a 1D array is converted to a :py:class:`~pandas.Series`,
2D to :py:class:`~pandas.DataFrame` and 3D to :py:class:`~pandas.Panel`):
2D to :py:class:`~pandas.DataFrame` and 3D to ``pandas.Panel``):

.. ipython:: python
Expand Down
Loading

0 comments on commit 9706b5a

Please sign in to comment.