Skip to content

Commit

Permalink
Iterate over summary_csv, fix warning, and convert strings to lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
TarekAbouChakra committed Nov 27, 2023
1 parent 521f021 commit 14b87ae
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/neps/status/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ def _get_dataframes_from_summary(
config_data_pending.append(config_pending)

# Creating the dataframe for previous config results.
df_previous = pd.DataFrame({"Config_id": indices_prev})
df_previous["Status"] = "Complete"
df_previous = pd.DataFrame({"config_id": indices_prev})
df_previous["status"] = "complete"
df_previous = pd.concat(
[df_previous, pd.json_normalize(config_data_prev).add_prefix("config.")], axis=1
)
Expand All @@ -220,8 +220,8 @@ def _get_dataframes_from_summary(
)

# Creating dataframe for pending configs.
df_pending = pd.DataFrame({"Config_id": indices_pending})
df_pending["Status"] = "Pending"
df_pending = pd.DataFrame({"config_id": indices_pending})
df_pending["status"] = "pending"
df_pending = pd.concat(
[df_pending, pd.json_normalize(config_data_pending).add_prefix("config.")],
axis=1,
Expand Down Expand Up @@ -295,7 +295,7 @@ def _save_data_to_csv(
run_data_df.index == "num_evaluated_configs", "value"
]
# checks if the current worker has more evaluated configs than the previous
if int(num_evaluated_configs_csv) < int(num_evaluated_configs_run):
if int(num_evaluated_configs_csv) < num_evaluated_configs_run.iloc[0]:
config_data_df = config_data_df.sort_values(
by="result.loss", ascending=True
)
Expand Down Expand Up @@ -340,5 +340,6 @@ def post_run_csv(root_directory: str | Path, logger=None) -> None:
df_run_data,
)


def get_run_summary_csv(root_directory: str | Path):
post_run_csv(root_directory=root_directory)
post_run_csv(root_directory=root_directory)

0 comments on commit 14b87ae

Please sign in to comment.