From 366b5e36e2b2f4b0a0d6433cf3aedf689bed05cd Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:57:47 -0500 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pascal Bourgault Co-authored-by: Éric Dupuis <71575674+coxipi@users.noreply.github.com> --- xclim/core/datachecks.py | 2 +- xclim/core/dataflags.py | 8 +++----- xclim/core/indicator.py | 4 ++-- xclim/core/missing.py | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/xclim/core/datachecks.py b/xclim/core/datachecks.py index 529369a6c..390965205 100644 --- a/xclim/core/datachecks.py +++ b/xclim/core/datachecks.py @@ -60,7 +60,7 @@ def check_freq( def check_daily(var: xr.DataArray) -> None: - """Raise an error if not series has a frequency other that daily, or is not monotonically increasing. + """Raise an error if series has a frequency other that daily, or is not monotonically increasing. Parameters ---------- diff --git a/xclim/core/dataflags.py b/xclim/core/dataflags.py index 82123ad8e..0c41217e5 100644 --- a/xclim/core/dataflags.py +++ b/xclim/core/dataflags.py @@ -236,8 +236,7 @@ def temperature_extremely_low( da : xarray.DataArray The DataArray of temperatures being examined. thresh : str - The threshold to search array for that will trigger flag if any day exceeds value. - Default is -90 degrees Celsius. + Threshold below which temperatures are considered problematic and a flag is raised. Default is -90 degrees Celsius. Returns ------- @@ -274,8 +273,7 @@ def temperature_extremely_high( da : xarray.DataArray The DatArray of temperature being examined. thresh : str - The threshold to search array for that will trigger flag if any day exceeds value. - Default is 60 degrees Celsius. + Threshold above which temperatures are considered problematic and a flag is raised. Default is 60 degrees Celsius. Returns ------- @@ -638,7 +636,7 @@ def data_flags( # noqa: C901 ... ) """ - def _get_variable_name(function, _kwargs): # + def _get_variable_name(function, _kwargs): format_args = {} _kwargs = _kwargs or {} for arg, param in signature(function).parameters.items(): diff --git a/xclim/core/indicator.py b/xclim/core/indicator.py index 33c6fb0bc..4259ba397 100644 --- a/xclim/core/indicator.py +++ b/xclim/core/indicator.py @@ -222,7 +222,7 @@ def update(self, other: dict) -> None: @classmethod def is_parameter_dict(cls, other: dict) -> bool: - """Return whether other can update a parameter dictionary. + """Return whether `other` can update a parameter dictionary. Parameters ---------- @@ -232,7 +232,7 @@ def is_parameter_dict(cls, other: dict) -> bool: Returns ------- bool - Whether other can update a parameter dictionary. + Whether `other` can update a parameter dictionary. """ # Passing compute_name is forbidden. # name is valid, but is handled by the indicator diff --git a/xclim/core/missing.py b/xclim/core/missing.py index ed3aa59dc..65ae8536f 100644 --- a/xclim/core/missing.py +++ b/xclim/core/missing.py @@ -109,7 +109,7 @@ def execute( indexer : dict Time attribute and values over which to subset the array. For example, use season='DJF' to select winter values, month=1 to select January, or month=[6,7,8] to select summer months. - If not indexer is given, all values are considered. + If no indexer is given, all values are considered. Returns -------