Browse code

make the 'normalize' argument available in 'runner.live_plot'

Bas Nijholt authored on 15/05/2019 21:02:12
Showing 3 changed files
... ...
@@ -276,6 +276,8 @@ class BalancingLearner(BaseLearner):
276 276
         dm = dm.redim.values(**d)
277 277
 
278 278
         if dynamic:
279
+            # XXX: change when https://github.com/pyviz/holoviews/issues/3637
280
+            # is fixed.
279 281
             return dm.map(lambda obj: obj.opts(framewise=True), hv.Element)
280 282
         else:
281 283
             # XXX: change when https://github.com/ioam/holoviews/issues/3085
... ...
@@ -96,7 +96,7 @@ def live_plot(runner, *, plotter=None, update_interval=2, name=None, normalize=T
96 96
 
97 97
     Parameters
98 98
     ----------
99
-    runner : `Runner`
99
+    runner : `~adaptive.Runner`
100 100
     plotter : function
101 101
         A function that takes the learner as a argument and returns a
102 102
         holoviews object. By default ``learner.plot()`` will be called.
... ...
@@ -558,12 +558,12 @@ class AsyncRunner(BaseRunner):
558 558
         """
559 559
         self.task.cancel()
560 560
 
561
-    def live_plot(self, *, plotter=None, update_interval=2, name=None):
561
+    def live_plot(self, *, plotter=None, update_interval=2, name=None, normalize=True):
562 562
         """Live plotting of the learner's data.
563 563
 
564 564
         Parameters
565 565
         ----------
566
-        runner : `Runner`
566
+        runner : `~adaptive.Runner`
567 567
         plotter : function
568 568
             A function that takes the learner as a argument and returns a
569 569
             holoviews object. By default ``learner.plot()`` will be called.
... ...
@@ -573,6 +573,8 @@ class AsyncRunner(BaseRunner):
573 573
             Name for the `live_plot` task in `adaptive.active_plotting_tasks`.
574 574
             By default the name is None and if another task with the same name
575 575
             already exists that other `live_plot` is canceled.
576
+        normalize : bool
577
+            Normalize (scale to fit) the frame upon each update.
576 578
 
577 579
         Returns
578 580
         -------