Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modular fitter attempt #140

Closed
wants to merge 11 commits into from
Closed

Modular fitter attempt #140

wants to merge 11 commits into from

Conversation

settwi
Copy link
Contributor

@settwi settwi commented Mar 1, 2024

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-commenter
Copy link

codecov-commenter commented Mar 1, 2024

Codecov Report

Attention: Patch coverage is 50.29586% with 84 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (main@2deabc0). Click here to learn what that means.

Files Patch % Lines
sunkit_spex/fitting/fitters.py 45.58% 37 Missing ⚠️
sunkit_spex/fitting/fit_models.py 51.61% 30 Missing ⚠️
sunkit_spex/fitting/fake_models.py 28.57% 15 Missing ⚠️
sunkit_spex/fitting/spectra.py 88.88% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #140   +/-   ##
=======================================
  Coverage        ?   55.51%           
=======================================
  Files           ?       24           
  Lines           ?     3334           
  Branches        ?        0           
=======================================
  Hits            ?     1851           
  Misses          ?     1483           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@settwi
Copy link
Contributor Author

settwi commented Mar 2, 2024

@samaloney @KriSun95 @DanRyanIrish @hayesla
tear this apart plz

@settwi settwi marked this pull request as draft May 16, 2024 14:09
@settwi settwi closed this Sep 19, 2024
@settwi settwi deleted the basic-fitter branch September 19, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants