Skip to content

Commit

Permalink
Merge branch 'master' into yaml_config_space
Browse files Browse the repository at this point in the history
  • Loading branch information
danrgll committed Nov 27, 2023
2 parents 505519b + 132454f commit 2ac8118
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 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)
4 changes: 2 additions & 2 deletions tests/test_metahyper/test_locking.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from more_itertools import first_true


def launch_example_processes(n_workers: int=3) -> list:
def launch_example_processes(n_workers: int = 3) -> list:
processes = []
for _ in range(n_workers):
processes.append(
Expand Down Expand Up @@ -90,7 +90,7 @@ def test_summary_csv():

config_data_df = pd.read_csv(summary_dir / "config_data.csv")
assert config_data_df.shape[0] == 15
assert (config_data_df["Status"] == "Complete").all()
assert (config_data_df["status"] == "complete").all()
except Exception as e:
raise e
finally:
Expand Down

0 comments on commit 2ac8118

Please sign in to comment.