Skip to content

Commit

Permalink
adding option to delete the mp edb subdirs
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensle committed Oct 15, 2024
1 parent 3fd7851 commit 23ba662
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions activitysim/core/steps/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ def _coalesce_estimation_data_bundles(state):
logger.info("Coalescing Estimation Data Bundles")

edb_dir = state.filesystem.get_output_dir("estimation_data_bundle")
estimation_settings = state.filesystem.read_model_settings(
"estimation.yaml", mandatory=False
)

lowest_dirs = find_lowest_level_directories(edb_dir)

Expand Down Expand Up @@ -314,8 +317,6 @@ def _coalesce_estimation_data_bundles(state):

for i, file in enumerate(os.listdir(dir)):

if "stop_frequency" in file:
print("debugging")
# get the file path
file_path = os.path.join(dir, file)

Expand Down Expand Up @@ -356,7 +357,8 @@ def _coalesce_estimation_data_bundles(state):
df_concat_dict[file] = [df]

# delete the directory now that we have gone through all the files
# shutil.rmtree(dir)
if estimation_settings.get("DELETE_MP_SUBDIRS", True):
shutil.rmtree(dir)

# need to concatenate the last set of dataframes
concat_and_write_edb(df_concat_dict, cur_edb)
Expand Down

0 comments on commit 23ba662

Please sign in to comment.