Skip to content

Commit d1d2ece

Browse files
committed
DOC: fix docstrings and doc build for 0.11.1
1 parent 250b19c commit d1d2ece

File tree

7 files changed

+63
-65
lines changed

7 files changed

+63
-65
lines changed

doc/examples/weather-data.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Shared setup:
1717
.. ipython:: python
1818
:suppress:
1919
20-
fpath = "doc/examples/_code/weather_data_setup.py"
20+
fpath = "examples/_code/weather_data_setup.py"
2121
with open(fpath) as f:
2222
code = compile(f.read(), fpath, 'exec')
2323
exec(code)

doc/internals.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Back in an interactive IPython session, we can use these properties:
111111
.. ipython:: python
112112
:suppress:
113113
114-
exec(open("doc/examples/_code/accessor_example.py").read())
114+
exec(open("examples/_code/accessor_example.py").read())
115115
116116
.. ipython:: python
117117

doc/whats-new.rst

+15-14
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,24 @@ What's New
1313
import xarray as xr
1414
np.random.seed(123456)
1515
16+
.. _whats-new.0.11.1:
17+
18+
v0.11.1 (29 December 2018)
19+
--------------------------
20+
21+
This minor release includes a number of enhancements and bug fixes, and two
22+
(slightly) breaking changes.
23+
1624
.. warning::
1725

18-
Xarray plans to drop support for python 2.7 at the end of 2018. This
19-
means that new releases of xarray published after this date will only be
20-
installable on python 3+ environments, but older versions of xarray will
21-
always be available to python 2.7 users. For more information see the
22-
following references
26+
This is the last xarray release that will support Python 2.7. Future releases
27+
will be Python 3 only, but older versions of xarray will always be available
28+
for Python 2.7 users. For the more details, see:
2329

24-
- `Xarray Github issue discussing dropping Python 2 <https://github.com/pydata/xarray/issues/1829>`__
30+
- `Xarray Github issue discussing dropping Python 2 <https://github.com/pydata/xarray/issues/1829>`__
2531
- `Python 3 Statement <http://www.python3statement.org/>`__
2632
- `Tips on porting to Python 3 <https://docs.python.org/3/howto/pyporting.html>`__
2733

28-
.. _whats-new.0.11.1:
29-
30-
v0.11.1 (unreleased)
31-
--------------------
32-
3334
Breaking changes
3435
~~~~~~~~~~~~~~~~
3536

@@ -70,9 +71,9 @@ Enhancements
7071
- Datasets are now guaranteed to have a ``'source'`` encoding, so the source
7172
file name is always stored (:issue:`2550`).
7273
By `Tom Nicholas <http://github.com/TomNicholas>`_.
73-
- The `apply` methods for `DatasetGroupBy`, `DataArrayGroupBy`,
74-
`DatasetResample` and `DataArrayResample` can now pass positional arguments to
75-
the applied function.
74+
- The ``apply`` methods for ``DatasetGroupBy``, ``DataArrayGroupBy``,
75+
``DatasetResample`` and ``DataArrayResample`` now support passing positional
76+
arguments to the applied function as a tuple to the ``args`` argument.
7677
By `Matti Eskelinen <https://github.com/maaleske>`_.
7778
- 0d slices of ndarrays are now obtained directly through indexing, rather than
7879
extracting and wrapping a scalar, avoiding unnecessary copying. By `Daniel

xarray/backends/api.py

+32-31
Original file line numberDiff line numberDiff line change
@@ -517,18 +517,17 @@ def open_mfdataset(paths, chunks=None, concat_dim=_CONCAT_DIM_DEFAULT,
517517
By default, xarray attempts to infer this argument by examining
518518
component files. Set ``concat_dim=None`` explicitly to disable
519519
concatenation.
520-
compat : {'identical', 'equals', 'broadcast_equals',
521-
'no_conflicts'}, optional
520+
compat : {'identical', 'equals', 'broadcast_equals', 'no_conflicts'}, optional
522521
String indicating how to compare variables of the same name for
523522
potential conflicts when merging:
524-
- 'broadcast_equals': all values must be equal when variables are
525-
broadcast against each other to ensure common dimensions.
526-
- 'equals': all values and dimensions must be the same.
527-
- 'identical': all values, dimensions and attributes must be the
528-
same.
529-
- 'no_conflicts': only values which are not null in both datasets
530-
must be equal. The returned dataset then contains the combination
531-
of all non-null values.
523+
* 'broadcast_equals': all values must be equal when variables are
524+
broadcast against each other to ensure common dimensions.
525+
* 'equals': all values and dimensions must be the same.
526+
* 'identical': all values, dimensions and attributes must be the
527+
same.
528+
* 'no_conflicts': only values which are not null in both datasets
529+
must be equal. The returned dataset then contains the combination
530+
of all non-null values.
532531
preprocess : callable, optional
533532
If provided, call this function on each dataset prior to concatenation.
534533
You can find the file-name from which each dataset was loaded in
@@ -545,29 +544,31 @@ def open_mfdataset(paths, chunks=None, concat_dim=_CONCAT_DIM_DEFAULT,
545544
active dask scheduler.
546545
data_vars : {'minimal', 'different', 'all' or list of str}, optional
547546
These data variables will be concatenated together:
548-
* 'minimal': Only data variables in which the dimension already
549-
appears are included.
550-
* 'different': Data variables which are not equal (ignoring
551-
attributes) across all datasets are also concatenated (as well as
552-
all for which dimension already appears). Beware: this option may
553-
load the data payload of data variables into memory if they are not
554-
already loaded.
555-
* 'all': All data variables will be concatenated.
556-
* list of str: The listed data variables will be concatenated, in
557-
addition to the 'minimal' data variables.
547+
548+
* 'minimal': Only data variables in which the dimension already
549+
appears are included.
550+
* 'different': Data variables which are not equal (ignoring
551+
attributes) across all datasets are also concatenated (as well as
552+
all for which dimension already appears). Beware: this option may
553+
load the data payload of data variables into memory if they are not
554+
already loaded.
555+
* 'all': All data variables will be concatenated.
556+
* list of str: The listed data variables will be concatenated, in
557+
addition to the 'minimal' data variables.
558558
coords : {'minimal', 'different', 'all' o list of str}, optional
559559
These coordinate variables will be concatenated together:
560-
* 'minimal': Only coordinates in which the dimension already appears
561-
are included.
562-
* 'different': Coordinates which are not equal (ignoring attributes)
563-
across all datasets are also concatenated (as well as all for which
564-
dimension already appears). Beware: this option may load the data
565-
payload of coordinate variables into memory if they are not already
566-
loaded.
567-
* 'all': All coordinate variables will be concatenated, except
568-
those corresponding to other dimensions.
569-
* list of str: The listed coordinate variables will be concatenated,
570-
in addition the 'minimal' coordinates.
560+
561+
* 'minimal': Only coordinates in which the dimension already appears
562+
are included.
563+
* 'different': Coordinates which are not equal (ignoring attributes)
564+
across all datasets are also concatenated (as well as all for which
565+
dimension already appears). Beware: this option may load the data
566+
payload of coordinate variables into memory if they are not already
567+
loaded.
568+
* 'all': All coordinate variables will be concatenated, except
569+
those corresponding to other dimensions.
570+
* list of str: The listed coordinate variables will be concatenated,
571+
in addition the 'minimal' coordinates.
571572
parallel : bool, optional
572573
If True, the open and preprocess steps of this function will be
573574
performed in parallel using ``dask.delayed``. Default is False.

xarray/core/alignment.py

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def align(*objects, **kwargs):
5353
join : {'outer', 'inner', 'left', 'right', 'exact'}, optional
5454
Method for joining the indexes of the passed objects along each
5555
dimension:
56+
5657
- 'outer': use the union of object indexes
5758
- 'inner': use the intersection of object indexes
5859
- 'left': use indexes from the first object with each dimension

xarray/core/combine.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -574,10 +574,10 @@ def auto_combine(datasets, concat_dim=_CONCAT_DIM_DEFAULT,
574574
By default, xarray attempts to infer this argument by examining
575575
component files. Set ``concat_dim=None`` explicitly to disable
576576
concatenation.
577-
compat : {'identical', 'equals', 'broadcast_equals',
578-
'no_conflicts'}, optional
577+
compat : {'identical', 'equals', 'broadcast_equals', 'no_conflicts'}, optional
579578
String indicating how to compare variables of the same name for
580579
potential conflicts:
580+
581581
- 'broadcast_equals': all values must be equal when variables are
582582
broadcast against each other to ensure common dimensions.
583583
- 'equals': all values and dimensions must be the same.
@@ -599,7 +599,7 @@ def auto_combine(datasets, concat_dim=_CONCAT_DIM_DEFAULT,
599599
--------
600600
concat
601601
Dataset.merge
602-
"""
602+
""" # noqa
603603

604604
# Coerce 1D input into ND to maintain backwards-compatible API until API
605605
# for N-D combine decided

xarray/core/merge.py

+10-15
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ def unique_variable(name, variables, compat='broadcast_equals'):
4949
variables : list of xarray.Variable
5050
List of Variable objects, all of which go by the same name in different
5151
inputs.
52-
compat : {'identical', 'equals', 'broadcast_equals',
53-
'no_conflicts'}, optional
52+
compat : {'identical', 'equals', 'broadcast_equals', 'no_conflicts'}, optional
5453
Type of equality check to use.
5554
5655
Returns
@@ -60,7 +59,7 @@ def unique_variable(name, variables, compat='broadcast_equals'):
6059
Raises
6160
------
6261
MergeError: if any of the variables are not equal.
63-
"""
62+
""" # noqa
6463
out = variables[0]
6564
if len(variables) > 1:
6665
combine_method = None
@@ -122,16 +121,15 @@ def merge_variables(
122121
priority_vars : mapping with Variable or None values, optional
123122
If provided, variables are always taken from this dict in preference to
124123
the input variable dictionaries, without checking for conflicts.
125-
compat : {'identical', 'equals', 'broadcast_equals',
126-
'minimal', 'no_conflicts'}, optional
124+
compat : {'identical', 'equals', 'broadcast_equals', 'minimal', 'no_conflicts'}, optional
127125
Type of equality check to use when checking for conflicts.
128126
129127
Returns
130128
-------
131129
OrderedDict with keys taken by the union of keys on list_of_variable_dicts,
132130
and Variable values corresponding to those that should be found on the
133131
merged result.
134-
"""
132+
""" # noqa
135133
if priority_vars is None:
136134
priority_vars = {}
137135

@@ -313,15 +311,14 @@ def _get_priority_vars(objects, priority_arg, compat='equals'):
313311
Dictionaries in which to find the priority variables.
314312
priority_arg : int or None
315313
Integer object whose variable should take priority.
316-
compat : {'identical', 'equals', 'broadcast_equals',
317-
'no_conflicts'}, optional
314+
compat : {'identical', 'equals', 'broadcast_equals', 'no_conflicts'}, optional
318315
Compatibility checks to use when merging variables.
319316
320317
Returns
321318
-------
322319
None, if priority_arg is None, or an OrderedDict with Variable objects as
323320
values indicating priority variables.
324-
"""
321+
""" # noqa
325322
if priority_arg is None:
326323
priority_vars = {}
327324
else:
@@ -406,8 +403,7 @@ def merge_core(objs,
406403
----------
407404
objs : list of mappings
408405
All values must be convertable to labeled arrays.
409-
compat : {'identical', 'equals', 'broadcast_equals',
410-
'no_conflicts'}, optional
406+
compat : {'identical', 'equals', 'broadcast_equals', 'no_conflicts'}, optional
411407
Compatibility checks to use when merging variables.
412408
join : {'outer', 'inner', 'left', 'right'}, optional
413409
How to combine objects with different indexes.
@@ -430,7 +426,7 @@ def merge_core(objs,
430426
Raises
431427
------
432428
MergeError if the merge cannot be done successfully.
433-
"""
429+
""" # noqa
434430
from .dataset import calculate_dimensions
435431

436432
_assert_compat_valid(compat)
@@ -472,8 +468,7 @@ def merge(objects, compat='no_conflicts', join='outer'):
472468
objects : Iterable[Union[xarray.Dataset, xarray.DataArray, dict]]
473469
Merge together all variables from these objects. If any of them are
474470
DataArray objects, they must have a name.
475-
compat : {'identical', 'equals', 'broadcast_equals',
476-
'no_conflicts'}, optional
471+
compat : {'identical', 'equals', 'broadcast_equals', 'no_conflicts'}, optional
477472
String indicating how to compare variables of the same name for
478473
potential conflicts:
479474
@@ -516,7 +511,7 @@ def merge(objects, compat='no_conflicts', join='outer'):
516511
See also
517512
--------
518513
concat
519-
"""
514+
""" # noqa
520515
from .dataarray import DataArray
521516
from .dataset import Dataset
522517

0 commit comments

Comments
 (0)