monitor - Monitor fit progress¶
Base class for monitors. |
|
Keeps a record of all values for the desired fields. |
|
Indicate progress every n seconds. |
Progress monitors.
Process monitors accept a bumps.history.History
object each cycle
and perform some sort of work.
Monitors have a Monitor.config_history()
method which calls
history.requires() to set the amount of history it needs and a
Monitor.__call__ method which takes the updated history and
generates the monitor output.
Most monitors are subclassed from TimedUpdate
to set a minimum
time between updates and to only show updates when there is an improvement.
The TimedUpdate subclasses must override TimedUpdate.show_progress()
and TimedUpdate.show_improvement()
to control the output form. History
must be updated with time, value, point and step. The
bumps.fitters.MonitorRunner class manages history and updates.
- class bumps.monitor.Logger(fields=(), table=None)[source]¶
Bases:
Monitor
Keeps a record of all values for the desired fields.
fields is a list of history fields to store.
table is an object with a store(field=value,…) method, which gets the current value of each field every time the history is updated.
Call
config_history()
with thebumps.history.History
object before starting so that the correct fields are stored.
- class bumps.monitor.TimedUpdate(progress=60, improvement=5)[source]¶
Bases:
Monitor
Indicate progress every n seconds.
The process should provide time, value, point, and step to the history update. Call
config_history()
with thebumps.history.History
object before starting so that these fields are stored.progress is the number of seconds to go before showing progress, such as time or step number.
improvement is the number of seconds to go before showing improvements to value.
By default, the update only prints step number and improved value. Subclass TimedUpdate with replaced
show_progress()
andshow_improvement()
to trigger GUI updates or show parameter values.