Skip to content

Commit 7a37803

Browse files
committed
black reformatting
1 parent 48f7a0e commit 7a37803

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

adaptive/learner/skopt_learner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self, function, **kwargs):
3131
super().__init__(**kwargs)
3232

3333
def tell(self, x, y, fit=True):
34-
if hasattr(x, '__iter__'):
34+
if hasattr(x, "__iter__"):
3535
self.pending_points.discard(tuple(x))
3636
self.data[tuple(x)] = y
3737
super().tell(x, y, fit)

adaptive/tests/test_skopt_learner.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,15 @@ def test_skopt_learner_4D_runs():
3535
"""
3636

3737
def g(x, noise_level=0.1):
38-
return np.sin(5 * (x[0] + x[1] + x[2] + x[3])) * (
39-
1 - np.tanh(x[0] ** 2 + x[1] ** 2 + x[2] ** 2 + x[3] ** 2)
40-
) + np.random.randn() * noise_level
41-
42-
learner = SKOptLearner(g, dimensions=[(-2.0, 2.0), (-2.0, 2.0),
43-
(-2.0, 2.0), (-2.0, 2.0)])
38+
return (
39+
np.sin(5 * (x[0] + x[1] + x[2] + x[3]))
40+
* (1 - np.tanh(x[0] ** 2 + x[1] ** 2 + x[2] ** 2 + x[3] ** 2))
41+
+ np.random.randn() * noise_level
42+
)
43+
44+
learner = SKOptLearner(
45+
g, dimensions=[(-2.0, 2.0), (-2.0, 2.0), (-2.0, 2.0), (-2.0, 2.0)]
46+
)
4447

4548
for _ in range(11):
4649
(x,), _ = learner.ask(1)

0 commit comments

Comments
 (0)