File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,6 @@ def __init__(
68
68
)
69
69
self ._ignored = False
70
70
self ._ignored_reason = None
71
-
72
71
# Add custom parameters as trial attributes.
73
72
for param in self ._custom_parameters :
74
73
setattr (self , param .name , None )
@@ -93,6 +92,10 @@ def to_dict(self) -> Dict:
93
92
"_ignored_reason" : self ._ignored_reason ,
94
93
"_status" : self ._status ,
95
94
}
95
+
96
+ if hasattr (self , "_ax_trial_id" ):
97
+ trial_dict ["ax_trial_id" ] = self ._ax_trial_id
98
+
96
99
return trial_dict
97
100
98
101
@classmethod
@@ -139,6 +142,8 @@ def from_dict(
139
142
)
140
143
if "_id" in trial_dict :
141
144
trial ._index = trial_dict ["_id" ]
145
+ if "ax_trial_id" in trial_dict :
146
+ trial ._ax_trial_id = trial_dict ["ax_trial_id" ]
142
147
if "_ignored" in trial_dict :
143
148
trial ._ignored = trial_dict ["_ignored" ]
144
149
if "_ignored_reason" in trial_dict :
Original file line number Diff line number Diff line change @@ -216,6 +216,8 @@ def ask_trials(self, n_trials: int) -> List[Trial]:
216
216
analyzed_parameters = self ._analyzed_parameters ,
217
217
custom_parameters = self ._custom_trial_parameters ,
218
218
)
219
+ if 'ax_trial_id' in point :
220
+ trial .ax_trial_id = point ['ax_trial_id' ]
219
221
gen_trials .append (trial )
220
222
# Keep only trials that have been given data.
221
223
for trial in gen_trials :
You can’t perform that action at this time.
0 commit comments