Skip to content

Commit

Permalink
Fixing a few minor code smells from last week.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielAdriaansen committed Apr 15, 2024
1 parent 6f74ea6 commit 7fc9b50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

# Add a Pandas date range to subset by season
time_units, reference_date = ds.time.attrs['units'].split('since')
if not time_units.strip() in ['D','days','Days','DAYS']:
if time_units.strip() not in ['D','days','Days','DAYS']:
print("ERROR: TIME UNITS EXPECTED TO BE DAYS IN tci_from_cesm.py")
sys.exit(1)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def get_season_start_end(s,refdate):
print("NUMBER OF DAYS AFTER FILTERING AT THIS SITE: %04d" % (alldays))

# Double check there's any valid data here
if not len(df) > 0:
if len(df) <= 0:
if DEBUG:
print("WARNING! NO DATA LEFT AFTER QC FILTERING.")
metdf.loc[metdf['sid']==stn,'qc'] = '-9999'
Expand All @@ -219,7 +219,7 @@ def get_season_start_end(s,refdate):
print("TOTAL DAYS FOR %s AT THIS SITE: %04d" % (season,len(df)))

# Double check there's any valid data here
if not len(df) > 0:
if len(df) <= 0:
if DEBUG:
print("WARNING! NO DATA FOR REQUESTED SEASON.")
metdf.loc[metdf['sid']==stn,'qc'] = '-9999'
Expand Down

0 comments on commit 7fc9b50

Please sign in to comment.