From cb25820744bc97e1f955c85dfbba4ec62f98b2fe Mon Sep 17 00:00:00 2001 From: Mats Veldhuizen Date: Tue, 30 Jul 2024 14:34:06 +0200 Subject: [PATCH] Add links to dataset documentation everywhere --- pysteps/tests/helpers.py | 1 + pysteps/utils/conversion.py | 9 ++++++--- pysteps/utils/dimension.py | 16 ++++++++++------ pysteps/utils/transformation.py | 12 ++++++++---- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/pysteps/tests/helpers.py b/pysteps/tests/helpers.py index 39b57a7be..24c58f8d1 100644 --- a/pysteps/tests/helpers.py +++ b/pysteps/tests/helpers.py @@ -125,6 +125,7 @@ def get_precipitation_fields( Returns ------- dataset: xarray.Dataset + As described in the documentation of :py:mod:`pysteps.io.importers`. """ if source == "bom": diff --git a/pysteps/utils/conversion.py b/pysteps/utils/conversion.py index f716709cf..2ea6a3a12 100644 --- a/pysteps/utils/conversion.py +++ b/pysteps/utils/conversion.py @@ -71,7 +71,8 @@ def to_rainrate(dataset: xr.Dataset, zr_a=None, zr_b=None): Parameters ---------- dataset: xarray.Dataset - Dataset to be (back-)transformed. + Dataset to be (back-)transformed as described in the documentation of + :py:mod:`pysteps.io.importers`. Additionally, in case of conversion to/from reflectivity units, the zr_a and zr_b attributes are also required, @@ -160,7 +161,8 @@ def to_raindepth(dataset: xr.Dataset, zr_a=None, zr_b=None): Parameters ---------- dataset: xarray.Dataset - Dataset to be (back-)transformed. + Dataset to be (back-)transformed as described in the documentation of + :py:mod:`pysteps.io.importers`. Additionally, in case of conversion to/from reflectivity units, the zr_a and zr_b attributes are also required, @@ -249,7 +251,8 @@ def to_reflectivity(dataset: xr.Dataset, zr_a=None, zr_b=None): Parameters ---------- dataset: xarray.Dataset - Dataset to be (back-)transformed. + Dataset to be (back-)transformed as described in the documentation of + :py:mod:`pysteps.io.importers`. Additionally, in case of conversion to/from reflectivity units, the zr_a and zr_b attributes are also required, diff --git a/pysteps/utils/dimension.py b/pysteps/utils/dimension.py index eaeb925ac..efa459610 100644 --- a/pysteps/utils/dimension.py +++ b/pysteps/utils/dimension.py @@ -39,8 +39,8 @@ def aggregate_fields_time( Parameters ---------- dataset: xarray.Dataset - Dataset containing - a time series of (ensemble) input fields. + Dataset containing a time series of (ensemble) input fields + as described in the documentation of :py:mod:`pysteps.io.importers`. They must be evenly spaced in time. time_window_min: float or None The length in minutes of the time window that is used to @@ -112,7 +112,8 @@ def aggregate_fields_space( ---------- dataset: xarray.Dataset Dataset containing a single field or - a time series of (ensemble) input fields. + a time series of (ensemble) input fields as described in the documentation of + :py:mod:`pysteps.io.importers`. space_window: float, tuple or None The length of the space window that is used to upscale the fields. If a float is given, the same window size is used for the x- and @@ -182,7 +183,8 @@ def aggregate_fields( Parameters ---------- dataset: xarray.Dataset - Dataset containing the input fields. + Dataset containing the input fields as described in the documentation of + :py:mod:`pysteps.io.importers`. window_size: int or array-like of ints The length of the window that is used to aggregate the fields. If a single integer value is given, the same window is used for @@ -273,7 +275,8 @@ def clip_domain(dataset: xr.Dataset, extent=None): Parameters ---------- dataset: xarray.Dataset - Dataset containing the input fields. + Dataset containing the input fields as described in the documentation of + :py:mod:`pysteps.io.importers`. extent: scalars (left, right, bottom, top), optional The extent of the bounding box in data coordinates to be used to clip the data. @@ -325,7 +328,8 @@ def square_domain(dataset: xr.Dataset, method="pad", inverse=False): Parameters ---------- dataset: xarray.Dataset - Dataset containing the input fields. + Dataset containing the input fields as described in the documentation of + :py:mod:`pysteps.io.importers`. method: {'pad', 'crop'}, optional Either pad or crop. If pad, an equal number of zeros is added to both ends of its shortest diff --git a/pysteps/utils/transformation.py b/pysteps/utils/transformation.py index fc55635fa..3e48fe0d8 100644 --- a/pysteps/utils/transformation.py +++ b/pysteps/utils/transformation.py @@ -42,7 +42,8 @@ def boxcox_transform( Parameters ---------- dataset: xarray.Dataset - Dataset to be transformed. + Dataset to be transformed as described in the documentation of + :py:mod:`pysteps.io.importers`. Lambda: float, optional Parameter Lambda of the Box-Cox transformation. It is 0 by default, which produces the log transformation. @@ -147,7 +148,8 @@ def dB_transform( Parameters ---------- dataset: xarray.Dataset - Dataset to be (back-)transformed. + Dataset to be (back-)transformed as described in the documentation of + :py:mod:`pysteps.io.importers`. threshold: float, optional Optional value that is used for thresholding with the same units as in the dataset. If None, the threshold contained in metadata is used. @@ -224,7 +226,8 @@ def NQ_transform(dataset: xr.Dataset, inverse: bool = False, **kwargs) -> xr.Dat Parameters ---------- dataset: xarray.Dataset - Dataset to be transformed. + Dataset to be transformed as described in the documentation of + :py:mod:`pysteps.io.importers`. inverse: bool, optional If set to True, it performs the inverse transform. False by default. @@ -310,7 +313,8 @@ def sqrt_transform(dataset: xr.Dataset, inverse: bool = False, **kwargs) -> xr.D Parameters ---------- dataset: xarray.Dataset - Dataset to be transformed. + Dataset to be transformed as described in the documentation of + :py:mod:`pysteps.io.importers`. inverse: bool, optional If set to True, it performs the inverse transform. False by default.