@@ -53,7 +53,6 @@ def ext_old_to_new(
53
53
inifieldfile : PathOrStr = None ,
54
54
structurefile : PathOrStr = None ,
55
55
backup : bool = False ,
56
- postfix : str = "" ,
57
56
) -> Union [Tuple [ExtOldModel , FileModel , FileModel , FileModel ], None ]:
58
57
"""
59
58
Convert old external forcing file to new format files.
@@ -66,7 +65,6 @@ def ext_old_to_new(
66
65
structurefile (PathOrStr, optional): Path to the structure file.
67
66
backup (bool, optional): Create a backup of each file that will be
68
67
overwritten.
69
- postfix (str, optional): Append POSTFIX to the output filenames. Defaults to "".
70
68
71
69
Returns:
72
70
Tuple[ExtOldModel, ExtModel, IniFieldModel, StructureModel]:
@@ -174,12 +172,9 @@ def ext_old_to_new_from_mdu(
174
172
175
173
workdir = fmmodel ._resolved_filepath .parent
176
174
os .chdir (workdir )
177
- if fmmodel .external_forcing .extforcefile is None :
178
- if _verbose :
179
- print (
180
- f"mdufile: { mdufile } does not contain an old style external forcing file"
181
- )
182
- return
175
+ if fmmodel .external_forcing .extforcefile is None and _verbose :
176
+ print (f"mdufile: { mdufile } does not contain an old style external forcing file" )
177
+ return
183
178
# Input file:
184
179
extoldfile = fmmodel .external_forcing .extforcefile ._resolved_filepath
185
180
# Output files:
@@ -201,7 +196,7 @@ def ext_old_to_new_from_mdu(
201
196
202
197
# The actual conversion:
203
198
extold_model , ext_model , inifield_model , structure_model = ext_old_to_new (
204
- extoldfile , extfile , inifieldfile , structurefile , backup , postfix
199
+ extoldfile , extfile , inifieldfile , structurefile , backup
205
200
)
206
201
try :
207
202
# And include the new files in the FM model:
@@ -325,9 +320,9 @@ def main(args=None):
325
320
args .mdufile , ** outfiles , backup = backup , postfix = args .postfix
326
321
)
327
322
elif args .extoldfile is not None :
328
- ext_old_to_new (args .extoldfile , ** outfiles , backup = backup , postfix = args . postfix )
323
+ ext_old_to_new (args .extoldfile , ** outfiles , backup = backup )
329
324
elif args .dir is not None :
330
- ext_old_to_new_dir_recursive (args .dir , backup = backup , postfix = args . postfix )
325
+ ext_old_to_new_dir_recursive (args .dir , backup = backup )
331
326
else :
332
327
print ("Error: no input specified. Use one of --mdufile, --extoldfile or --dir." )
333
328
0 commit comments