Skip to content

Commit fc82791

Browse files
committed
fix linter errors
1 parent 86f254d commit fc82791

3 files changed

Lines changed: 14 additions & 12 deletions

File tree

src/hyperactive/base/_experiment.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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)

src/hyperactive/base/_history.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff 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.

src/hyperactive/base/tests/test_history.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
# copyright: hyperactive developers, MIT License (see LICENSE file)
44

5-
import pytest
6-
75
from hyperactive.base import SearchHistory
86

97

0 commit comments

Comments
 (0)