-
Couldn't load subscription status.
- Fork 1.1k
add marion's adjustment to pvwatts_dc #2569
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
base: main
Are you sure you want to change the base?
Changes from all commits
05f5408
6d7ae12
40328c8
a9dfb28
551e722
73e80d3
f25b426
380bb58
5d31dfd
ad146b5
69ce5e7
dc58507
0d8b0b5
90b7c54
1297448
4488e3c
250af5a
bd16ac2
f3041c2
9f756bf
17f7213
a018525
816c82a
a19b721
85016fa
bed78f9
c8b5cde
1f85ed2
e81b450
3ea68ef
86ccbb1
158ff41
1e3d413
bdf331d
4c3e01d
996092a
5777613
3c7f1e9
86eb06e
4650443
c646f21
f3e165e
6624239
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2181,6 +2181,54 @@ def test_pvwatts_dc_series(): | |||||||||||||||||||||||||
| assert_series_equal(expected, out) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| def test_pvwatts_dc_scalars_with_k(): | ||||||||||||||||||||||||||
| expected = 8.9125 | ||||||||||||||||||||||||||
| out = pvsystem.pvwatts_dc(100, 30, 100, -0.003, k=0.01) | ||||||||||||||||||||||||||
| assert_allclose(out, expected) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| def test_pvwatts_dc_arrays_with_k(): | ||||||||||||||||||||||||||
| irrad_trans = np.array([np.nan, 100, 1200]) | ||||||||||||||||||||||||||
| temp_cell = np.array([30, np.nan, 30]) | ||||||||||||||||||||||||||
| irrad_trans, temp_cell = np.meshgrid(irrad_trans, temp_cell) | ||||||||||||||||||||||||||
| expected = np.array([[nan, 8.9125, 118.45], | ||||||||||||||||||||||||||
| [nan, nan, nan], | ||||||||||||||||||||||||||
| [nan, 8.9125, 118.45]]) | ||||||||||||||||||||||||||
| out = pvsystem.pvwatts_dc(irrad_trans, temp_cell, 100, -0.003, k=0.01) | ||||||||||||||||||||||||||
| assert_allclose(out, expected, equal_nan=True) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| def test_pvwatts_dc_series_with_k(): | ||||||||||||||||||||||||||
| irrad_trans = pd.Series([np.nan, 100, 100, 1200]) | ||||||||||||||||||||||||||
| temp_cell = pd.Series([30, np.nan, 30, 30]) | ||||||||||||||||||||||||||
| expected = pd.Series(np.array([ nan, nan, 8.9125, 118.45])) | ||||||||||||||||||||||||||
| out = pvsystem.pvwatts_dc(irrad_trans, temp_cell, 100, -0.003, k=0.01) | ||||||||||||||||||||||||||
| assert_series_equal(expected, out) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| def test_pvwatts_dc_with_k_and_cap_adjustment(): | ||||||||||||||||||||||||||
| irrad_trans = [100, 1200] | ||||||||||||||||||||||||||
| temp_cell = 25 | ||||||||||||||||||||||||||
| out = [] | ||||||||||||||||||||||||||
| expected = [0, 120.0] | ||||||||||||||||||||||||||
| for irrad in irrad_trans: | ||||||||||||||||||||||||||
| out.append(pvsystem.pvwatts_dc(irrad, temp_cell, 100, -0.003, k=0.15, | ||||||||||||||||||||||||||
| cap_adjustment=True)) | ||||||||||||||||||||||||||
| assert_allclose(out, expected) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
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. See #2569 (comment); I think this test should help. The rest look good already, nice job!
Suggested change
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. See my changes to Does that cover it? |
||||||||||||||||||||||||||
| def test_pvwatts_dc_arrays_with_k_and_cap_adjustment(): | ||||||||||||||||||||||||||
| irrad_trans = np.array([np.nan, 100, 1200]) | ||||||||||||||||||||||||||
| temp_cell = np.array([30, np.nan, 30]) | ||||||||||||||||||||||||||
| irrad_trans, temp_cell = np.meshgrid(irrad_trans, temp_cell) | ||||||||||||||||||||||||||
| expected = np.array([[nan, 8.9125, 118.2], | ||||||||||||||||||||||||||
| [nan, nan, nan], | ||||||||||||||||||||||||||
| [nan, 8.9125, 118.2]]) | ||||||||||||||||||||||||||
| out = pvsystem.pvwatts_dc(irrad_trans, temp_cell, 100, -0.003, k=0.01, | ||||||||||||||||||||||||||
| cap_adjustment=True) | ||||||||||||||||||||||||||
| assert_allclose(out, expected, equal_nan=True) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| def test_pvwatts_losses_default(): | ||||||||||||||||||||||||||
| expected = 14.075660688264469 | ||||||||||||||||||||||||||
| out = pvsystem.pvwatts_losses() | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.