sunkit-spex
sunkit-spex copied to clipboard
Modular fitter attempt
PR Description
A crack at an updated "modular" fitting interface. Notebook included demonstrating fitting a "line" of "X-ray" data. No real tests written yet but that's on the agenda, if we want to continue with any of this.
I am curious as to what folks think!
Here's a copy/paste from the "prelude" to that Jupyter notebook:
Modular modeling framework example
This notebook shows how a fitting framework could be made, in the context of issue #81 and issue #126.
sunkit-spex has (or will have?) a modular interface.
First we define the data interface.
For now it is only X-ray data but we can add more data types.
Then we define the fitting interface.
A PhotonModel represents any kind of model which represents photons which get counted.
In the future we can add different models, like IntegratedFluxModels if the
need arises; there is not a need to tie us to a base class right now.
The first example tackled here is fitting data to a line.
More complex models may be implemented however the user or developers see fit
by modifying the perform_fit method in subsequent classes.
The first class implemented is a Monte Carlo $\chi^2$ fitter.
A lot of ideas here are similar to pr #130. I think we should pick and choose what we like from both and move from there.
Codecov Report
Attention: Patch coverage is 50.29586% with 84 lines in your changes are missing coverage. Please review.
:exclamation: No coverage uploaded for pull request base (
main@2deabc0). Click here to learn what that means.
Additional details and impacted files
@@ Coverage Diff @@
## main #140 +/- ##
=======================================
Coverage ? 55.51%
=======================================
Files ? 24
Lines ? 3334
Branches ? 0
=======================================
Hits ? 1851
Misses ? 1483
Partials ? 0
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@samaloney @KriSun95 @DanRyanIrish @hayesla tear this apart plz