PAHFIT / pahfit

Model Decomposition for Near- to Mid-Infrared Spectroscopy of Astronomical Sources
https://pahfit.readthedocs.io/
18 stars 26 forks source link

Possible API change: Separate fit results from Model/add history to Features Table #256

Open drvdputt opened 1 year ago

drvdputt commented 1 year ago

In our current design, the model details, fit settings and fit results are put together in the Model class. This brings some complexity with it:

Alternative design

  1. Model: stores the features table provided at construction, but does not change afterwards. Every call to fit returns a new Results object. Model objects can not be saved.
  2. Result: Contains the fitted features table, the uncertainties, maybe even a copy of the user-supplied spectrum? This would be the new home of the "plot" function, and various extraction / analysis tools. Results can be saved and loaded.

Possible issues with this:

We're not going to change this now, since we really need to get PAHFIT running. But I really wanted to write this down, and we should keep this type of redesign in mind if we run into more symptoms of the same underlying conceptual problem.

jdtsmith commented 1 year ago

Yeah, guess pretty much is required to change the model, since it is a warm-up to fit. And fit can be a prelude to another fit, e.g. on the next spectrum over in the cube. We can leave this open for a while, but I think a better approach is to tweak Features so it gives indication about: