9ef50183c43700fea3bfbacaa70b2283631373e8,pymc/progressbar.py,ProgressBar,animate_ipython,#ProgressBar#Any#,35

Before Change


            // terminal IPython has no clear_output
            pass
        print("\r", self, end="")
        sys.stdout.flush()
        self.update_iteration(iter)

    def update_iteration(self, elapsed_iter):
        self.__update_amount((elapsed_iter / float(self.iterations)) * 100.0)

After Change


    def animate_ipython(self, iter):
        elapsed = time.time() - self.start
        iter = iter + 1
        if elapsed - self.last > .5 or iter == self.iterations:
            self.last = elapsed

            self.update_iteration(iter)
            fraction = int(100*iter/float(self.iterations))

            display(Javascript("$("div//%s").width("%i%%")" % (self.divid, fraction)))
            display(Javascript("$("label//%s").text("%i%% in %.1f sec")" % (self.sec_id, fraction, round(elapsed, 1))))

    def update_iteration(self, elapsed_iter):
        self.__update_amount((elapsed_iter / float(self.iterations)) * 100.0)
        self.prog_bar += "  %d of %s complete" % (elapsed_iter, self.iterations)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: pymc-devs/pymc3
Commit Name: 9ef50183c43700fea3bfbacaa70b2283631373e8
Time: 2013-04-14
Author: jsalvatier@gmail.com
File Name: pymc/progressbar.py
Class Name: ProgressBar
Method Name: animate_ipython


Project Name: keras-team/keras
Commit Name: ecbf73f72b59f8f5c8746de63270aa1fb3ad7524
Time: 2018-10-01
Author: gabrieldemarmiesse@gmail.com
File Name: keras/callbacks.py
Class Name: TensorBoard
Method Name: on_epoch_end


Project Name: tensorflow/tensorboard
Commit Name: f13f59a3b9951c8817a9db61acf3e8a6a9da8d09
Time: 2017-01-21
Author: dandelion@google.com
File Name: lib/python/http.py
Class Name:
Method Name: Respond