Fix plot_fit inconsistency with multi-component models#252
Open
Conversation
3adaeec to
668a703
Compare
plot_fit now sets a default e_range (extending a factor of 3 beyond the data energy limits) when modelfn is available, ensuring that _calc_ML, _calc_CI, plot_samples, and _plot_MLmodel all re-evaluate the model over a dense logspace grid instead of using sparse data energy points.
668a703 to
8c19543
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
plot_fitnow sets a defaulte_rangewhenmodelfnis available on the sampler, ensuring all model curves (ML line, confidence bands, samples) are evaluated over a dense logspace energy grid_calc_ML,_calc_CI,plot_samples, and_plot_MLmodelall now receive the samee_range, producing smooth, consistent curvese_rangeande_npointsparameters inplot_fitandplot_samplesTest plan
test_calc_ML_uses_dense_energy_grid— verifies that_calc_MLevaluates the model over a 100-point dense grid and matches direct model evaluationtox -e py313 -- tests/)Closes #240