From 52d69c18bf269823b4b7765e4af621c7b7069c24 Mon Sep 17 00:00:00 2001 From: James Adams Date: Tue, 17 Sep 2024 15:17:09 -0400 Subject: [PATCH] [558] removed superfluous string comparisons, replaced remaining periodicity checks from `is` to `==` --- src/climate_indices/indices.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/climate_indices/indices.py b/src/climate_indices/indices.py index 7e3b152a..a7f304c9 100644 --- a/src/climate_indices/indices.py +++ b/src/climate_indices/indices.py @@ -397,9 +397,9 @@ def percentage_of_normal( # if doing monthly then we'll use 12 periods, corresponding to calendar # months, if daily assume years w/366 days - if periodicity is compute.Periodicity.monthly: + if periodicity == compute.Periodicity.monthly: periodicity = 12 - elif periodicity is compute.Periodicity.daily: + elif periodicity == compute.Periodicity.daily: periodicity = 366 else: message = f"Invalid periodicity argument: '{periodicity}'"