sunkit-spex icon indicating copy to clipboard operation
sunkit-spex copied to clipboard

Adds Distance and Constant multiplicative factor scaling models as Astropy models

Open jajmitchell opened this issue 1 year ago • 6 comments

Adds an Distance and Constant multiplicative factor scaling models as Astropy models

This PR adds scaling.py which includes DistanceScale and Constant which can be used alongside other models to scale for the observer distance or by an constant multiplicative factor, both the distance and the constant can be fit.

distance

constant

  • [x] Add tests

  • [x] Add doc strings

jajmitchell avatar Mar 04 '25 16:03 jajmitchell

@jajmitchell, is it possible to update the image/examples at the top to show the changes since the PR was opened? I'm mainly thinking of showing the | changing to *.

KriSun95 avatar Mar 28 '25 16:03 KriSun95

Aside from the docs failure, I think that this is now ready for merging.

InverseSquareFluxScaling now functions as a multiplicative model with correct unit handling.

ScalarConstant can be used with whatever operator desired. The example given is for use as a multiplicative constant. This model is much more simple than the Astropy constant models, and is more applicable to our usecase.

jajmitchell avatar Apr 08 '25 10:04 jajmitchell

Need to merge or rebase upstream main into this branch to fix the doc builds

samaloney avatar Apr 08 '25 10:04 samaloney

Need to merge or rebase upstream main into this branch to fix the doc builds

I think this is sorted, but am unsure why the changelog is now failing?

jajmitchell avatar Apr 08 '25 11:04 jajmitchell

@samaloney when you say "You need to add the new module to the docs", do you mean add relevant .rst files to the /docs/api/ directory?

jajmitchell avatar Apr 08 '25 14:04 jajmitchell

@samaloney when you say "You need to add the new module to the docs", do you mean add relevant .rst files to the /docs/api/ directory?

Eh yea, you may need to add a new file I can't remember but should be able to follow the same approach as the other modules.

samaloney avatar Apr 09 '25 09:04 samaloney

I think the docs configuration is missing? (Don't see the new functions in the build docs or change to docs config)

So I am running python -m tox -e build_docs -r but the new files aren't being added to /docs/api/

jajmitchell avatar Apr 23 '25 12:04 jajmitchell

I think the docs configuration is missing? (Don't see the new functions in the build docs or change to docs config)

I think this is now sorted

jajmitchell avatar Apr 23 '25 12:04 jajmitchell

@samaloney the docs fail because the examples in the docstrings require the new StraightLineModel and GaussianModel to function. Should I just remove the examples then we can add them back in in a trivial PR once these two PRs are merged?

jajmitchell avatar Apr 23 '25 13:04 jajmitchell