Skip to content

Commit

Permalink
ran flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Ana Ordonez committed Oct 23, 2023
1 parent 014994a commit 524c22e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pcmdi_metrics/extremes/extremes_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
import glob
import json
import os
import sys

import xarray as xr
import xcdat

from pcmdi_metrics.extremes.lib import (
Expand All @@ -16,7 +14,6 @@
return_value,
utilities,
)
from pcmdi_metrics.io import xcdat_openxml

##########
# Set up
Expand Down Expand Up @@ -264,7 +261,7 @@
yrs = [str(int(ds.time.dt.year[0])), str(int(ds.time.dt.year[-1]))]

if ds.time.encoding["calendar"] != "noleap" and exclude_leap:
ds = self.ds.convert_calendar("noleap")
ds = ds.convert_calendar("noleap")

# This dict is going to hold results for just this run
stats_dict = {}
Expand Down Expand Up @@ -385,7 +382,7 @@
if varname in ["pr", "PRECT", "precip"]:
# Rename possible precipitation variable names for consistency
if varname in ["precip", "PRECT"]:
ds = ds.rename({variable: "pr"})
ds = ds.rename({varname: "pr"})
Rx1day, Rx5day = compute_metrics.precipitation_indices(
ds,
sftlf,
Expand Down Expand Up @@ -635,7 +632,7 @@
with open(fname, "r") as f:
tmp = json.load(f)
meta.update_provenance("environment", tmp["provenance"])
except:
except Exception:
# Skip provenance if there's an issue
print("Error: Could not get provenance from extremes json for output.json.")

Expand Down

0 comments on commit 524c22e

Please sign in to comment.