-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Test pvsystem.singlediode against precisely generated IV curves #1573
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
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
b92d376
start to adding tests from data in ivcurves repo
reepoi bebcfef
correcting Vth calculation
reepoi 74c5f8c
making current increasing for numpy linear interp
reepoi 85f83af
singlediode ivcurve_pnts does not give negative voltage with brentq a…
reepoi f165e08
adding test for singlediode log spacing methods
reepoi f27b97d
adding assertions for i_x and i_xx
reepoi 64d6cef
adding i_x, i_xx iv curve data
reepoi 8019f2c
updating whatsnew
reepoi 2484dca
reverting changes to pvsystem.singlediode
reepoi dcaddc8
move precise iv curve fixtures into test_singlediode
reepoi 3115bba
updating precise iv curve json to match new schema
reepoi 150ee02
Merge branch 'main' of https://github.com/pvlib/pvlib-python into pre…
reepoi 1c0f2b6
testing v_from_i, i_from_v
reepoi a98825e
small refactor
reepoi 64f9c02
Merge branch 'main' of https://github.com/pvlib/pvlib-python into pre…
reepoi 3537878
small refactor and update whatsnew
reepoi 3670964
changing Boltzmann's constant
reepoi a27db19
add more to precise iv curve docstring
reepoi 2c2ca4a
Merge branch 'main' of https://github.com/pvlib/pvlib-python into pre…
reepoi 5178f87
Merge branch 'main' of https://github.com/pvlib/pvlib-python into pre…
reepoi a1040d3
use SciPy constants
reepoi 99b9830
restore whatsnew 0.9.4
reepoi 2471893
relax i_xx error tolerance
reepoi a13583b
trying lower i_xx atol
reepoi 020e363
update generated iv curves after finding bug in their calcuation
reepoi be34c09
increasing i_xx atol, and adding comment about atol on mac, windows
reepoi e966f20
Merge branch 'main' of https://github.com/pvlib/pvlib-python into pre…
reepoi 4b3016d
update whatsnew
reepoi 5a6b631
update whatsnew and add references to test docs
reepoi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
move precise iv curve fixtures into test_singlediode
- Loading branch information
commit dcaddc840c189ccb2a5590551fd1d9f750ebbce3
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better traceability, I would think that the choice of values for these constants should documented as part of the files containing the parameters used to precisely compute the curves.
For comparison,
scipy==1.8.1
gives:scipy.constants.value("Boltzmann constant") = 1.380649e-23 J/K
scipy.constants.value("elementary charge") = 1.602176634e-19 C
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also see #483
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I updated these constants to match The SI Brochure (https://www.bipm.org/en/publications/si-brochure) and cited that document in the docstring. In that docstring, I also added the precision cutoff of mpmath and more detail about the precision of the IV curve data. I avoided mentioning cwhanse/ivcurves, but maybe we should reference it. There is much more documentation and code that would help someone understand how the IV curve data was generated.
Also, if we use
scipy.constants
, pvlib may need to update its minimum SciPy version requirement because Boltzmann's constant changes depending on the SciPy version. The value for SciPy 1.9.3 is1.602176634e-19 C
, which matches the value hard-coded here; however, the value is1.6021766208e-19 C
for SciPy 1.2.0. It changes in SciPy 1.4.0, and pvlib's minimum version of SciPy is 1.2.0.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pvlib/pvlib-maintainer I think we should advance scipy version and use the 2019 values, which are defined to be exact rather than with uncertainty.