Skip to content

Commit 0b9f216

Browse files
committed
fix doc-string indentation
1 parent d22994a commit 0b9f216

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

adaptive/learner/average2D.py

+37-37
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,48 @@
66
import numpy as np
77

88
from adaptive.learner.learner2D import Learner2D
9-
from adaptive.learner.average_mixin import add_average_mixin
9+
from adaptive.learner.average_mixin import add_average_mixin, DataPoint
1010

1111

1212
@add_average_mixin
1313
class AverageLearner2D(Learner2D):
14-
def __init__(self, function, bounds, weight=1, loss_per_triangle=None):
15-
"""Same as 'Learner2D', only the differences are in the doc-string.
16-
17-
Parameters
18-
----------
19-
function : callable
20-
The function to learn. Must take a tuple of a tuple of two real
21-
parameters and a seed and return a real number.
22-
So ((x, y), seed) → float, e.g.:
23-
>>> def f(xy_seed):
24-
... (x, y), seed = xy_seed
25-
... random.seed(xy_seed)
26-
... return x * y + random.uniform(-0.5, 0.5)
27-
weight : float, int, default 1
28-
When `weight > 1` adding more points to existing points will be
29-
prioritized (making the standard error of a point more imporant,)
30-
otherwise adding new triangles will be prioritized (making the
31-
loss of a triangle more important.)
32-
33-
Attributes
34-
----------
35-
min_values_per_point : int, default 3
36-
Minimum amount of values per point. This means that the
37-
standard error of a point is infinity until there are
38-
'min_values_per_point' for a point.
39-
40-
Methods
41-
-------
42-
mean_values_per_point : callable
43-
Returns the average numbers of values per (x, y) value.
44-
45-
Notes
46-
-----
47-
The total loss of the learner is still only determined by the
48-
max loss of the triangles.
49-
"""
14+
"""Same as 'Learner2D', only the differences are in the doc-string.
15+
16+
Parameters
17+
----------
18+
function : callable
19+
The function to learn. Must take a tuple of a tuple of two real
20+
parameters and a seed and return a real number.
21+
So ((x, y), seed) → float, e.g.:
22+
>>> def f(xy_seed):
23+
... (x, y), seed = xy_seed
24+
... random.seed(xy_seed)
25+
... return x * y + random.uniform(-0.5, 0.5)
26+
weight : float, int, default 1
27+
When `weight > 1` adding more points to existing points will be
28+
prioritized (making the standard error of a point more imporant,)
29+
otherwise adding new triangles will be prioritized (making the
30+
loss of a triangle more important.)
31+
32+
Attributes
33+
----------
34+
min_values_per_point : int, default 3
35+
Minimum amount of values per point. This means that the
36+
standard error of a point is infinity until there are
37+
'min_values_per_point' for a point.
38+
39+
Methods
40+
-------
41+
mean_values_per_point : callable
42+
Returns the average numbers of values per (x, y) value.
43+
44+
Notes
45+
-----
46+
The total loss of the learner is still only determined by the
47+
max loss of the triangles.
48+
"""
5049

50+
def __init__(self, function, bounds, weight=1, loss_per_triangle=None):
5151
super().__init__(function, bounds, loss_per_triangle)
5252
self._data = dict() # {point: {seed: value}} mapping
5353
self.pending_points = dict() # {point: {seed}}

0 commit comments

Comments
 (0)