Refactor molecule fitting#17
Draft
AntoineTUE wants to merge 24 commits into
Draft
Conversation
…data loading in molecule module. * Molecule data is now cached, filtering at runtime * Available molecule data determined dynamically at start, with fallback to plain names if no label defined for UI.
* consistent plot label order and decimals * Plot all zeros if a species has no lines in plotted range
…fits. * Pass line databases directly to MoleculeFitter instead of non-threadsafe widgets * Construct initial estimates and bounds in MoleculeFitter. * Fixes changes in checkboxes affecting which species will be fitted when a batch of fits is already in-progress
…data loading in molecule module. * Molecule data is now cached, filtering at runtime * Available molecule data determined dynamically at start, with fallback to plain names if no label defined for UI.
* consistent plot label order and decimals * Plot all zeros if a species has no lines in plotted range
…fits. * Pass line databases directly to MoleculeFitter instead of non-threadsafe widgets * Construct initial estimates and bounds in MoleculeFitter. * Fixes changes in checkboxes affecting which species will be fitted when a batch of fits is already in-progress
…eTUE/OES-toolbox into refactor-molecule-fitting Merge upstream changes of main into branch for refactorring molecule fitting
…arameters from data. * Use lmfit and Moose for clearer modelling of spectra based on parameters with bounds. * Use `multi_species_objective` from Moose with `normalize=True` * Store fit results with associated table row using FitResultRole * Store ref to fit plot item with associated table row using PlotItemRole
…nt changes. * Fit data and plots are now stored with the table and should be cleared alongside it as well.
…sed file-read-backwards dependency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(This PR is very much WIP; I'll update this post as it progresses, changes will be incremental at first)
Purpose
This PR seeks to improve how we handle fitting of molecular spectra and how the user can interact with the results.
The goal is to make fitting more robust, but also improve the interaction with it and fix (minor) issues.
As it stands, there are some small issues involving
NaNvalues, or with a 'reversed' wavelength axis (i.e. decreasing), that can cause a fit to fail unexpectedly, without clear reason to the user.Once fitted, the result table is fairly fragile when changing the amount of species fitted: it won't always put values in the corresponding (correct) column.
Also, apart from showing the fit and summarizing values, there is no other interaction possible to inspect fit parameters and results in detail (e.g. residuals, components of multiple species, etc), which would actually be very useful.
For fitting, it will move to use a model based approach using
lmfit, to more clearly handle fit parameters and bounds, relying more directly on Moose for the modelling.Finally, the goal is to decouple UI state from the fitting process.
Once started, a batch fit can be affected by (and fail due to) changes in the UI, such as (de)selecting a molecule.
Notable changes
(TODO)