Skip to content

Commit

Permalink
Pull diag_location into for-loop
Browse files Browse the repository at this point in the history
Make sure all the plot location directories are made.
  • Loading branch information
justin-richling committed Jun 13, 2024
1 parent e1c8cde commit c197514
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/adf_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,19 @@ def __init__(self, config_file, debug=False):

#Set the final directory name and save it to plot_location:
direc_name = f"{case_name}_vs_{data_name}"
self.__plot_location.append(os.path.join(plot_dir, direc_name))
plot_loc = os.path.join(plot_dir, direc_name)
self.__plot_location.append(plot_loc)

#If first iteration, then save directory name for use by baseline:
if case_idx == 0:
first_case_dir = direc_name
#End if

#Go ahead and make the diag plot location if it doesn't exist already
diag_location = Path(plot_loc)
if not diag_location.is_dir():
print(f"\t {diag_location} not found, making new directory")
diag_location.mkdir(parents=True)
#End for

self.__syears = syears_fixed
Expand All @@ -436,11 +442,6 @@ def __init__(self, config_file, debug=False):
self.__plot_location.append(os.path.join(plot_dir, first_case_dir))
#End if

#Go ahead and make the diag plot location if it doesn't exist already
diag_location = Path(self.__plot_location[0])
if not diag_location.is_dir():
print(f"\t {diag_location} not found, making new directory")
diag_location.mkdir(parents=True)
#-------------------------------------------------------------------------

#Initialize "num_procs" variable:
Expand Down

0 comments on commit c197514

Please sign in to comment.