Skip to content

Commit c768edc

Browse files
keewistoddrjen
authored andcommitted
fix links in the documentation (#4686)
* convert the note directive to a numpydoc note section * disable the use of rtype, with sphinx 3.3 the type will still be linked * add back a lost author note * don't reference the internal encode_cf_datetime function * fix the links of a whats-new entry * fix the docstrings of corr and cov * remove all references to auto_combine * link to rasterio's documentation using intersphinx * fix the links to the Dataset or DataArray rolling or groupby methods * reformat the return value docs for rolling * fix the return value docs for coarsen * link to dask.compute instead of dask.array.compute
1 parent 00a3bee commit c768edc

File tree

9 files changed

+48
-45
lines changed

9 files changed

+48
-45
lines changed

doc/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
napoleon_numpy_docstring = True
116116

117117
napoleon_use_param = False
118-
napoleon_use_rtype = True
118+
napoleon_use_rtype = False
119119
napoleon_preprocess_types = True
120120
napoleon_type_aliases = {
121121
# general terms
@@ -418,6 +418,7 @@
418418
"matplotlib": ("https://matplotlib.org", None),
419419
"dask": ("https://docs.dask.org/en/latest", None),
420420
"cftime": ("https://unidata.github.io/cftime", None),
421+
"rasterio": ("https://rasterio.readthedocs.io/en/latest", None),
421422
"sparse": ("https://sparse.pydata.org/en/latest/", None),
422423
}
423424

doc/whats-new.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Bug fixes
115115
~~~~~~~~~
116116

117117
- Fix bug where reference times without padded years (e.g. ``since 1-1-1``) would lose their units when
118-
being passed by :py:func:`encode_cf_datetime` (:issue:`4422`, :pull:`4506`). Such units are ambiguous
118+
being passed by ``encode_cf_datetime`` (:issue:`4422`, :pull:`4506`). Such units are ambiguous
119119
about which digit represents the years (is it YMD or DMY?). Now, if such formatting is encountered,
120120
it is assumed that the first digit is the years, they are padded appropriately (to e.g. ``since 0001-1-1``)
121121
and a warning that this assumption is being made is issued. Previously, without ``cftime``, such times
@@ -319,8 +319,10 @@ Internal Changes
319319

320320
All are up from 6 months (:issue:`4295`)
321321
`Guido Imperiale <https://github.com/crusaderky>`_.
322-
- Use :py:func:`dask.array.apply_gufunc` instead of :py:func:`dask.array.blockwise` in
323-
:py:func:`xarray.apply_ufunc` when using ``dask='parallelized'``. (:pull:`4060`, :pull:`4391`, :pull:`4392`)
322+
- Use :py:func:`dask.array.apply_gufunc <dask.array.gufunc.apply_gufunc>` instead of
323+
:py:func:`dask.array.blockwise` in :py:func:`xarray.apply_ufunc` when using
324+
``dask='parallelized'``. (:pull:`4060`, :pull:`4391`, :pull:`4392`)
325+
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
324326
- Align ``mypy`` versions to ``0.782`` across ``requirements`` and
325327
``.pre-commit-config.yml`` files. (:pull:`4390`)
326328
By `Maximilian Roos <https://github.com/max-sixty>`_

xarray/core/combine.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,6 @@ def combine_nested(
518518
--------
519519
concat
520520
merge
521-
auto_combine
522521
"""
523522
if isinstance(concat_dim, (str, DataArray)) or concat_dim is None:
524523
concat_dim = [concat_dim]

xarray/core/common.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -817,8 +817,9 @@ def rolling(
817817
818818
Returns
819819
-------
820-
Rolling object (core.rolling.DataArrayRolling for DataArray,
821-
core.rolling.DatasetRolling for Dataset.)
820+
core.rolling.DataArrayRolling or core.rolling.DatasetRolling
821+
A rolling object (``DataArrayRolling`` for ``DataArray``,
822+
``DatasetRolling`` for ``Dataset``)
822823
823824
Examples
824825
--------
@@ -929,8 +930,9 @@ def coarsen(
929930
930931
Returns
931932
-------
932-
Coarsen object (core.rolling.DataArrayCoarsen for DataArray,
933-
core.rolling.DatasetCoarsen for Dataset.)
933+
core.rolling.DataArrayCoarsen or core.rolling.DatasetCoarsen
934+
A coarsen object (``DataArrayCoarsen`` for ``DataArray``,
935+
``DatasetCoarsen`` for ``Dataset``)
934936
935937
Examples
936938
--------

xarray/core/computation.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,24 +1148,24 @@ def cov(da_a, da_b, dim=None, ddof=1):
11481148
11491149
Parameters
11501150
----------
1151-
da_a: DataArray
1151+
da_a : DataArray
11521152
Array to compute.
1153-
da_b: DataArray
1153+
da_b : DataArray
11541154
Array to compute.
11551155
dim : str, optional
11561156
The dimension along which the covariance will be computed
1157-
ddof: int, optional
1157+
ddof : int, optional
11581158
If ddof=1, covariance is normalized by N-1, giving an unbiased estimate,
11591159
else normalization is by N.
11601160
11611161
Returns
11621162
-------
1163-
covariance: DataArray
1163+
covariance : DataArray
11641164
11651165
See also
11661166
--------
1167-
pandas.Series.cov: corresponding pandas function
1168-
xr.corr: respective function to calculate correlation
1167+
pandas.Series.cov : corresponding pandas function
1168+
xarray.corr: respective function to calculate correlation
11691169
11701170
Examples
11711171
--------
@@ -1229,11 +1229,11 @@ def corr(da_a, da_b, dim=None):
12291229
12301230
Parameters
12311231
----------
1232-
da_a: DataArray
1232+
da_a : DataArray
12331233
Array to compute.
1234-
da_b: DataArray
1234+
da_b : DataArray
12351235
Array to compute.
1236-
dim: str, optional
1236+
dim : str, optional
12371237
The dimension along which the correlation will be computed
12381238
12391239
Returns
@@ -1242,8 +1242,8 @@ def corr(da_a, da_b, dim=None):
12421242
12431243
See also
12441244
--------
1245-
pandas.Series.corr: corresponding pandas function
1246-
xr.cov: underlying covariance function
1245+
pandas.Series.corr : corresponding pandas function
1246+
xarray.cov : underlying covariance function
12471247
12481248
Examples
12491249
--------

xarray/core/concat.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ def concat(
160160
See also
161161
--------
162162
merge
163-
auto_combine
164163
165164
Examples
166165
--------

xarray/core/dataarray.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -856,11 +856,11 @@ def load(self, **kwargs) -> "DataArray":
856856
Parameters
857857
----------
858858
**kwargs : dict
859-
Additional keyword arguments passed on to ``dask.array.compute``.
859+
Additional keyword arguments passed on to ``dask.compute``.
860860
861861
See Also
862862
--------
863-
dask.array.compute
863+
dask.compute
864864
"""
865865
ds = self._to_temp_dataset().load(**kwargs)
866866
new = self._from_temp_dataset(ds)
@@ -881,11 +881,11 @@ def compute(self, **kwargs) -> "DataArray":
881881
Parameters
882882
----------
883883
**kwargs : dict
884-
Additional keyword arguments passed on to ``dask.array.compute``.
884+
Additional keyword arguments passed on to ``dask.compute``.
885885
886886
See Also
887887
--------
888-
dask.array.compute
888+
dask.compute
889889
"""
890890
new = self.copy(deep=False)
891891
return new.load(**kwargs)
@@ -2994,10 +2994,10 @@ def diff(self, dim: Hashable, n: int = 1, label: Hashable = "upper") -> "DataArr
29942994
difference : same type as caller
29952995
The n-th order finite difference of this object.
29962996
2997-
.. note::
2998-
2999-
`n` matches numpy's behavior and is different from pandas' first
3000-
argument named `periods`.
2997+
Notes
2998+
-----
2999+
`n` matches numpy's behavior and is different from pandas' first argument named
3000+
`periods`.
30013001
30023002
30033003
Examples

xarray/core/dataset.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -779,11 +779,11 @@ def load(self, **kwargs) -> "Dataset":
779779
Parameters
780780
----------
781781
**kwargs : dict
782-
Additional keyword arguments passed on to ``dask.array.compute``.
782+
Additional keyword arguments passed on to ``dask.compute``.
783783
784784
See Also
785785
--------
786-
dask.array.compute
786+
dask.compute
787787
"""
788788
# access .data to coerce everything to numpy or dask arrays
789789
lazy_data = {
@@ -951,11 +951,11 @@ def compute(self, **kwargs) -> "Dataset":
951951
Parameters
952952
----------
953953
**kwargs : dict
954-
Additional keyword arguments passed on to ``dask.array.compute``.
954+
Additional keyword arguments passed on to ``dask.compute``.
955955
956956
See Also
957957
--------
958-
dask.array.compute
958+
dask.compute
959959
"""
960960
new = self.copy(deep=False)
961961
return new.load(**kwargs)

xarray/core/rolling.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ class Rolling:
4141
4242
See Also
4343
--------
44-
Dataset.groupby
45-
DataArray.groupby
46-
Dataset.rolling
47-
DataArray.rolling
44+
xarray.Dataset.groupby
45+
xarray.DataArray.groupby
46+
xarray.Dataset.rolling
47+
xarray.DataArray.rolling
4848
"""
4949

5050
__slots__ = ("obj", "window", "min_periods", "center", "dim", "keep_attrs")
@@ -209,10 +209,10 @@ def __init__(self, obj, windows, min_periods=None, center=False, keep_attrs=None
209209
210210
See Also
211211
--------
212-
DataArray.rolling
213-
DataArray.groupby
214-
Dataset.rolling
215-
Dataset.groupby
212+
xarray.DataArray.rolling
213+
xarray.DataArray.groupby
214+
xarray.Dataset.rolling
215+
xarray.Dataset.groupby
216216
"""
217217
super().__init__(
218218
obj, windows, min_periods=min_periods, center=center, keep_attrs=keep_attrs
@@ -526,10 +526,10 @@ def __init__(self, obj, windows, min_periods=None, center=False, keep_attrs=None
526526
527527
See Also
528528
--------
529-
Dataset.rolling
530-
DataArray.rolling
531-
Dataset.groupby
532-
DataArray.groupby
529+
xarray.Dataset.rolling
530+
xarray.DataArray.rolling
531+
xarray.Dataset.groupby
532+
xarray.DataArray.groupby
533533
"""
534534
super().__init__(obj, windows, min_periods, center, keep_attrs)
535535
if any(d not in self.obj.dims for d in self.dim):

0 commit comments

Comments
 (0)