File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,15 +173,17 @@ def data(self) -> SearchHistory:
173173 SearchHistory
174174 The data object with the following attributes and methods:
175175
176- Attributes:
176+ Attributes
177+ ----------
177178 - ``history``: list[dict] - all recorded evaluations
178179 - ``n_trials``: int - total number of trials
179180 - ``n_runs``: int - number of optimization runs
180181 - ``best_trial``: dict | None - trial with highest score
181182 - ``best_score``: float | None - highest score
182183 - ``best_params``: dict | None - parameters of best trial
183184
184- Methods:
185+ Methods
186+ -------
185187 - ``get_run(run_id)``: get trials from specific run
186188 - ``clear()``: reset all data
187189 - ``new_run()``: signal start of new run (call before each run)
Original file line number Diff line number Diff line change @@ -47,14 +47,16 @@ def record(
4747 eval_time : float
4848 Evaluation time in seconds.
4949 """
50- self ._trials .append ({
51- "iteration" : len (self ._trials ),
52- "run_id" : self ._current_run_id ,
53- "params" : dict (params ),
54- "score" : float (score ),
55- "metadata" : dict (metadata ) if metadata else {},
56- "eval_time" : float (eval_time ),
57- })
50+ self ._trials .append (
51+ {
52+ "iteration" : len (self ._trials ),
53+ "run_id" : self ._current_run_id ,
54+ "params" : dict (params ),
55+ "score" : float (score ),
56+ "metadata" : dict (metadata ) if metadata else {},
57+ "eval_time" : float (eval_time ),
58+ }
59+ )
5860
5961 def new_run (self ) -> None :
6062 """Signal the start of a new optimization run.
Original file line number Diff line number Diff line change 22
33# copyright: hyperactive developers, MIT License (see LICENSE file)
44
5- import pytest
6-
75from hyperactive .base import SearchHistory
86
97
You can’t perform that action at this time.
0 commit comments