Skip to content

Commit b419720

Browse files
authored
fix bad atol in singlediode test (#415)
1 parent 112ee56 commit b419720

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

docs/sphinx/source/whatsnew/v0.5.2.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Testing
2525
~~~~~~~
2626
* Test Python 3.6 on Windows with Appveyor instead of 3.4. (:issue:`392`)
2727
* Fix failing test on pandas 0.22 (:issue:`406`)
28+
* Fix too large test tolerance (:issue:`414`)
2829

2930
Contributors
3031
~~~~~~~~~~~~

pvlib/test/test_pvsystem.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -640,38 +640,38 @@ def test_singlediode_floats(sam_data):
640640
module = 'Example_Module'
641641
module_parameters = sam_data['cecmod'][module]
642642
out = pvsystem.singlediode(7, 6e-7, .1, 20, .5)
643-
expected = {'i_xx': 4.2685798754011426,
644-
'i_mp': 6.1390251797935704,
645-
'v_oc': 8.1063001465863085,
646-
'p_mp': 38.194165464983037,
647-
'i_x': 6.7556075876880621,
648-
'i_sc': 6.9646747613963198,
649-
'v_mp': 6.221535886625464,
643+
expected = {'i_xx': 4.2498,
644+
'i_mp': 6.1275,
645+
'v_oc': 8.1063,
646+
'p_mp': 38.1937,
647+
'i_x': 6.7558,
648+
'i_sc': 6.9651,
649+
'v_mp': 6.2331,
650650
'i': None,
651651
'v': None}
652652
assert isinstance(out, dict)
653653
for k, v in out.items():
654654
if k in ['i', 'v']:
655655
assert v is None
656656
else:
657-
assert_allclose(v, expected[k], atol=3)
657+
assert_allclose(v, expected[k], atol=1e-3)
658658

659659

660660
@requires_scipy
661661
def test_singlediode_floats_ivcurve():
662662
out = pvsystem.singlediode(7, 6e-7, .1, 20, .5, ivcurve_pnts=3)
663-
expected = {'i_xx': 4.2685798754011426,
664-
'i_mp': 6.1390251797935704,
665-
'v_oc': 8.1063001465863085,
666-
'p_mp': 38.194165464983037,
667-
'i_x': 6.7556075876880621,
668-
'i_sc': 6.9646747613963198,
669-
'v_mp': 6.221535886625464,
663+
expected = {'i_xx': 4.2498,
664+
'i_mp': 6.1275,
665+
'v_oc': 8.1063,
666+
'p_mp': 38.1937,
667+
'i_x': 6.7558,
668+
'i_sc': 6.9651,
669+
'v_mp': 6.2331,
670670
'i': np.array([6.965172e+00, 6.755882e+00, 2.575717e-14]),
671671
'v': np.array([0., 4.05315, 8.1063])}
672672
assert isinstance(out, dict)
673673
for k, v in out.items():
674-
assert_allclose(v, expected[k], atol=3)
674+
assert_allclose(v, expected[k], atol=1e-3)
675675

676676

677677
@requires_scipy

0 commit comments

Comments
 (0)