Skip to content

Commit

Permalink
ux: Provide a log message indicating summary data has been generated (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiebergman authored Aug 6, 2024
1 parent 150dc4a commit 8e788ec
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
14 changes: 13 additions & 1 deletion neps/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,19 @@ def run(

if settings.post_run_summary:
assert settings.root_directory is not None
post_run_csv(settings.root_directory)
config_data_path, run_data_path = post_run_csv(settings.root_directory)
logger.info(
"The post run summary has been created, which is a csv file with the "
"output of all data in the run."
f"\nYou can find a csv of all the configuratins at: {config_data_path}."
f"\nYou can find a csv of results at: {run_data_path}."
)
else:
logger.info(
"Skipping the creation of the post run summary, which is a csv file with the "
" output of all data in the run."
"\nSet `post_run_summary=True` to enable it."
)


def _run_args(
Expand Down
8 changes: 7 additions & 1 deletion neps/status/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,18 @@ def _save_data_to_csv(
raise RuntimeError(f"Error during data saving: {e}") from e


def post_run_csv(root_directory: str | Path) -> None:
def post_run_csv(root_directory: str | Path) -> tuple[Path, Path]:
"""Create CSV files summarizing the run data.
Args:
root_directory: The root directory of the NePS run.
Returns:
The paths to the configuration data CSV and the run data CSV.
"""
csv_config_data, csv_rundata, csv_locker = _initiate_summary_csv(root_directory)
csv_config_data = Path(csv_config_data).absolute().resolve()
csv_rundata = Path(csv_rundata).absolute().resolve()

df_config_data, df_run_data = _get_dataframes_from_summary(
root_directory,
Expand All @@ -369,6 +374,7 @@ def post_run_csv(root_directory: str | Path) -> None:
df_config_data,
df_run_data,
)
return csv_config_data, csv_rundata


# TODO(eddiebergman): This function name is misleading as it doesn't get anything.
Expand Down

0 comments on commit 8e788ec

Please sign in to comment.