@@ -83,10 +83,18 @@ class BaseRunner(metaclass=abc.ABCMeta):
8383 Parameters
8484 ----------
8585 learner : `~adaptive.BaseLearner` instance
86- goal : callable
86+ goal : callable, optional
8787 The end condition for the calculation. This function must take
8888 the learner as its sole argument, and return True when we should
89- stop requesting more points.
89+ stop requesting more points. (Advanced use) Instead of providing a
90+ function, see `auto_goal` for other types that are accepted here.
91+ loss_goal : float, optional
92+ Convenience argument, use instead of ``goal``. The end condition for the
93+ calculation. Stop when the loss is smaller than this value.
94+ npoints_goal : int, optional
95+ Convenience argument, use instead of ``goal``. The end condition for the
96+ calculation. Stop when the number of points is larger or
97+ equal than this value.
9098 executor : `concurrent.futures.Executor`, `distributed.Client`,\
9199 `mpi4py.futures.MPIPoolExecutor`, `ipyparallel.Client` or\
92100 `loky.get_reusable_executor`, optional
@@ -340,7 +348,15 @@ class BlockingRunner(BaseRunner):
340348 goal : callable
341349 The end condition for the calculation. This function must take
342350 the learner as its sole argument, and return True when we should
343- stop requesting more points.
351+ stop requesting more points. (Advanced use) Instead of providing a
352+ function, see `auto_goal` for other types that are accepted here.
353+ loss_goal : float
354+ Convenience argument, use instead of ``goal``. The end condition for the
355+ calculation. Stop when the loss is smaller than this value.
356+ npoints_goal : int
357+ Convenience argument, use instead of ``goal``. The end condition for the
358+ calculation. Stop when the number of points is larger or
359+ equal than this value.
344360 executor : `concurrent.futures.Executor`, `distributed.Client`,\
345361 `mpi4py.futures.MPIPoolExecutor`, `ipyparallel.Client` or\
346362 `loky.get_reusable_executor`, optional
@@ -465,8 +481,17 @@ class AsyncRunner(BaseRunner):
465481 goal : callable, optional
466482 The end condition for the calculation. This function must take
467483 the learner as its sole argument, and return True when we should
468- stop requesting more points. If not provided, the runner will run
469- forever, or until ``self.task.cancel()`` is called.
484+ stop requesting more points. (Advanced use) Instead of providing a
485+ function, see `auto_goal` for other types that are accepted here.
486+ If not provided, the runner will run forever (or stop when no more
487+ points can be added), or until ``self.task.cancel()`` is called.
488+ loss_goal : float, optional
489+ Convenience argument, use instead of ``goal``. The end condition for the
490+ calculation. Stop when the loss is smaller than this value.
491+ npoints_goal : int, optional
492+ Convenience argument, use instead of ``goal``. The end condition for the
493+ calculation. Stop when the number of points is larger or
494+ equal than this value.
470495 executor : `concurrent.futures.Executor`, `distributed.Client`,\
471496 `mpi4py.futures.MPIPoolExecutor`, `ipyparallel.Client` or\
472497 `loky.get_reusable_executor`, optional
@@ -765,8 +790,16 @@ def simple(
765790 ----------
766791 learner : ~`adaptive.BaseLearner` instance
767792 goal : callable
768- The end condition for the calculation. This function must take the
769- learner as its sole argument, and return True if we should stop.
793+ The end condition for the calculation. This function must take
794+ the learner as its sole argument, and return True when we should
795+ stop requesting more points.
796+ loss_goal : float, optional
797+ Convenience argument, use instead of ``goal``. The end condition for the
798+ calculation. Stop when the loss is smaller than this value.
799+ npoints_goal : int, optional
800+ Convenience argument, use instead of ``goal``. The end condition for the
801+ calculation. Stop when the number of points is larger or
802+ equal than this value.
770803 """
771804 goal = _goal (learner , goal , loss_goal , npoints_goal , allow_running_forever = False )
772805 while not goal (learner ):
@@ -912,7 +945,7 @@ def auto_goal(
912945 goal : GoalTypes ,
913946 learner : BaseLearner ,
914947 allow_running_forever : bool = True ,
915- ):
948+ ) -> Callable [[ BaseLearner ], bool ] :
916949 """Extract a goal from the learners.
917950
918951 Parameters
0 commit comments