Skip to content

Conversation

@esantorella
Copy link
Contributor

Summary:
Context:

Experiment.lookup_data_for_trial looks up a single trial's data, and Experiment.lookup_data has an argument trial_indices. Previously, it was somewhat useful to have both becauase it was faster to look up data for a single trial than to filter that trial's data from the full DataFrame, but this is no longer the case now that data is represented as a single data frame rather than a dict of DataFrames. So Experiment.lookup_data_for_trial is not adding value.

This PR:

  • Removes Experiment.lookup_data_for_trial and updates call sites

Reviewed By: saitcakmak

Differential Revision: D89811675

@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jan 2, 2026
@meta-codesync
Copy link

meta-codesync bot commented Jan 2, 2026

@esantorella has exported this pull request. If you are a Meta employee, you can view the originating Diff in D89811675.

@codecov-commenter
Copy link

codecov-commenter commented Jan 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.72%. Comparing base (4d8537b) to head (dcb8164).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4733   +/-   ##
=======================================
  Coverage   96.72%   96.72%           
=======================================
  Files         582      582           
  Lines       60710    60675   -35     
=======================================
- Hits        58721    58689   -32     
+ Misses       1989     1986    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

esantorella added a commit to esantorella/Ax that referenced this pull request Jan 2, 2026
Summary:

**Context**:

`Experiment.lookup_data_for_trial` looks up a single trial's data, and `Experiment.lookup_data` has an argument `trial_indices`. Previously, it was somewhat useful to have both becauase it was faster to look up data for a single trial than to filter that trial's data from the full DataFrame, but this is no longer the case now that data is represented as a single data frame rather than a dict of DataFrames. So `Experiment.lookup_data_for_trial` is not adding value.

**This PR**:
* Removes `Experiment.lookup_data_for_trial` and updates call sites

Reviewed By: saitcakmak

Differential Revision: D89811675
Summary:

**Context**: This diff exists to split up a more complex change. The next diff, D86452716, will remove `Experiment`'s attribute `_data_by_trial` and give it an attribute `Data`. That is quite a complex change; in addition to the changes on `Experiment`, it requires storage changes and updating many callsites. As a first step, this diff gives `Experiment` a property `data` (which will become an attribute in D86452716) and updates call sites. It should not be landed alone.

**Changes**:
* Gives `Experiment` a property `Data` that is equivalent to `.lookup_data()`
* Updates many call sites to reference `data` rather than `_data_by_trial`

Reviewed By: saitcakmak

Differential Revision: D87004539
Summary:

This diff gets rid of `Experiment._data_by_trial: dict[int, OrderedDict[int, Data]]` and replaces it with `Experiment.data: Data`

**Changes**:
* `Experiment` has a `data` attribute and does not have a `_data_by_trial` attribute. I did not hide this attribute since I think it is fine to update `Experiment.data`
* Attaching data now is simpler
* Reference `data.trial_indices` instead of `_data_by_trial.keys()`
* Serialization changes: Basically, everything eventually still becomes _data_by_trial the last step in serialization or the first step in deserialization. The db is not affected.

Reviewed By: saitcakmak

Differential Revision: D86452716
Summary:

**Context**:

`Experiment.lookup_data_for_trial` looks up a single trial's data, and `Experiment.lookup_data` has an argument `trial_indices`. Previously, it was somewhat useful to have both becauase it was faster to look up data for a single trial than to filter that trial's data from the full DataFrame, but this is no longer the case now that data is represented as a single data frame rather than a dict of DataFrames. So `Experiment.lookup_data_for_trial` is not adding value.

**This PR**:
* Removes `Experiment.lookup_data_for_trial` and updates call sites

Reviewed By: saitcakmak

Differential Revision: D89811675
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants