Skip to content

Commit 1c15998

Browse files
committed
Add include_components to the Args section of the firm docstring
1 parent bf519c5 commit 1c15998

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

src/scores/categorical/multicategorical_impl.py

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ def firm( # pylint: disable=too-many-arguments
7676
threshold_assignment: Specifies whether the intervals defining the categories are
7777
left or right closed. That is whether the decision threshold is included in
7878
the upper (left closed) or lower (right closed) category. Defaults to "lower".
79+
include_components: If True, then the function returns the FIRM score
80+
along with the overforecast and underforecast penalties as a new dimension
81+
called "components". If False (default), then only the FIRM score is returned.
7982
8083
Returns:
8184
An xarray object with the FIRM score. If `include_components` is true, then
@@ -293,14 +296,14 @@ def seeps( # pylint: disable=too-many-arguments, too-many-locals
293296
performance of a forecast across three categories:
294297
295298
- Dry weather (e.g., less than or equal to 0.2mm),
296-
- Light precipitation (the climatological lower two-thirds of
299+
- Light precipitation (the climatological lower two-thirds of
297300
rainfall conditioned on it raining),
298-
- Heavy precipitation (the climatological upper one-third of rainfall
301+
- Heavy precipitation (the climatological upper one-third of rainfall
299302
conditioned on it raining).
300303
301304
The SEEPS penalty matrix is defined as
302305
303-
306+
304307
.. math::
305308
s = \frac{1}{2} \left(
306309
\begin{matrix}
@@ -310,45 +313,45 @@ def seeps( # pylint: disable=too-many-arguments, too-many-locals
310313
\end{matrix}
311314
\right)
312315
313-
314-
where
316+
317+
where
315318
- :math:`p_1` is the climatological probability of the dry weather category,
316319
- :math:`p_3` is the climatological probability of the heavy precipitation category,
317320
- The rows correspond to the forecast category (dry, light, heavy),
318321
- The columns correspond to the observation category (dry, light, heavy),
319-
322+
320323
as defined in Eq 15 in Rodwell et al. (2010).
321324
322325
Let :math:`p_2` denote the climatological probability of light precipitation occuring.
323326
Note that since :math:`p_2 = 2p_3` and :math:`p_1 + p_2 + p_3 = 1`, then :math:`p_3 = (1 - p_1) / 3`
324327
can be substituted into the penalty matrix. In this implementation, the user only provides
325-
:math:`p_1` with the ``prob_dry`` arg and the function calculates :math:`p_3` internally.
326-
Additionally, this implementation of the score is negatively oriented, meaning that
327-
lower scores are better.
328-
328+
:math:`p_1` with the ``prob_dry`` arg and the function calculates :math:`p_3` internally.
329+
Additionally, this implementation of the score is negatively oriented, meaning that
330+
lower scores are better.
331+
329332
Sometimes in the literature, a positively oriented version of SEEPS is used,
330333
which is defined as :math:`1 - \mathrm{SEEPS}`.
331334
332-
By default, the scores are only calculated for points where :math:`p_1 \in [0.1, 0.85]`
335+
By default, the scores are only calculated for points where :math:`p_1 \in [0.1, 0.85]`
333336
as per Rodwell et al. (2010). This can be changed by setting ``mask_clim_extremes`` to ``False`` or
334337
by changing the ``lower_masked_value`` and ``upper_masked_value`` parameters.
335338
336339
Args:
337340
fcst: An array of real-valued forecasts (e.g., precipitation forecasts in mm).
338341
obs: An array of real-valued observations (e.g., precipitation forecasts in mm).
339-
prob_dry: The climatological probability of the dry weather category. This is
342+
prob_dry: The climatological probability of the dry weather category. This is
340343
called :math:`p_1` in the SEEPS penalty matrix. Must be in the range [0, 1].
341-
light_heavy_threshold: An array of the rainfall thresholds (e.g., in mm) that separates
344+
light_heavy_threshold: An array of the rainfall thresholds (e.g., in mm) that separates
342345
light and heavy precipitation. The threshold itself is included in the light
343346
precipitation category.
344347
dry_light_threshold: The threshold (e.g., in mm) that separates dry weather from light precipitation.
345348
Defaults to 0.2. Dry weather is defined as less than or equal to this threshold.
346349
mask_clim_extremes: If True, mask out the score at points where
347350
:math:`p_1` is less than ``lower_masked_value`` or greater than ``upper_masked_value``.
348351
Instead a NaN is returned at these points. Defaults to True.
349-
lower_masked_value: The SEEPS score is masked at points where ``prob_dry`` is
352+
lower_masked_value: The SEEPS score is masked at points where ``prob_dry`` is
350353
less than this value. Defaults to 0.1.
351-
upper_masked_value: The SEEPS score is masked at points where ``prob_dry`` is
354+
upper_masked_value: The SEEPS score is masked at points where ``prob_dry`` is
352355
greater than this value. Defaults to 0.85.
353356
reduce_dims: Optionally specify which dimensions to reduce when
354357
calculating the SEEPS score. All other dimensions will be preserved. As a
@@ -374,11 +377,11 @@ def seeps( # pylint: disable=too-many-arguments, too-many-locals
374377
375378
Warning:
376379
This function raises a warning if any values in `prob_dry` are exactly equal to 0 or 1.
377-
380+
378381
References:
379-
Rodwell, M. J., Richardson, D. S., Hewson, T. D., & Haiden, T. (2010).
380-
A new equitable score suitable for verifying precipitation in numerical
381-
weather prediction. Quarterly Journal of the Royal Meteorological Society,
382+
Rodwell, M. J., Richardson, D. S., Hewson, T. D., & Haiden, T. (2010).
383+
A new equitable score suitable for verifying precipitation in numerical
384+
weather prediction. Quarterly Journal of the Royal Meteorological Society,
382385
136(650), 1344–1363. https://doi.org/10.1002/qj.656
383386
384387
Examples:

0 commit comments

Comments
 (0)