@@ -94,7 +94,7 @@ def to_dict(self) -> Dict:
94
94
}
95
95
96
96
if hasattr (self , "_ax_trial_id" ):
97
- trial_dict ["ax_trial_id" ] = self ._ax_trial_id
97
+ trial_dict ["ax_trial_id" ] = self .ax_trial_id
98
98
99
99
return trial_dict
100
100
@@ -123,6 +123,7 @@ def from_dict(
123
123
Additional parameters needed to identify or carry out the trial, and
124
124
which will be included in the optimization history.
125
125
"""
126
+
126
127
# Prepare values of the input parameters
127
128
parameter_values = [trial_dict [var .name ] for var in varying_parameters ]
128
129
# Prepare evaluations
@@ -152,6 +153,7 @@ def from_dict(
152
153
trial ._status = trial_dict ["_status" ]
153
154
for custom_param in custom_parameters :
154
155
setattr (trial , custom_param .name , trial_dict [custom_param .name ])
156
+
155
157
return trial
156
158
157
159
@property
@@ -202,6 +204,15 @@ def index(self) -> int:
202
204
def index (self , value ):
203
205
self ._index = value
204
206
207
+ @property
208
+ def ax_trial_id (self ) -> int :
209
+ """Get the index of the trial."""
210
+ return self ._ax_trial_id
211
+
212
+ @ax_trial_id .setter
213
+ def ax_trial_id (self , value ):
214
+ self ._ax_trial_id = value
215
+
205
216
@property
206
217
def ignored (self ) -> bool :
207
218
"""Get whether the trial is ignored by the generator."""
0 commit comments