Skip to content

Commit a6a2bb1

Browse files
committed
Revert the change to csv filename and make it overwrite any existing file
Reverted commit 80e51e8 (cherry picked from commit cbd2474)
1 parent ab5c86a commit a6a2bb1

1 file changed

Lines changed: 3 additions & 29 deletions

File tree

src/everest/everest_storage.py

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,33 +1186,7 @@ def _sort_df(df: pl.DataFrame, index: list[str]) -> pl.DataFrame:
11861186
)
11871187

11881188
def export_everest_opt_results_to_csv(self) -> Path:
1189-
batches_with_data = ",".join(
1190-
{str(b.batch_id) for b in self.data.batches if b.has_data}
1191-
)
1192-
full_path = (
1193-
self._output_dir
1194-
/ f"experiment_results_batches::{','.join(batches_with_data)}.csv"
1195-
)
1196-
1197-
# Find old csv to delete
1198-
existing_csv = next(
1199-
(
1200-
Path(f)
1201-
for f in os.listdir(self._output_dir)
1202-
if f.startswith("experiment_results_batches::")
1203-
),
1204-
None,
1205-
)
1206-
1207-
if (
1208-
existing_csv is not None
1209-
and existing_csv.exists()
1210-
and (self._output_dir / existing_csv) != full_path
1211-
):
1212-
# New batches are added -> overwrite existing csv
1213-
os.remove(existing_csv)
1214-
1215-
if not os.path.exists(full_path):
1216-
combined_df, _, _ = self.export_dataframes()
1217-
combined_df.write_csv(full_path)
1189+
full_path = self._output_dir / "experiment_results.csv"
1190+
combined_df, _, _ = self.export_dataframes()
1191+
combined_df.write_csv(full_path)
12181192
return full_path

0 commit comments

Comments
 (0)