Allow setting fit title to model result#317
Conversation
…_title_to_fit_result variable in within ISISCallbacks
I will edit, but please be mindful of this: |
| y=reducer.intensity.name, | ||
| yerr=reducer.intensity_stddev.name, | ||
| fit=Linear.fit(), | ||
| fit=Gaussian.fit(), |
| from ibex_bluesky_core.utils import get_pv_prefix | ||
|
|
||
| NUM_POINTS: int = 3 | ||
| NUM_POINTS: int = 10 |
| show_plot() | ||
|
|
||
|
|
||
| class LiveFitPlot(_DefaultLiveFitPlot): |
There was a problem hiding this comment.
Needs adding to __all__ here and in callbacks module please...
Please write API documentation and check it renders properly in sphinx.
| logger = logging.getLogger(__name__) | ||
|
|
||
| __all__ = ["LivePColorMesh", "LivePlot", "PlotPNGSaver", "show_plot"] | ||
| _selected_params = ["cen", "center", "x0", "inflections_diff", "centre"] |
There was a problem hiding this comment.
I think these should be attributes on each fit model.
e.g. Conceptually
class Gaussian:
def model(...): ...
def guess(...): ...
def default_interesting_params() -> list[str]:
return ["x0"]
| super().stop(doc) | ||
| if self.set_title: | ||
| param_name = self.livefit.model.param_names | ||
| result_values = self.livefit.result.values |
There was a problem hiding this comment.
What happens if the fit failed and livefit.result is None?
| if self.set_title: | ||
| param_name = self.livefit.model.param_names | ||
| result_values = self.livefit.result.values | ||
| model_title = self.livefit.model.name.split(" [")[0] + ")" |
There was a problem hiding this comment.
This seems fragile. Can we define a name in a suitable format on each model instead?
Description of work
Matlibplot will display both the Model used and the Centre value of the graph.
Ticket
Link to Ticket
Labels
Acceptance criteria