-
Notifications
You must be signed in to change notification settings - Fork 356
Remove Experiment.lookup_data_for_trial #4733
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
Open
esantorella
wants to merge
3
commits into
facebook:main
Choose a base branch
from
esantorella:export-D89811675
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+194
−275
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
@esantorella has exported this pull request. If you are a Meta employee, you can view the originating Diff in D89811675. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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
1fb8326 to
f4a2eae
Compare
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
f4a2eae to
dcb8164
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Context:
Experiment.lookup_data_for_triallooks up a single trial's data, andExperiment.lookup_datahas an argumenttrial_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. SoExperiment.lookup_data_for_trialis not adding value.This PR:
Experiment.lookup_data_for_trialand updates call sitesReviewed By: saitcakmak
Differential Revision: D89811675