Progress bar

The progress module contains a progress bar usable with Myokit gui’s.

Implementation

class myokit.gui.progress.ProgressBar(parent, message)

Progress bar dialog for Myokit. Has a method reporter() that will return a myokit.ProgressReporter for interfacing with simulations and other tasks implementing the ProgressReporter interface.

reporter()

Returns a ProgressReporter for his progress bar.

was_cancelled()

Pythonic version of Qt class.

class myokit.gui.progress.ProgressBarReporter(pd)

A myokit.ProgressReporter that sends updates to a ProgressBar. To use, create a ProgressBar and then call its reporter() method to obtain a linked ProgressBarReporter.

enter(msg=None)

This method will be called when the job that provides progress updates is started.

An optional description of the job to run can be passed in at construction time as msg.

exit()

Called when a job is finished and the progress reports should stop.

update(f)

This method will be called to provides updates about the current progress. This is indicated using the floating point value progress, which will have a value in the range [0, 1].

The return value of this update can be used to cancel a job (if job type supports it). Return True to keep going, False to cancel the job.