File tree Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
12
12
### Changed
13
13
14
+ - Expand user home path '~ ' in remap python scripts
14
15
- Moved from ` f2py2 ` to ` f2py3 ` to enable removal of Python 2 support
15
16
16
17
### Fixed
Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ def copy_merra2(self):
256
256
def ask_catch_questions ():
257
257
catch_input_shared_rst_dir = ''
258
258
def has_rs_rc_out (path ):
259
+ path = os .path .abspath (os .path .expanduser (path ))
259
260
if os .path .exists (path ):
260
261
dirs = os .listdir (path )
261
262
if 'rs' in dirs and 'rc_out' in dirs :
@@ -391,6 +392,7 @@ def has_catch_rst(text):
391
392
dd = answers ['input:shared:yyyymmddhh' ][6 :8 ]
392
393
hh = answers ['input:shared:yyyymmddhh' ][8 :10 ]
393
394
395
+ answers ['input:shared:rst_dir' ] = os .path .abspath (os .path .expanduser (answers ['input:shared:rst_dir' ]))
394
396
rst_dir = answers ['input:shared:rst_dir' ]+ '/rs/ens0000/Y' + yyyy + '/M' + mm + '/'
395
397
rst_file = glob .glob (rst_dir + '*catch*_internal_rst.' + yyyy + mm + dd + '_' + hh + '00' )[0 ]
396
398
idx1 = rst_file .find ('catch' )
@@ -411,7 +413,7 @@ def has_catch_rst(text):
411
413
answers ['output:surface:remap_catch' ] = True
412
414
bc_base = answers ['output:shared:bc_base' ].split (": " )[- 1 ]
413
415
answers ['output:shared:bc_base' ] = bc_base
414
- answers ['output:shared:out_dir' ] = os .path .abspath (answers ['output:shared:out_dir' ])
416
+ answers ['output:shared:out_dir' ] = os .path .abspath (os . path . expanduser ( answers ['output:shared:out_dir' ]) )
415
417
416
418
if answers ['output:surface:EASE_grid' ] == 'Cubed-Sphere' :
417
419
remove_ogrid_comment (answers , 'OUT' )
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ def get_answers_from_command_line(cml):
94
94
answers ["input:shared:MERRA-2" ] = cml .merra2
95
95
answers ["input:shared:GEOS-IT" ] = cml .geosit
96
96
answers ["input:shared:yyyymmddhh" ] = cml .ymdh
97
- answers ["output:shared:out_dir" ] = os .path .abspath (cml .out_dir + '/' )
97
+ answers ["output:shared:out_dir" ] = os .path .abspath (os . path . expanduser ( cml .out_dir ) )
98
98
if cml .merra2 :
99
99
init_merra2 (answers )
100
100
elif cml .geosit :
@@ -105,7 +105,7 @@ def get_answers_from_command_line(cml):
105
105
answers ["input:shared:bc_version" ] = cml .bcvin
106
106
answers ["input:surface:catch_model" ]= cml .catch_model
107
107
answers ["input:shared:stretch" ] = cml .in_stretch
108
- answers ["input:shared:rst_dir" ] = os .path .abspath (cml .rst_dir + '/' )
108
+ answers ["input:shared:rst_dir" ] = os .path .abspath (os . path . expanduser ( cml .rst_dir ) )
109
109
fvcore_info (answers )
110
110
ogrid = cml .oceanin
111
111
if ogrid == "CS" :
Original file line number Diff line number Diff line change @@ -456,8 +456,8 @@ def ask_questions():
456
456
},
457
457
]
458
458
answers = questionary .prompt (questions )
459
- answers ['input:shared:rst_dir' ] = os .path .abspath (answers ['input:shared:rst_dir' ])
460
- answers ['output:shared:out_dir' ] = os .path .abspath (answers ['output:shared:out_dir' ])
459
+ answers ['input:shared:rst_dir' ] = os .path .abspath (os . path . expanduser ( answers ['input:shared:rst_dir' ]) )
460
+ answers ['output:shared:out_dir' ] = os .path .abspath (os . path . expanduser ( answers ['output:shared:out_dir' ]) )
461
461
462
462
if answers .get ('input:air:nlevel' ) : del answers ['input:air:nlevel' ]
463
463
if answers ["output:surface:remap" ] and not answers ["input:shared:MERRA-2" ] and not answers ["input:shared:GEOS-IT" ]:
You can’t perform that action at this time.
0 commit comments