Skip to content

Commit

Permalink
[558] removed superfluous string comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
monocongo committed Sep 17, 2024
1 parent 42c67c2 commit 7f6941a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/climate_indices/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'")
Expand Down

0 comments on commit 7f6941a

Please sign in to comment.