Ax
Ax copied to clipboard
Replace `_data_by_trial` with `Data` on Experiment
Summary:
This diff gets rid of Experiment._data_by_trial: dict[int, OrderedDict[int, Data]] and replaces it with Experiment.data: Data
Changes:
Experimenthas adataattribute and does not have a_data_by_trialattribute. I did not hide this attribute since I think it is fine to updateExperiment.data** Attaching data now is simpler- Added property
data.trial_indicessince there were many checks for_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.
** Note that
add_experiment_idgets some more substantive changes since there is now oneDatarather than 1+Datafor each trial.
Migration off _data_by_trial:
~~* To keep tests passing and relevant, I added a property _data_by_trial.~~
~~* But a subsequent diff should take this out and update the tests to reference Data instead~~
- I initially added
_data_by_trialas a property. This is quite dangerous since whileexperiment._data_by_trialcannot be set,experiment._data_by_trial[0][0] = ...is allowed and could mislead people into thinking they are updating the data on the trial._data_by_trialought to be removed.
Differential Revision: D86452716
@esantorella has exported this pull request. If you are a Meta employee, you can view the originating Diff in D86452716.