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

Make params datatypes #872

Merged
merged 3 commits into from
May 1, 2023
Merged

Make params datatypes #872

merged 3 commits into from
May 1, 2023

Conversation

newville
Copy link
Member

Description

This addresses #871 for Model.make_params() by better allowing values that can be coerced to float to be allowed as "value".

Type of Changes
  • Bug fix
  • New feature
  • Refactoring / maintenance
  • Documentation / examples
Tested on

Python: 3.11.0 | packaged by conda-forge | (main, Jan 15 2023, 05:44:48) [Clang 14.0.6 ]

lmfit: 1.2.0.post5+g53118ec, scipy: 1.10.1, numpy: 1.24.2, asteval: 0.9.29, 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?

@codecov
Copy link

codecov bot commented Apr 30, 2023

Codecov Report

Merging #872 (b4d96ea) into master (2015516) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #872   +/-   ##
=======================================
  Coverage   93.54%   93.55%           
=======================================
  Files          10       10           
  Lines        3612     3615    +3     
=======================================
+ Hits         3379     3382    +3     
  Misses        233      233           
Impacted Files Coverage Δ
lmfit/model.py 91.08% <100.00%> (+0.03%) ⬆️

@reneeotten
Copy link
Contributor

thanks @newville - this seems like a good change to make and is more future proof as it doesn't rely on us listing specific dtypes anymore. I've made one change (besides the commit messages) and that is the use of np.longdouble instead of specifying np.float128 or np.float64; np.longdouble will take whatever supported on the specific platform (and this should thus also work on Windows now, without the try.... except construction).

@newville
Copy link
Member Author

newville commented May 1, 2023

@reneeotten Thanks for cleaning up those messages, and yes np.longdouble looks like the right way to test.

This seems OK to merge to me.

@newville
Copy link
Member Author

newville commented May 1, 2023

@reneeotten I'm going to merge this.
I think it might want a bugfix tag and release. Do you agree on a 1.2.1 release for this?
Have you seen any other problems that might need urgent fixes?

@newville newville merged commit 360ea9b into master May 1, 2023
@reneeotten reneeotten deleted the make_params_datatypes branch May 2, 2023 00:59
@reneeotten
Copy link
Contributor

@reneeotten I'm going to merge this. I think it might want a bugfix tag and release. Do you agree on a 1.2.1 release for this? Have you seen any other problems that might need urgent fixes?

I do - feel free to add an entry to whatsnew.rst and release at your earliest convenience. I don't think there are other urgent bugs or things that we would need to wait for.

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