PNNL-m-q / mzapy

A Python package that provides an interface to raw MS data in the MZA format.
BSD 2-Clause "Simplified" License
7 stars 1 forks source link

Initializing calibration objects with already optimized parameters #18

Closed dylanhross closed 7 months ago

dylanhross commented 1 year ago

The calibration objects in the calibration module would be more useful if there was a non-awkward way of initializing an instance using already known optimized parameters and without needing to fit data. At present, this can be achieved by initializing the object with the fit=False flag, then manually setting the object's opt_params attribute to the correct fitted parameters. This is too awkward and it would be nice to have some sort of factory function that can do all of that cleanly behind the scenes. In implementing this, it is also worth considering the distinction between creating a calibration from known calibration function/parameters (but without necessarily having access to the individual calibrant information) and loading a previously made calibration (which would include information on the calibration function/parameters as well as individual calibrant info). The latter (i.e. a mechanism for saving/loading calibrations) is also worth implementing.