From cf07f27f8404607690a756cc2848e6f9f57ef38e Mon Sep 17 00:00:00 2001 From: Mohit Kambli Date: Sat, 21 Dec 2024 19:18:07 -0500 Subject: [PATCH] Fix #740: file_prefix argument is inconsistently implemented in fileio/ascii.py --- src/pyclaw/fileio/ascii.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pyclaw/fileio/ascii.py b/src/pyclaw/fileio/ascii.py index 7d979db9..39e3cb6e 100644 --- a/src/pyclaw/fileio/ascii.py +++ b/src/pyclaw/fileio/ascii.py @@ -50,7 +50,7 @@ def write(solution, frame, path, file_prefix='fort', write_aux=False, f.write("%s file_format\n" % "ascii") # Write fort.qxxxx file - file_name = 'fort.q%s' % str(frame).zfill(4) + file_name = '%s.q%s' % (file_prefix,str(frame).zfill(4)) with open(os.path.join(path,file_name),'w') as q_file: for state in solution.states: write_patch_header(q_file,state.patch) @@ -62,7 +62,7 @@ def write(solution, frame, path, file_prefix='fort', write_aux=False, # Write fort.auxxxxx file if required if solution.num_aux > 0 and write_aux: - file_name = 'fort.a%s' % str(frame).zfill(4) + file_name = '%s.a%s' % (file_prefix,str(frame).zfill(4)) with open(os.path.join(path,file_name),'w') as aux_file: for state in solution.states: write_patch_header(aux_file,state.patch)