remove if clause blocking recalculation of conf_interval #798
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.
Description
The check for
self.ci_out is None
blocks recalculation of confidence intervals in the event that they have already been calculated. But the "effort saving" technique is too blunt. If repeated calls toconf_interval
are made with differingkwargs
the results from the first calculation are unexpectedly returned every call. See Issue #791. The resolution is to continue caching the results intoself.ci_out
but to recalculate the results every timeconf_interval
is called. This shifts some "effort saving" responsibility out oflmfit
to the user.Type of Changes
Tested on
Python: 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)]
lmfit: 0.0.post2624+g1d011fc, scipy: 1.9.0, numpy: 1.23.1, asteval: 0.9.27, uncertainties: 3.1.7
Verification
Have you