We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b2ae11 commit 0116e17Copy full SHA for 0116e17
adaptive/learner/base_learner.py
@@ -4,7 +4,7 @@
4
from contextlib import suppress
5
from copy import deepcopy
6
7
-from adaptive.utils import load, save
+from adaptive.utils import load, save, _RequireAttrsABCMeta
8
9
10
def uses_nth_neighbors(n):
@@ -61,7 +61,7 @@ def _wrapped(loss_per_interval):
61
return _wrapped
62
63
64
-class BaseLearner(metaclass=abc.ABCMeta):
+class BaseLearner(metaclass=_RequireAttrsABCMeta):
65
"""Base class for algorithms for learning a function 'f: X → Y'.
66
67
Attributes
@@ -85,6 +85,8 @@ class BaseLearner(metaclass=abc.ABCMeta):
85
and returns a holoviews plot.
86
"""
87
88
+ required_attributes = ["data", "npoints", "pending_points"]
89
+
90
def tell(self, x, y):
91
"""Tell the learner about a single value.
92
0 commit comments