From 7f6941a807b28b20b355e3f3f76dd3665f606c58 Mon Sep 17 00:00:00 2001 From: James Adams Date: Tue, 17 Sep 2024 15:08:23 -0400 Subject: [PATCH] [558] removed superfluous string comparisons --- src/climate_indices/indices.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/climate_indices/indices.py b/src/climate_indices/indices.py index 6ee393e8..7e3b152a 100644 --- a/src/climate_indices/indices.py +++ b/src/climate_indices/indices.py @@ -138,9 +138,9 @@ def spi( values = compute.sum_to_scale(values, scale) # reshape precipitation values to (years, 12) for monthly, or to (years, 366) for daily - if (periodicity == compute.Periodicity.monthly) or (periodicity == "monthly"): - values = utils.reshape_to_2d(values, 12) - elif (periodicity == compute.Periodicity.daily) or (periodicity == "daily"): + if periodicity == compute.Periodicity.monthly: + values = utils.reshape_to_2d(values, 12) + elif periodicity == compute.Periodicity.daily: values = utils.reshape_to_2d(values, 366) else: raise ValueError(f"Invalid periodicity argument: '{periodicity}'")