Skip to content

Commit d9ebcaf

Browse files
keewismax-sixtydcherian
authored
Silence sphinx warnings (#4286)
* generate documentation for the a few missing CFTimeIndex attributes * properly use continuation lines * add a missing quote * delete the note about the removed auto_combine * replace auto_combine with combine_by_coords * set the current module in dask.rst * fix some links in whats-new.rst and generate doc pages for the plot functions * add the new CFTimeIndex methods to api-hidden * don't link to CFTimeIndex.__repr__ * don't try to link to the datetime accessor * fix a few more docstrings * remove the non-html options (which are rarely used?) and silence flake8 * add type aliases * map ComplexWarning to numpy.ComplexWarning * fix more docstrings * add some missing methods and properties to api-hidden * more aliases * fix a few more docstrings * properly reference ... (Ellipsis) * update the docstrings of dataset * update the docstrings of DataArray * remove the references to CFTimeOffset * fix a lot more docstrings * fix even more docstrings * remove a few more workarounds for a sphinx bug * use sphinx version 3.2 * remove a few misspellings of bool and optional * fix more docstrings * more fixes * remove the mixed markup since it is not supported by the preprocessor * use double instead of single quotes in docstrings * make sure the standard default notation is used everywhere * add a missing end quote * don't use nested parameter definition lists * update some outdated links to the pandas docs * update some more docstrings * mark a parameter as optional * more docstrings * use code blocks instead of literal blocks with doctest lines * add back a removed colon * convert the glossary page to a sphinx glossary * add term descriptions for names and scalars * preprocess types but don't use :param: because that will separate combined parameter docs by duplicating the description * link to the terms * don't try to link to the repr method * update the definition of scalar according to the review * Update doc/terminology.rst Co-authored-by: Maximilian Roos <[email protected]> * Update doc/terminology.rst Co-authored-by: Maximilian Roos <[email protected]> * fix a bad merge * fix the docstring of cftime_range Co-authored-by: Maximilian Roos <[email protected]> Co-authored-by: Deepak Cherian <[email protected]>
1 parent a3f0042 commit d9ebcaf

37 files changed

+1008
-832
lines changed

ci/requirements/doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies:
2424
- rasterio>=1.1
2525
- seaborn
2626
- setuptools
27-
- sphinx=3.1
27+
- sphinx=3.2
2828
- sphinx_rtd_theme>=0.4
2929
- sphinx-autosummary-accessors
3030
- zarr>=2.4

doc/api-hidden.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
core.rolling.DatasetCoarsen.var
5353
core.rolling.DatasetCoarsen.boundary
5454
core.rolling.DatasetCoarsen.coord_func
55+
core.rolling.DatasetCoarsen.keep_attrs
5556
core.rolling.DatasetCoarsen.obj
5657
core.rolling.DatasetCoarsen.side
5758
core.rolling.DatasetCoarsen.trim_excess
@@ -104,6 +105,8 @@
104105
core.resample.DatasetResample.dims
105106
core.resample.DatasetResample.groups
106107

108+
core.rolling.DatasetRolling.argmax
109+
core.rolling.DatasetRolling.argmin
107110
core.rolling.DatasetRolling.count
108111
core.rolling.DatasetRolling.max
109112
core.rolling.DatasetRolling.mean
@@ -115,11 +118,15 @@
115118
core.rolling.DatasetRolling.var
116119
core.rolling.DatasetRolling.center
117120
core.rolling.DatasetRolling.dim
121+
core.rolling.DatasetRolling.keep_attrs
118122
core.rolling.DatasetRolling.min_periods
119123
core.rolling.DatasetRolling.obj
120124
core.rolling.DatasetRolling.rollings
121125
core.rolling.DatasetRolling.window
122126

127+
core.weighted.DatasetWeighted.obj
128+
core.weighted.DatasetWeighted.weights
129+
123130
core.rolling_exp.RollingExp.mean
124131

125132
Dataset.argsort
@@ -188,6 +195,7 @@
188195
core.rolling.DataArrayCoarsen.var
189196
core.rolling.DataArrayCoarsen.boundary
190197
core.rolling.DataArrayCoarsen.coord_func
198+
core.rolling.DataArrayCoarsen.keep_attrs
191199
core.rolling.DataArrayCoarsen.obj
192200
core.rolling.DataArrayCoarsen.side
193201
core.rolling.DataArrayCoarsen.trim_excess
@@ -238,6 +246,8 @@
238246
core.resample.DataArrayResample.dims
239247
core.resample.DataArrayResample.groups
240248

249+
core.rolling.DataArrayRolling.argmax
250+
core.rolling.DataArrayRolling.argmin
241251
core.rolling.DataArrayRolling.count
242252
core.rolling.DataArrayRolling.max
243253
core.rolling.DataArrayRolling.mean
@@ -249,11 +259,15 @@
249259
core.rolling.DataArrayRolling.var
250260
core.rolling.DataArrayRolling.center
251261
core.rolling.DataArrayRolling.dim
262+
core.rolling.DataArrayRolling.keep_attrs
252263
core.rolling.DataArrayRolling.min_periods
253264
core.rolling.DataArrayRolling.obj
254265
core.rolling.DataArrayRolling.window
255266
core.rolling.DataArrayRolling.window_labels
256267

268+
core.weighted.DataArrayWeighted.obj
269+
core.weighted.DataArrayWeighted.weights
270+
257271
DataArray.argsort
258272
DataArray.clip
259273
DataArray.conj
@@ -277,6 +291,13 @@
277291
core.accessor_dt.DatetimeAccessor.days_in_month
278292
core.accessor_dt.DatetimeAccessor.daysinmonth
279293
core.accessor_dt.DatetimeAccessor.hour
294+
core.accessor_dt.DatetimeAccessor.is_leap_year
295+
core.accessor_dt.DatetimeAccessor.is_month_end
296+
core.accessor_dt.DatetimeAccessor.is_month_start
297+
core.accessor_dt.DatetimeAccessor.is_quarter_end
298+
core.accessor_dt.DatetimeAccessor.is_quarter_start
299+
core.accessor_dt.DatetimeAccessor.is_year_end
300+
core.accessor_dt.DatetimeAccessor.is_year_start
280301
core.accessor_dt.DatetimeAccessor.microsecond
281302
core.accessor_dt.DatetimeAccessor.minute
282303
core.accessor_dt.DatetimeAccessor.month
@@ -291,6 +312,14 @@
291312
core.accessor_dt.DatetimeAccessor.weekofyear
292313
core.accessor_dt.DatetimeAccessor.year
293314

315+
core.accessor_dt.TimedeltaAccessor.ceil
316+
core.accessor_dt.TimedeltaAccessor.floor
317+
core.accessor_dt.TimedeltaAccessor.round
318+
core.accessor_dt.TimedeltaAccessor.days
319+
core.accessor_dt.TimedeltaAccessor.microseconds
320+
core.accessor_dt.TimedeltaAccessor.nanoseconds
321+
core.accessor_dt.TimedeltaAccessor.seconds
322+
294323
core.accessor_str.StringAccessor.capitalize
295324
core.accessor_str.StringAccessor.center
296325
core.accessor_str.StringAccessor.contains
@@ -365,6 +394,7 @@
365394
Variable.min
366395
Variable.no_conflicts
367396
Variable.notnull
397+
Variable.pad
368398
Variable.prod
369399
Variable.quantile
370400
Variable.rank
@@ -407,6 +437,8 @@
407437

408438
IndexVariable.all
409439
IndexVariable.any
440+
IndexVariable.argmax
441+
IndexVariable.argmin
410442
IndexVariable.argsort
411443
IndexVariable.astype
412444
IndexVariable.broadcast_equals
@@ -436,6 +468,7 @@
436468
IndexVariable.min
437469
IndexVariable.no_conflicts
438470
IndexVariable.notnull
471+
IndexVariable.pad
439472
IndexVariable.prod
440473
IndexVariable.quantile
441474
IndexVariable.rank
@@ -538,6 +571,16 @@
538571
ufuncs.tanh
539572
ufuncs.trunc
540573

574+
plot.plot
575+
plot.line
576+
plot.step
577+
plot.hist
578+
plot.contour
579+
plot.contourf
580+
plot.imshow
581+
plot.pcolormesh
582+
plot.scatter
583+
541584
plot.FacetGrid.map_dataarray
542585
plot.FacetGrid.set_titles
543586
plot.FacetGrid.set_ticks
@@ -547,11 +590,16 @@
547590
CFTimeIndex.any
548591
CFTimeIndex.append
549592
CFTimeIndex.argsort
593+
CFTimeIndex.argmax
594+
CFTimeIndex.argmin
550595
CFTimeIndex.asof
551596
CFTimeIndex.asof_locs
552597
CFTimeIndex.astype
598+
CFTimeIndex.calendar
599+
CFTimeIndex.ceil
553600
CFTimeIndex.contains
554601
CFTimeIndex.copy
602+
CFTimeIndex.days_in_month
555603
CFTimeIndex.delete
556604
CFTimeIndex.difference
557605
CFTimeIndex.drop
@@ -562,6 +610,7 @@
562610
CFTimeIndex.equals
563611
CFTimeIndex.factorize
564612
CFTimeIndex.fillna
613+
CFTimeIndex.floor
565614
CFTimeIndex.format
566615
CFTimeIndex.get_indexer
567616
CFTimeIndex.get_indexer_for
@@ -602,6 +651,7 @@
602651
CFTimeIndex.reindex
603652
CFTimeIndex.rename
604653
CFTimeIndex.repeat
654+
CFTimeIndex.round
605655
CFTimeIndex.searchsorted
606656
CFTimeIndex.set_names
607657
CFTimeIndex.set_value
@@ -688,15 +738,20 @@
688738
backends.NetCDF4DataStore.is_remote
689739
backends.NetCDF4DataStore.lock
690740

741+
backends.H5NetCDFStore.autoclose
691742
backends.H5NetCDFStore.close
692743
backends.H5NetCDFStore.encode
693744
backends.H5NetCDFStore.encode_attribute
694745
backends.H5NetCDFStore.encode_variable
746+
backends.H5NetCDFStore.format
695747
backends.H5NetCDFStore.get_attrs
696748
backends.H5NetCDFStore.get_dimensions
697749
backends.H5NetCDFStore.get_encoding
698750
backends.H5NetCDFStore.get_variables
751+
backends.H5NetCDFStore.is_remote
699752
backends.H5NetCDFStore.load
753+
backends.H5NetCDFStore.lock
754+
backends.H5NetCDFStore.open
700755
backends.H5NetCDFStore.open_store_variable
701756
backends.H5NetCDFStore.prepare_variable
702757
backends.H5NetCDFStore.set_attribute

doc/combining.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,6 @@ in this manner.
244244
Combining along multiple dimensions
245245
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
246246

247-
.. note::
248-
249-
There are currently three combining functions with similar names:
250-
:py:func:`~xarray.auto_combine`, :py:func:`~xarray.combine_by_coords`, and
251-
:py:func:`~xarray.combine_nested`. This is because
252-
``auto_combine`` is in the process of being deprecated in favour of the other
253-
two functions, which are more general. If your code currently relies on
254-
``auto_combine``, then you will be able to get similar functionality by using
255-
``combine_nested``.
256-
257247
For combining many objects along multiple dimensions xarray provides
258248
:py:func:`~xarray.combine_nested` and :py:func:`~xarray.combine_by_coords`. These
259249
functions use a combination of ``concat`` and ``merge`` across different

doc/conf.py

Lines changed: 66 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,58 @@
100100
autosummary_generate = True
101101
autodoc_typehints = "none"
102102

103-
napoleon_use_param = True
103+
napoleon_use_param = False
104104
napoleon_use_rtype = True
105+
napoleon_preprocess_types = True
106+
napoleon_type_aliases = {
107+
# general terms
108+
"sequence": ":term:`sequence`",
109+
"iterable": ":term:`iterable`",
110+
"callable": ":py:func:`callable`",
111+
"dict_like": ":term:`dict-like <mapping>`",
112+
"dict-like": ":term:`dict-like <mapping>`",
113+
"mapping": ":term:`mapping`",
114+
"file-like": ":term:`file-like <file-like object>`",
115+
# special terms
116+
# "same type as caller": "*same type as caller*", # does not work, yet
117+
# "same type as values": "*same type as values*", # does not work, yet
118+
# stdlib type aliases
119+
"MutableMapping": "~collections.abc.MutableMapping",
120+
"sys.stdout": ":obj:`sys.stdout`",
121+
"timedelta": "~datetime.timedelta",
122+
"string": ":class:`string <str>`",
123+
# numpy terms
124+
"array_like": ":term:`array_like`",
125+
"array-like": ":term:`array-like <array_like>`",
126+
"scalar": ":term:`scalar`",
127+
"array": ":term:`array`",
128+
"hashable": ":term:`hashable <name>`",
129+
# matplotlib terms
130+
"color-like": ":py:func:`color-like <matplotlib.colors.is_color_like>`",
131+
"matplotlib colormap name": ":doc:matplotlib colormap name <Colormap reference>",
132+
"matplotlib axes object": ":py:class:`matplotlib axes object <matplotlib.axes.Axes>`",
133+
"colormap": ":py:class:`colormap <matplotlib.colors.Colormap>`",
134+
# objects without namespace
135+
"DataArray": "~xarray.DataArray",
136+
"Dataset": "~xarray.Dataset",
137+
"Variable": "~xarray.Variable",
138+
"ndarray": "~numpy.ndarray",
139+
"MaskedArray": "~numpy.ma.MaskedArray",
140+
"dtype": "~numpy.dtype",
141+
"ComplexWarning": "~numpy.ComplexWarning",
142+
"Index": "~pandas.Index",
143+
"MultiIndex": "~pandas.MultiIndex",
144+
"CategoricalIndex": "~pandas.CategoricalIndex",
145+
"TimedeltaIndex": "~pandas.TimedeltaIndex",
146+
"DatetimeIndex": "~pandas.DatetimeIndex",
147+
"Series": "~pandas.Series",
148+
"DataFrame": "~pandas.DataFrame",
149+
"Categorical": "~pandas.Categorical",
150+
"Path": "~~pathlib.Path",
151+
# objects with abbreviated namespace (from pandas)
152+
"pd.Index": "~pandas.Index",
153+
"pd.NaT": "~pandas.NaT",
154+
}
105155

106156
numpydoc_class_members_toctree = True
107157
numpydoc_show_class_members = False
@@ -278,9 +328,9 @@
278328
# Grouping the document tree into LaTeX files. List of tuples
279329
# (source start file, target name, title,
280330
# author, documentclass [howto, manual, or own class]).
281-
latex_documents = [
282-
("index", "xarray.tex", "xarray Documentation", "xarray Developers", "manual")
283-
]
331+
# latex_documents = [
332+
# ("index", "xarray.tex", "xarray Documentation", "xarray Developers", "manual")
333+
# ]
284334

285335
# The name of an image file (relative to this directory) to place at the top of
286336
# the title page.
@@ -307,7 +357,7 @@
307357

308358
# One entry per manual page. List of tuples
309359
# (source start file, name, description, authors, manual section).
310-
man_pages = [("index", "xarray", "xarray Documentation", ["xarray Developers"], 1)]
360+
# man_pages = [("index", "xarray", "xarray Documentation", ["xarray Developers"], 1)]
311361

312362
# If true, show URL addresses after external links.
313363
# man_show_urls = False
@@ -318,17 +368,17 @@
318368
# Grouping the document tree into Texinfo files. List of tuples
319369
# (source start file, target name, title, author,
320370
# dir menu entry, description, category)
321-
texinfo_documents = [
322-
(
323-
"index",
324-
"xarray",
325-
"xarray Documentation",
326-
"xarray Developers",
327-
"xarray",
328-
"N-D labeled arrays and datasets in Python.",
329-
"Miscellaneous",
330-
)
331-
]
371+
# texinfo_documents = [
372+
# (
373+
# "index",
374+
# "xarray",
375+
# "xarray Documentation",
376+
# "xarray Developers",
377+
# "xarray",
378+
# "N-D labeled arrays and datasets in Python.",
379+
# "Miscellaneous",
380+
# )
381+
# ]
332382

333383
# Documents to append as an appendix to all manuals.
334384
# texinfo_appendices = []

doc/dask.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. currentmodule:: xarray
2+
13
.. _dask:
24

35
Parallel computing with Dask
@@ -90,7 +92,7 @@ use :py:func:`~xarray.open_mfdataset`::
9092
xr.open_mfdataset('my/files/*.nc', parallel=True)
9193

9294
This function will automatically concatenate and merge datasets into one in
93-
the simple cases that it understands (see :py:func:`~xarray.auto_combine`
95+
the simple cases that it understands (see :py:func:`~xarray.combine_by_coords`
9496
for the full disclaimer). By default, :py:meth:`~xarray.open_mfdataset` will chunk each
9597
netCDF file into a single Dask array; again, supply the ``chunks`` argument to
9698
control the size of the resulting Dask arrays. In more complex cases, you can

0 commit comments

Comments
 (0)