fit_thread - Manage fitting thread

ConvergenceMonitor

Generic GUI monitor for fitting.

DreamMonitor

FitThread

Run the fit in a separate thread from the GUI thread.

GUIProgressMonitor

Manage the fitting thread used by the server.

To keep the UI responsive, fitting is run in a separate thread. The main thread is listening for new requests from the client.

class bumps.fit_thread.ConvergenceMonitor(problem, rate=0, quantiles: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None)[source]

Bases: Monitor

Generic GUI monitor for fitting.

Sends a convergence_update event every rate seconds. Gathers statistics about the best, worst, median and +/- 1 interquartile range. This will be the input for the convergence plot.

problem should be the fit problem handed to the fit thread, and not a copy. This is because it is used for direct comparison with the current fit object in the progress panels so that stray messages don’t cause confusion when making graphs.

message is a dispatch string used by the OnFitProgress event processor in the app to determine which progress panel should receive the event.

config_history(history)[source]

Indicate which fields are needed by the monitor and for what duration.

final(history, best)[source]

Close out the monitor but sending any tailing convergence information

message: str = 'convergence_update'
class bumps.fit_thread.DreamMonitor(problem, fit_state=None, method=None, rate=0)[source]

Bases: Monitor

config_history(history)[source]

Indicate which fields are needed by the monitor and for what duration.

final(history, best)[source]

Close out the monitor

message: str = 'uncertainty_update'
class bumps.fit_thread.FitThread(fit_abort_event: Event, problem=None, fitclass=None, options=None, mapper=None, parallel=0, convergence_update=5, uncertainty_update=300, console_update=0, fit_state=None, convergence=None)[source]

Bases: Thread

Run the fit in a separate thread from the GUI thread.

abort_test()[source]
run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

class bumps.fit_thread.GUIProgressMonitor(problem, progress=None, improvement=None)[source]

Bases: TimedUpdate

show_improvement(history)[source]
show_progress(history)[source]