Skip to content

Commit

Permalink
Satisfy black and pylint.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsrabin committed Dec 2, 2024
1 parent 13cbf65 commit 9b71518
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions python/ctsm/crop_calendars/cropcal_figs_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from matplotlib import cm
import matplotlib.collections as mplcol

# pylint: disable=abstract-class-instantiated

# Colormaps (maps)
cropcal_colors = {
Expand Down
8 changes: 2 additions & 6 deletions python/ctsm/crop_calendars/cropcal_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,11 @@ def check_and_trim_years(year_1, year_n, ds_in):
year = utils.get_timestep_year(ds_in, ds_in.time.values[0])
if year > year_1:
raise RuntimeError(
f"Requested year_1 is {year_1} but first year in outputs is "
+ f"{year}"
f"Requested year_1 is {year_1} but first year in outputs is {year}"
)
year = utils.get_timestep_year(ds_in, ds_in.time.values[-1])
if year < year_1:
raise RuntimeError(
f"Requested year_n is {year_n} but last year in outputs is "
+ f"{year}"
)
raise RuntimeError(f"Requested year_n is {year_n} but last year in outputs is {year}")

# Remove years outside range of interest
### Include an extra year at the end to finish out final seasons.
Expand Down
6 changes: 3 additions & 3 deletions python/ctsm/crop_calendars/generate_gdds_functions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Functions to support generate_gdds.py
"""
# pylint: disable=too-many-lines,too-many-statements
# pylint: disable=too-many-lines,too-many-statements,abstract-class-instantiated
import warnings
import os
import glob
Expand Down Expand Up @@ -553,8 +553,8 @@ def import_and_process_1yr(
clm_gdd_var = "GDDACCUM"
my_vars = [clm_gdd_var, "GDDHARV"]
patterns = [f"*h2.{this_year-1}-01*.nc", f"*h2.{this_year-1}-01*.nc.base"]
for p in patterns:
pattern = os.path.join(indir, p)
for pat in patterns:
pattern = os.path.join(indir, pat)
h2_files = glob.glob(pattern)
if h2_files:
break
Expand Down

0 comments on commit 9b71518

Please sign in to comment.