Skip to content

Commit 25009bf

Browse files
authored
Merge pull request #201 from bertinia/master
add check for trailing "/" in XML variables
2 parents d1d9aae + 239d446 commit 25009bf

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

diag_utils/diag_utils/diagUtilsLib.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,12 @@ def checkHistoryFiles(tseries, dout_s_root, case, rstart_year, rstop_year, comp,
200200
"""
201201
if tseries.upper() in ['T','TRUE'] :
202202
htype = 'series'
203-
## in_dir = '{0}/{1}/proc/tseries/month_1'.format(dout_s_root, comp)
204203
else :
205204
htype = 'slice'
206-
## in_dir = '{0}/{1}/hist'.format(dout_s_root, comp)
207205

206+
# make sure subdir does not include a trailing "/"
207+
if subdir.endswith('/'):
208+
subdir = subdir[:-1]
208209
in_dir = '{0}/{1}/{2}'.format(dout_s_root, comp, subdir)
209210

210211
# check the in_dir directory exists

diagnostics/diagnostics/atm/atm_avg_generator.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,12 @@ def initialize_envDict(envDict, caseroot, debugMsg, standalone):
417417
if envDict['plot_SON_climo']:
418418
envDict['seas'].append('SON')
419419

420+
if envDict['test_path_history_subdir'].endswith('/'):
421+
envDict['test_path_history_subdir'] = envDict['test_path_history_subdir'][:-1]
422+
423+
if envDict['cntl_path_history_subdir'].endswith('/'):
424+
envDict['cntl_path_history_subdir'] = envDict['cntl_path_history_subdir'][:-1]
425+
420426
return envDict
421427

422428
#======

diagnostics/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
jinja2==2.7.3
1+
jinja2>=2.10
22
numpy>=1.8.1
33
ilamb>=2.1

0 commit comments

Comments
 (0)