Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace usage of exp_to_df with Experiment.to_df #3279

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ax/modelbridge/tests/test_torch_moo_modelbridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
infer_objective_thresholds,
pareto_frontier_evaluator,
)
from ax.service.utils.report_utils import exp_to_df
from ax.utils.common.random import set_rng_seed
from ax.utils.common.testutils import TestCase
from ax.utils.testing.core_stubs import (
Expand Down Expand Up @@ -546,7 +545,7 @@ def test_infer_objective_thresholds(self, _, cuda: bool = False) -> None:
self.assertEqual(obj_thresholds[1].op, ComparisonOp.LEQ)
self.assertFalse(obj_thresholds[0].relative)
self.assertFalse(obj_thresholds[1].relative)
df = exp_to_df(exp)
df = exp.to_df()
Y = np.stack([df.branin_a.values, df.branin_b.values]).T
Y = torch.from_numpy(Y)
Y[:, 0] *= -1
Expand Down Expand Up @@ -616,7 +615,7 @@ def test_infer_objective_thresholds(self, _, cuda: bool = False) -> None:
self.assertEqual(obj_thresholds[1].op, ComparisonOp.LEQ)
self.assertFalse(obj_thresholds[0].relative)
self.assertFalse(obj_thresholds[1].relative)
df = exp_to_df(exp)
df = exp.to_df()
trial_mask = df.trial_index == 1
Y = np.stack([df.branin_a.values[trial_mask], df.branin_b.values[trial_mask]]).T
Y = torch.from_numpy(Y)
Expand Down
3 changes: 1 addition & 2 deletions ax/service/ax_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
InstantiationBase,
ObjectiveProperties,
)
from ax.service.utils.report_utils import exp_to_df
from ax.service.utils.with_db_settings_base import DBSettings
from ax.storage.json_store.decoder import (
generation_strategy_from_json,
Expand Down Expand Up @@ -920,7 +919,7 @@ def get_trials_data_frame(self) -> pd.DataFrame:
one-arm trials, which is the case in base ``AxClient``; will correspond
to arms in trials in the batch-trial case).
"""
return exp_to_df(exp=self.experiment)
return self.experiment.to_df()

def get_max_parallelism(self) -> list[tuple[int, int]]:
"""Retrieves maximum number of trials that can be scheduled in parallel
Expand Down
Loading