OxIonics / ionics_fits

Small python fitting library with an emphasis on Atomic Molecular and Optical Physics
Apache License 2.0
1 stars 0 forks source link

Add core functionality #1

Closed hartytp closed 2 years ago

hartytp commented 2 years ago

c.f. https://github.com/OxfordIonTrapGroup/ndscan/pull/305

closes #6

hartytp commented 2 years ago

PR now ready for review. 🎆

hartytp commented 2 years ago

I personally avoid that and instead have a FitterBase class (or just Fitter: "base" is a bit of noise word)

Agreed

hartytp commented 2 years ago

Todo:

hartytp commented 2 years ago

@mbirtwell @AUTProgram I've reshuffled things a bit. In particular:

The ModelParameter now contains all metadata associated with the parameter (including initial values) as well as a few simple methods for manipulating that metadata. This is the only source of truth for that data anywhere. This means that to change the fit behaviour (e.g. float/fix a parameter) one mutates the model's parameter dictionary.

Fitters now store all result data from a single fit and nothing else. Fitting is performed during object construction (so no partially constructed objects).

model = fits.models.Power()
model.parameters['a'].fixed_to = 3
fit = fitter(x, y, model=model)
print(fit.values['a'])

Let me know what you think!

Other than that, I think all feedback has now been addressed and we should be good to merge?

hartytp commented 2 years ago

@mbirtwell I think that's everything addressed apart from https://github.com/OxIonics/ionics_fits/pull/1#discussion_r965753320

hartytp commented 2 years ago

@mbirtwell happy for me to merge now?