Skip to content

Use scipy.constants #1617

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

Merged
merged 5 commits into from
Dec 20, 2022
Merged

Use scipy.constants #1617

merged 5 commits into from
Dec 20, 2022

Conversation

cwhanse
Copy link
Member

@cwhanse cwhanse commented Dec 19, 2022

  • Closes Add a public constants module and include scipy as base requirement for pvlib #483
  • I am familiar with the contributing guidelines
  • Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for all changes. Includes link to the GitHub Issue with :issue:`num` or this Pull Request with :pull:`num`. Includes contributor name and/or GitHub username (link with :ghuser:`user`).
  • New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

In review of #1573 @markcampanelli pointed out that the precisely calculated solutions to the single diode equation should use the latest values of physical constants (Boltzmann and elementary charge). In 2019, the various committees agreed that the published values of these two constants were exact, without uncertainty. (I link to the U.S. agency NIST, other national agencies also published the same values).

With this agreement I see no reason for pvlib to use approximate values anywhere. Scipy 1.4.0 published the agreed-upon exact values in scipy.constants. Advancing to scipy 1.4.0 does not require pvlib to also advance the numpy version.

@kandersolar
Copy link
Member

The new minimum scipy must also be specified in setup.py's INSTALL_REQUIRES.

I didn't do an exhaustive search, but at least pvlib.temperature.fuentes has a hardcoded boltz variable that could be updated here as well. One reason to keep the current value in that case is to match the original model implementation from which ours was derived, but I wouldn't object to using scipy's value.

@cwhanse
Copy link
Member Author

cwhanse commented Dec 19, 2022

I searched but am not confident, because I didn't find that instance in temperature.py. I'm inclined to leave that one as is, with a comment.

@kandersolar
Copy link
Member

One more place to update the minimum scipy version: /benchmarks/asv.conf.json.

@kandersolar kandersolar mentioned this pull request Dec 20, 2022
9 tasks
Copy link
Member

@wholmgren wholmgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we note the minimum version change in the release notes? I can go either way.

@kandersolar kandersolar added this to the 0.9.4 milestone Dec 20, 2022
@kandersolar
Copy link
Member

Should we note the minimum version change in the release notes? I can go either way.

I vote yes and am a fan of the format we've used previously: Minimum pandas version increased to v0.25.0, released July 18, 2019. (#1448)

@kandersolar kandersolar merged commit 5a7c541 into pvlib:main Dec 20, 2022
@markcampanelli
Copy link
Contributor

Thanks everyone for seeing this through, including chasing down all the related “homework” items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a public constants module and include scipy as base requirement for pvlib
4 participants