-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add lambertw_pvlib #2723
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
+83
−1
Merged
Add lambertw_pvlib #2723
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
18ab529
add lambertw_pvlib
cwhanse 33be0e3
whatsnew
cwhanse e2fa011
formatting
cwhanse e0bc631
Apply suggestions from code review
cwhanse 935ff35
from review
cwhanse c22c763
move to ivtools, make private
cwhanse f0897ba
Apply suggestions from code review
cwhanse 610bbb2
accept float, restrict to x>=0, simplify test
cwhanse b8e1e3d
formatting
cwhanse 9a0cf85
small < 100
cwhanse eba1777
Apply suggestions from code review
cwhanse 189d8fb
fix test loop
cwhanse eb94583
Merge branch 'main' into lambertw
cwhanse 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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -283,3 +283,28 @@ def test__file_context_manager(): | |
| buffer = StringIO("test content") | ||
| with tools._file_context_manager(buffer) as obj: | ||
| assert obj.read() == "test content" | ||
|
|
||
|
|
||
| def test_lambertw_pvlib(): | ||
| test_exp = np.arange(-10., 300, step=10) | ||
| test_x = 10.**test_exp | ||
| # known solution from scipy.special.lambertw | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please add the exact version of scipy and date you generated it? For traceability. Else, we could generate the comparison on the fly, so if there ever is a change at scipy we can catch it soon. |
||
| expected = np.array([ | ||
| 9.9999999989999997e-11, 5.6714329040978384e-01, | ||
| 2.0028685413304952e+01, 4.2306755091738395e+01, | ||
| 6.4904633770046118e+01, 8.7630277151947183e+01, | ||
| 1.1042491882731335e+02, 1.3326278259180333e+02, | ||
| 1.5613026581351718e+02, 1.7901931374150624e+02, | ||
| 2.0192476320084489e+02, 2.2484310644511851e+02, | ||
| 2.4777185185877809e+02, 2.7070916610249782e+02, | ||
| 2.9365366103997610e+02, 3.1660426041503479e+02, | ||
| 3.3956011295458728e+02, 3.6252053376149752e+02, | ||
| 3.8548496362161768e+02, 4.0845294003314166e+02, | ||
| 4.3142407612718210e+02, 4.5439804503371403e+02, | ||
| 4.7737456808796901e+02, 5.0035340579834485e+02, | ||
| 5.2333435083468805e+02, 5.4631722251791496e+02, | ||
| 5.6930186244110166e+02, 5.9228813095427859e+02, | ||
| 6.1527590431628334e+02, 6.3826507236734335e+02, | ||
| 6.6125553661218726e+02]) | ||
| result = tools.lambertw_pvlib(test_x) | ||
| assert np.allclose(result, expected, rtol=1e-14) | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.