From d9ecd9ea60ed695548a0030560c3bc43ceaf9cd2 Mon Sep 17 00:00:00 2001 From: Ana Ordonez Date: Mon, 23 Oct 2023 09:51:24 -0700 Subject: [PATCH] ran flake8 --- pcmdi_metrics/extremes/lib/compute_metrics.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pcmdi_metrics/extremes/lib/compute_metrics.py b/pcmdi_metrics/extremes/lib/compute_metrics.py index 45a2a2a64..438266217 100644 --- a/pcmdi_metrics/extremes/lib/compute_metrics.py +++ b/pcmdi_metrics/extremes/lib/compute_metrics.py @@ -1,12 +1,8 @@ #!/usr/bin/env python import datetime -import math -import os -import sys import cftime import numpy as np -import pandas as pd import xarray as xr import xcdat as xc @@ -83,7 +79,7 @@ def annual_stats(self, stat, pentad=False): # Returns: # ds_ann: Dataset containing annual max or min grid - if pentad == True: + if pentad: if self.pentad is None: self.calc_5day_mean() ds = self.pentad @@ -145,7 +141,7 @@ def seasonal_stats(self, season, stat, pentad=False): year_range = self.TSD.year_range - if pentad == True: + if pentad: if self.pentad is None: self.calc_5day_mean() ds = self.pentad @@ -414,8 +410,6 @@ def precipitation_indices( P5day["ANN"].where(P5day["ANN"] > 0, 0).where(~np.isnan(P5day["ANN"]), np.nan) ) for season in ["DJF", "MAM", "JJA", "SON"]: - if season == "DJF": - tmp = S.seasonal_stats(season, "max", pentad=True) P5day[season] = S.seasonal_stats(season, "max", pentad=True) P5day[season] = ( P5day[season]