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

remove if clause blocking recalculation of conf_interval #798

Merged
merged 1 commit into from
Aug 4, 2022

Conversation

jagerber48
Copy link
Contributor

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 to conf_interval are made with differing kwargs the results from the first calculation are unexpectedly returned every call. See Issue #791. The resolution is to continue caching the results into self.ci_out but to recalculate the results every time conf_interval is called. This shifts some "effort saving" responsibility out of lmfit to the user.

Type of Changes
  • Bug fix
  • New feature
  • Refactoring / maintenance
  • Documentation / examples
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

  • included docstrings that follow PEP 257?
  • referenced existing Issue and/or provided relevant link to mailing list?
  • verified that existing tests pass locally?
  • verified that the documentation builds locally?
  • squashed/minimized your commits and written descriptive commit messages?
  • added or updated existing tests to cover the changes?
  • updated the documentation and/or added an entry to the release notes (doc/whatsnew.rst)?
  • added an example?

@jagerber48
Copy link
Contributor Author

This is actually my first public github PR and the building, pytesting etc. is all new to me so I'm working over a little bit of a learning curve. Thanks for patience with me.

@newville
Copy link
Member

newville commented Aug 4, 2022

@jagerber48 Great, thanks very much! I think this is sufficiently short and discussed that I will just merge.

@newville newville merged commit 0b9947a into lmfit:master Aug 4, 2022
@jagerber48 jagerber48 deleted the bugfix/always_recalculate_ci_out branch August 4, 2022 21:51
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