Skip to content

Commit a7d67e1

Browse files
committed
polishing fixed file copy code
1 parent a446914 commit a7d67e1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bin/MarsFiles.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -992,17 +992,17 @@ def split_files(file_list, split_dim):
992992

993993
if split_dim in ('time', 'areo'):
994994
time_dim = (np.squeeze(fNcdf.variables['time'][:]))[indices]
995-
print(f"time_dim = {time_dim}")
995+
print(f"time_dim = {time_dim}\n")
996996

997997
try:
998998
org_fixed_file = (os.path.normpath(os.path.join(fpath, f"{original_date}.fixed.nc")))
999999
new_fixed_file = (os.path.normpath(os.path.join(fpath, f"{int(time_dim[0]):05d}.fixed.nc")))
10001000
shutil.copyfile(org_fixed_file, new_fixed_file)
1001-
print(f"File '{org_fixed_file}' copied to '{new_fixed_file}'.")
1001+
print(f"File {original_date}.fixed.nc copied to {int(time_dim[0]):05d}.fixed.nc.\n")
10021002
except FileNotFoundError:
1003-
print(f"{Red}No compatible fixed file for {fname} was found in {fpath}{Nclr}")
1003+
print(f"{Red}No compatible fixed file for {fname} (e.g., {original_date}.fixed.nc) was found in {fpath}{Nclr}\n")
10041004
except Exception as e:
1005-
print(f"{Red}An error occurred: {e}")
1005+
print(f"{Red}An error occurred: {e}\n")
10061006

10071007
if split_dim == 'time':
10081008
if len(np.atleast_1d(bounds)) < 2:

0 commit comments

Comments
 (0)