lmfit-py icon indicating copy to clipboard operation
lmfit-py copied to clipboard

Fix problems with arguments that are neither fit parameters nor independent variables

Open schtandard opened this issue 7 months ago • 4 comments

Description

Model function arguments that are neither fit parameters nor independent variables were handled incorrect in two places.

  • They were incorrectly identified to not correspond to a model function argument in Model.fit() and thus a misleading spurious warning was issued.
  • They were not considered in ModelResult.plot_fit(), causing ModelResult.plot() to produce contradictory plots.

This PR remedies both issues and fixes #917 (moved to #920).

Type of Changes
  • [x] Bug fix
  • [ ] New feature
  • [ ] Refactoring / maintenance
  • [ ] Documentation / examples
Tested on
Python: 3.11.6 | packaged by conda-forge | (main, Oct  3 2023, 10:29:11) [MSC v.1935 64 bit (AMD64)]

lmfit: 0.0.post2796+g4e2470a.d20231118, scipy: 1.11.3, numpy: 1.26.0, asteval: 0.9.31, uncertainties: 3.1.7
Verification

Have you

  • [ ] included docstrings that follow PEP 257? (No API changes.)
  • [x] referenced existing Issue and/or provided relevant link to mailing list?
  • [x] verified that existing tests pass locally? (I get several warnings and three skipped tests, though.)
  • [x] verified that the documentation builds locally? (Except for issues that also appeared when building on master, as described in #924.)
  • [x] squashed/minimized your commits and written descriptive commit messages?
  • [ ] added or updated existing tests to cover the changes? (No tests were affected by the change.)
  • [ ] updated the documentation and/or added an entry to the release notes (doc/whatsnew.rst)? (I did not add anything to doc/whatsnew.rst yet. I had a look at the file history and other PRs and it seems to be done in batch, separate from the PRs. I will add an entry if you ask me to.)
  • [ ] added an example? (Same as for test, I don't think any example was affected and I did not add a new one.)

schtandard avatar Nov 18 '23 14:11 schtandard