@@ -25,7 +25,6 @@ def uses_nth_neighbors(n: int):
2525
2626 Examples
2727 --------
28-
2928 The next function is a part of the `curvature_loss_function` function.
3029
3130 >>> @uses_nth_neighbors(1)
@@ -57,6 +56,7 @@ def uses_nth_neighbors(n: int):
5756 ... return loss * 100
5857 ...
5958 ... return loss
59+
6060 """
6161
6262 def _wrapped (loss_per_interval ):
@@ -88,6 +88,7 @@ class BaseLearner(abc.ABC):
8888 -----
8989 Subclasses may define a ``plot`` method that takes no parameters
9090 and returns a holoviews plot.
91+
9192 """
9293
9394 data : DataType
@@ -102,6 +103,7 @@ def tell(self, x, y):
102103 ----------
103104 x : A value from the function domain
104105 y : A value from the function image
106+
105107 """
106108 self .tell_many ([x ], [y ])
107109
@@ -112,21 +114,23 @@ def tell_many(self, xs, ys):
112114 ----------
113115 xs : Iterable of values from the function domain
114116 ys : Iterable of values from the function image
117+
115118 """
116119 for x , y in zip (xs , ys ):
117120 self .tell (x , y )
118121
119122 @abc .abstractmethod
120123 def tell_pending (self , x ):
121124 """Tell the learner that 'x' has been requested such
122- that it's not suggested again."""
125+ that it's not suggested again.
126+ """
123127
124128 @abc .abstractmethod
125129 def remove_unfinished (self ):
126130 """Remove uncomputed data from the learner."""
127131
128132 @abc .abstractmethod
129- def loss (self , real = True ):
133+ def loss (self , real : bool = True ):
130134 """Return the loss for the current state of the learner.
131135
132136 Parameters
@@ -135,6 +139,7 @@ def loss(self, real=True):
135139 If False, return the "expected" loss, i.e. the
136140 loss including the as-yet unevaluated points
137141 (possibly by interpolation).
142+
138143 """
139144
140145 @abc .abstractmethod
@@ -149,6 +154,7 @@ def ask(self, n, tell_pending=True):
149154 If True, add the chosen points to this learner's
150155 `pending_points`. Set this to False if you do not
151156 want to modify the state of the learner.
157+
152158 """
153159
154160 @abc .abstractmethod
@@ -162,7 +168,6 @@ def _set_data(self, data: Any) -> None:
162168 @abc .abstractmethod
163169 def new (self ):
164170 """Return a new learner with the same function and parameters."""
165- pass
166171
167172 def copy_from (self , other ):
168173 """Copy over the data from another learner.
@@ -171,6 +176,7 @@ def copy_from(self, other):
171176 ----------
172177 other : BaseLearner object
173178 The learner from which the data is copied.
179+
174180 """
175181 self ._set_data (other ._get_data ())
176182
@@ -184,6 +190,7 @@ def save(self, fname, compress=True):
184190 compress : bool, default True
185191 Compress the data upon saving using 'gzip'. When saving
186192 using compression, one must load it with compression too.
193+
187194 """
188195 data = self ._get_data ()
189196 save (fname , data , compress )
@@ -198,6 +205,7 @@ def load(self, fname, compress=True):
198205 compress : bool, default True
199206 If the data is compressed when saved, one must load it
200207 with compression too.
208+
201209 """
202210 with suppress (FileNotFoundError , EOFError ):
203211 data = load (fname , compress )
@@ -228,6 +236,7 @@ def to_dataframe(
228236 Returns
229237 -------
230238 pandas.DataFrame
239+
231240 """
232241
233242 @abc .abstractmethod
0 commit comments