Skip to content

Commit

Permalink
Fixup everest api
Browse files Browse the repository at this point in the history
  • Loading branch information
yngve-sk committed Jan 6, 2025
1 parent 2473c4e commit e4cb4c0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
11 changes: 9 additions & 2 deletions src/everest/api/everest_data_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,18 @@ def single_objective_values(self):
polars.col(o["objective_name"]) * o["weight"] * o["normalization"]
)

columns = [
"batch",
"objective",
"accepted",
*self._ever_storage.data.objective_functions["objective_name"].to_list(),
]

return (
batch_datas.rename(
{"total_objective_value": "objective", "batch_id": "batch"}
)
.select("batch", "objective", "accepted")
.select(columns)
.to_dicts()
)

Expand All @@ -163,7 +170,7 @@ def gradient_values(self):
all_batch_data = [
b.batch_objective_gradient
for b in self._ever_storage.data.batches
if b.batch_objective_gradient is not None
if b.batch_objective_gradient is not None and b.is_improvement
]
if not all_batch_data:
return []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,27 +103,27 @@
},
{
"batch": 0,
"function": "distance_p",
"control": "point_y",
"value": 0.98866227
"function": "distance_q",
"control": "point_x",
"value": -3.00456477
},
{
"batch": 0,
"function": "distance_p",
"control": "point_z",
"value": 1.00465235
"control": "point_y",
"value": 0.98866227
},
{
"batch": 0,
"function": "distance_q",
"control": "point_x",
"value": -3.00456477
"control": "point_y",
"value": -3.011388
},
{
"batch": 0,
"function": "distance_q",
"control": "point_y",
"value": -3.011388
"function": "distance_p",
"control": "point_z",
"value": 1.00465235
},
{
"batch": 0,
Expand Down

0 comments on commit e4cb4c0

Please sign in to comment.