From 7f39cc0d8c664e3fcf354536ed3a95882064b4b6 Mon Sep 17 00:00:00 2001 From: dcherian Date: Mon, 8 Nov 2021 12:39:00 -0700 Subject: [PATCH] Minor docstring improvements. --- xarray/core/_reductions.py | 176 +++++++++++++++++++++++++---- xarray/util/generate_reductions.py | 10 +- 2 files changed, 163 insertions(+), 23 deletions(-) diff --git a/xarray/core/_reductions.py b/xarray/core/_reductions.py index 1314b6877db..1d6d4f88970 100644 --- a/xarray/core/_reductions.py +++ b/xarray/core/_reductions.py @@ -63,6 +63,7 @@ def count( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``count`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -99,7 +100,8 @@ def count( See Also -------- numpy.count - Dataset.count + dask.array.count + DataArray.count :ref:`agg` User guide on reduction or aggregation operations. """ @@ -132,6 +134,7 @@ def all( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``all`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -168,7 +171,8 @@ def all( See Also -------- numpy.all - Dataset.all + dask.array.all + DataArray.all :ref:`agg` User guide on reduction or aggregation operations. """ @@ -201,6 +205,7 @@ def any( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``any`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -237,7 +242,8 @@ def any( See Also -------- numpy.any - Dataset.any + dask.array.any + DataArray.any :ref:`agg` User guide on reduction or aggregation operations. """ @@ -276,6 +282,7 @@ def max( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``max`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -320,7 +327,8 @@ def max( See Also -------- numpy.max - Dataset.max + dask.array.max + DataArray.max :ref:`agg` User guide on reduction or aggregation operations. """ @@ -360,6 +368,7 @@ def min( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``min`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -404,7 +413,8 @@ def min( See Also -------- numpy.min - Dataset.min + dask.array.min + DataArray.min :ref:`agg` User guide on reduction or aggregation operations. """ @@ -444,6 +454,7 @@ def mean( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``mean`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -488,7 +499,8 @@ def mean( See Also -------- numpy.mean - Dataset.mean + dask.array.mean + DataArray.mean :ref:`agg` User guide on reduction or aggregation operations. """ @@ -535,6 +547,7 @@ def prod( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``prod`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -587,7 +600,8 @@ def prod( See Also -------- numpy.prod - Dataset.prod + dask.array.prod + DataArray.prod :ref:`agg` User guide on reduction or aggregation operations. """ @@ -635,6 +649,7 @@ def sum( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``sum`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -687,7 +702,8 @@ def sum( See Also -------- numpy.sum - Dataset.sum + dask.array.sum + DataArray.sum :ref:`agg` User guide on reduction or aggregation operations. """ @@ -732,6 +748,7 @@ def std( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``std`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -784,7 +801,8 @@ def std( See Also -------- numpy.std - Dataset.std + dask.array.std + DataArray.std :ref:`agg` User guide on reduction or aggregation operations. """ @@ -829,6 +847,7 @@ def var( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``var`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -881,7 +900,8 @@ def var( See Also -------- numpy.var - Dataset.var + dask.array.var + DataArray.var :ref:`agg` User guide on reduction or aggregation operations. """ @@ -922,6 +942,7 @@ def median( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``median`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -966,7 +987,8 @@ def median( See Also -------- numpy.median - Dataset.median + dask.array.median + DataArray.median :ref:`agg` User guide on reduction or aggregation operations. """ @@ -1004,6 +1026,7 @@ def count( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``count`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -1035,7 +1058,8 @@ def count( See Also -------- numpy.count - DataArray.count + dask.array.count + Dataset.count :ref:`agg` User guide on reduction or aggregation operations. """ @@ -1067,6 +1091,7 @@ def all( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``all`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -1098,7 +1123,8 @@ def all( See Also -------- numpy.all - DataArray.all + dask.array.all + Dataset.all :ref:`agg` User guide on reduction or aggregation operations. """ @@ -1130,6 +1156,7 @@ def any( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``any`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -1161,7 +1188,8 @@ def any( See Also -------- numpy.any - DataArray.any + dask.array.any + Dataset.any :ref:`agg` User guide on reduction or aggregation operations. """ @@ -1199,6 +1227,7 @@ def max( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``max`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -1236,7 +1265,8 @@ def max( See Also -------- numpy.max - DataArray.max + dask.array.max + Dataset.max :ref:`agg` User guide on reduction or aggregation operations. """ @@ -1275,6 +1305,7 @@ def min( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``min`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -1312,7 +1343,8 @@ def min( See Also -------- numpy.min - DataArray.min + dask.array.min + Dataset.min :ref:`agg` User guide on reduction or aggregation operations. """ @@ -1351,6 +1383,7 @@ def mean( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``mean`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -1388,7 +1421,8 @@ def mean( See Also -------- numpy.mean - DataArray.mean + dask.array.mean + Dataset.mean :ref:`agg` User guide on reduction or aggregation operations. """ @@ -1434,6 +1468,7 @@ def prod( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``prod`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -1477,7 +1512,8 @@ def prod( See Also -------- numpy.prod - DataArray.prod + dask.array.prod + Dataset.prod :ref:`agg` User guide on reduction or aggregation operations. """ @@ -1524,6 +1560,7 @@ def sum( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``sum`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -1567,7 +1604,8 @@ def sum( See Also -------- numpy.sum - DataArray.sum + dask.array.sum + Dataset.sum :ref:`agg` User guide on reduction or aggregation operations. """ @@ -1611,6 +1649,7 @@ def std( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``std`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -1654,7 +1693,8 @@ def std( See Also -------- numpy.std - DataArray.std + dask.array.std + Dataset.std :ref:`agg` User guide on reduction or aggregation operations. """ @@ -1698,6 +1738,7 @@ def var( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``var`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -1741,7 +1782,8 @@ def var( See Also -------- numpy.var - DataArray.var + dask.array.var + Dataset.var :ref:`agg` User guide on reduction or aggregation operations. """ @@ -1781,6 +1823,7 @@ def median( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``median`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -1818,7 +1861,8 @@ def median( See Also -------- numpy.median - DataArray.median + dask.array.median + Dataset.median :ref:`agg` User guide on reduction or aggregation operations. """ @@ -1855,6 +1899,7 @@ def count( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``count`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -1893,6 +1938,7 @@ def count( See Also -------- numpy.count + dask.array.count Dataset.count :ref:`groupby` User guide on groupby operations. @@ -1926,6 +1972,7 @@ def all( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``all`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -1964,6 +2011,7 @@ def all( See Also -------- numpy.all + dask.array.all Dataset.all :ref:`groupby` User guide on groupby operations. @@ -1997,6 +2045,7 @@ def any( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``any`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -2035,6 +2084,7 @@ def any( See Also -------- numpy.any + dask.array.any Dataset.any :ref:`groupby` User guide on groupby operations. @@ -2074,6 +2124,7 @@ def max( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``max`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -2122,6 +2173,7 @@ def max( See Also -------- numpy.max + dask.array.max Dataset.max :ref:`groupby` User guide on groupby operations. @@ -2162,6 +2214,7 @@ def min( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``min`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -2210,6 +2263,7 @@ def min( See Also -------- numpy.min + dask.array.min Dataset.min :ref:`groupby` User guide on groupby operations. @@ -2250,6 +2304,7 @@ def mean( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``mean`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -2298,6 +2353,7 @@ def mean( See Also -------- numpy.mean + dask.array.mean Dataset.mean :ref:`groupby` User guide on groupby operations. @@ -2345,6 +2401,7 @@ def prod( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``prod`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -2403,6 +2460,7 @@ def prod( See Also -------- numpy.prod + dask.array.prod Dataset.prod :ref:`groupby` User guide on groupby operations. @@ -2451,6 +2509,7 @@ def sum( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``sum`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -2509,6 +2568,7 @@ def sum( See Also -------- numpy.sum + dask.array.sum Dataset.sum :ref:`groupby` User guide on groupby operations. @@ -2554,6 +2614,7 @@ def std( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``std`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -2612,6 +2673,7 @@ def std( See Also -------- numpy.std + dask.array.std Dataset.std :ref:`groupby` User guide on groupby operations. @@ -2657,6 +2719,7 @@ def var( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``var`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -2715,6 +2778,7 @@ def var( See Also -------- numpy.var + dask.array.var Dataset.var :ref:`groupby` User guide on groupby operations. @@ -2756,6 +2820,7 @@ def median( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``median`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -2804,6 +2869,7 @@ def median( See Also -------- numpy.median + dask.array.median Dataset.median :ref:`groupby` User guide on groupby operations. @@ -2842,6 +2908,7 @@ def count( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``count`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -2880,6 +2947,7 @@ def count( See Also -------- numpy.count + dask.array.count Dataset.count :ref:`resampling` User guide on resampling operations. @@ -2913,6 +2981,7 @@ def all( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``all`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -2951,6 +3020,7 @@ def all( See Also -------- numpy.all + dask.array.all Dataset.all :ref:`resampling` User guide on resampling operations. @@ -2984,6 +3054,7 @@ def any( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``any`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -3022,6 +3093,7 @@ def any( See Also -------- numpy.any + dask.array.any Dataset.any :ref:`resampling` User guide on resampling operations. @@ -3061,6 +3133,7 @@ def max( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``max`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -3109,6 +3182,7 @@ def max( See Also -------- numpy.max + dask.array.max Dataset.max :ref:`resampling` User guide on resampling operations. @@ -3149,6 +3223,7 @@ def min( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``min`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -3197,6 +3272,7 @@ def min( See Also -------- numpy.min + dask.array.min Dataset.min :ref:`resampling` User guide on resampling operations. @@ -3237,6 +3313,7 @@ def mean( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``mean`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -3285,6 +3362,7 @@ def mean( See Also -------- numpy.mean + dask.array.mean Dataset.mean :ref:`resampling` User guide on resampling operations. @@ -3332,6 +3410,7 @@ def prod( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``prod`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -3390,6 +3469,7 @@ def prod( See Also -------- numpy.prod + dask.array.prod Dataset.prod :ref:`resampling` User guide on resampling operations. @@ -3438,6 +3518,7 @@ def sum( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``sum`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -3496,6 +3577,7 @@ def sum( See Also -------- numpy.sum + dask.array.sum Dataset.sum :ref:`resampling` User guide on resampling operations. @@ -3541,6 +3623,7 @@ def std( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``std`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -3599,6 +3682,7 @@ def std( See Also -------- numpy.std + dask.array.std Dataset.std :ref:`resampling` User guide on resampling operations. @@ -3644,6 +3728,7 @@ def var( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``var`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -3702,6 +3787,7 @@ def var( See Also -------- numpy.var + dask.array.var Dataset.var :ref:`resampling` User guide on resampling operations. @@ -3743,6 +3829,7 @@ def median( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``median`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -3791,6 +3878,7 @@ def median( See Also -------- numpy.median + dask.array.median Dataset.median :ref:`resampling` User guide on resampling operations. @@ -3829,6 +3917,7 @@ def count( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``count`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -3862,6 +3951,7 @@ def count( See Also -------- numpy.count + dask.array.count DataArray.count :ref:`groupby` User guide on groupby operations. @@ -3894,6 +3984,7 @@ def all( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``all`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -3927,6 +4018,7 @@ def all( See Also -------- numpy.all + dask.array.all DataArray.all :ref:`groupby` User guide on groupby operations. @@ -3959,6 +4051,7 @@ def any( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``any`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -3992,6 +4085,7 @@ def any( See Also -------- numpy.any + dask.array.any DataArray.any :ref:`groupby` User guide on groupby operations. @@ -4030,6 +4124,7 @@ def max( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``max`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -4071,6 +4166,7 @@ def max( See Also -------- numpy.max + dask.array.max DataArray.max :ref:`groupby` User guide on groupby operations. @@ -4110,6 +4206,7 @@ def min( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``min`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -4151,6 +4248,7 @@ def min( See Also -------- numpy.min + dask.array.min DataArray.min :ref:`groupby` User guide on groupby operations. @@ -4190,6 +4288,7 @@ def mean( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``mean`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -4231,6 +4330,7 @@ def mean( See Also -------- numpy.mean + dask.array.mean DataArray.mean :ref:`groupby` User guide on groupby operations. @@ -4277,6 +4377,7 @@ def prod( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``prod`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -4326,6 +4427,7 @@ def prod( See Also -------- numpy.prod + dask.array.prod DataArray.prod :ref:`groupby` User guide on groupby operations. @@ -4373,6 +4475,7 @@ def sum( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``sum`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -4422,6 +4525,7 @@ def sum( See Also -------- numpy.sum + dask.array.sum DataArray.sum :ref:`groupby` User guide on groupby operations. @@ -4466,6 +4570,7 @@ def std( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``std`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -4515,6 +4620,7 @@ def std( See Also -------- numpy.std + dask.array.std DataArray.std :ref:`groupby` User guide on groupby operations. @@ -4559,6 +4665,7 @@ def var( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``var`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -4608,6 +4715,7 @@ def var( See Also -------- numpy.var + dask.array.var DataArray.var :ref:`groupby` User guide on groupby operations. @@ -4648,6 +4756,7 @@ def median( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``median`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -4689,6 +4798,7 @@ def median( See Also -------- numpy.median + dask.array.median DataArray.median :ref:`groupby` User guide on groupby operations. @@ -4726,6 +4836,7 @@ def count( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``count`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -4759,6 +4870,7 @@ def count( See Also -------- numpy.count + dask.array.count DataArray.count :ref:`resampling` User guide on resampling operations. @@ -4791,6 +4903,7 @@ def all( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``all`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -4824,6 +4937,7 @@ def all( See Also -------- numpy.all + dask.array.all DataArray.all :ref:`resampling` User guide on resampling operations. @@ -4856,6 +4970,7 @@ def any( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``any`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -4889,6 +5004,7 @@ def any( See Also -------- numpy.any + dask.array.any DataArray.any :ref:`resampling` User guide on resampling operations. @@ -4927,6 +5043,7 @@ def max( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``max`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -4968,6 +5085,7 @@ def max( See Also -------- numpy.max + dask.array.max DataArray.max :ref:`resampling` User guide on resampling operations. @@ -5007,6 +5125,7 @@ def min( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``min`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -5048,6 +5167,7 @@ def min( See Also -------- numpy.min + dask.array.min DataArray.min :ref:`resampling` User guide on resampling operations. @@ -5087,6 +5207,7 @@ def mean( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``mean`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -5128,6 +5249,7 @@ def mean( See Also -------- numpy.mean + dask.array.mean DataArray.mean :ref:`resampling` User guide on resampling operations. @@ -5174,6 +5296,7 @@ def prod( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``prod`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -5223,6 +5346,7 @@ def prod( See Also -------- numpy.prod + dask.array.prod DataArray.prod :ref:`resampling` User guide on resampling operations. @@ -5270,6 +5394,7 @@ def sum( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``sum`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -5319,6 +5444,7 @@ def sum( See Also -------- numpy.sum + dask.array.sum DataArray.sum :ref:`resampling` User guide on resampling operations. @@ -5363,6 +5489,7 @@ def std( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``std`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -5412,6 +5539,7 @@ def std( See Also -------- numpy.std + dask.array.std DataArray.std :ref:`resampling` User guide on resampling operations. @@ -5456,6 +5584,7 @@ def var( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``var`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -5505,6 +5634,7 @@ def var( See Also -------- numpy.var + dask.array.var DataArray.var :ref:`resampling` User guide on resampling operations. @@ -5545,6 +5675,7 @@ def median( **kwargs : dict Additional keyword arguments passed on to the appropriate array function for calculating ``median`` on this object's data. + These could include dask-specific kwargs like ``split_every``. Returns ------- @@ -5586,6 +5717,7 @@ def median( See Also -------- numpy.median + dask.array.median DataArray.median :ref:`resampling` User guide on resampling operations. diff --git a/xarray/util/generate_reductions.py b/xarray/util/generate_reductions.py index 69d1c7db529..f35f7d99847 100644 --- a/xarray/util/generate_reductions.py +++ b/xarray/util/generate_reductions.py @@ -76,7 +76,7 @@ def {method}( -------- numpy.{method} dask.array.{method} - {obj}.{method} + {see_also_obj}.{method} :ref:`{docref}` User guide on {docref_description}. """''' @@ -181,6 +181,7 @@ def __init__( docref, docref_description, example_call_preamble, + see_also_obj=None, ): self.datastructure = datastructure self.cls = cls @@ -189,6 +190,10 @@ def __init__( self.docref_description = docref_description self.example_call_preamble = example_call_preamble self.preamble = CLASS_PREAMBLE.format(obj=datastructure.name, cls=cls) + if not see_also_obj: + self.see_also_obj = self.datastructure.name + else: + self.see_also_obj = see_also_obj def generate_methods(self): yield [self.preamble] @@ -227,6 +232,7 @@ def generate_method(self, method): **template_kwargs, docref=self.docref, docref_description=self.docref_description, + see_also_obj=self.see_also_obj, ) yield self.generate_code(method) @@ -319,6 +325,7 @@ class DataStructure: docref="agg", docref_description="reduction or aggregation operations", example_call_preamble="", + see_also_obj="DataArray", ) DataArrayGenerator = ClassReductionGenerator( cls="", @@ -327,6 +334,7 @@ class DataStructure: docref="agg", docref_description="reduction or aggregation operations", example_call_preamble="", + see_also_obj="Dataset", ) DataArrayGroupByGenerator = ClassReductionGenerator(