fit_thread - Manage fitting thread¶
Generic GUI monitor for fitting. |
|
Run the fit in a separate thread from the GUI thread. |
|
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:
MonitorGeneric 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.
- class bumps.fit_thread.DreamMonitor(problem, fit_state=None, method=None, rate=0)[source]¶
Bases:
Monitor
- 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:
ThreadRun the fit in a separate thread from the GUI thread.
- 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.