Skip to content

large tolerances in test_pvsystem.test_singlediode_floats_ivcurve #414

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

Closed
mikofski opened this issue Jan 31, 2018 · 3 comments
Closed

large tolerances in test_pvsystem.test_singlediode_floats_ivcurve #414

mikofski opened this issue Jan 31, 2018 · 3 comments
Labels
Milestone

Comments

@mikofski
Copy link
Member

the absolute tolerance to compare test and expected output is 3 in test_pvsystem.test_singlediode_floats_ivcurve which allows almost any values to pass:

e.g.:

>>> out['i_sc'], expected['i_sc']
(6.9651723221583133, 6.96467476139632)
>>> np.isclose(out['i_sc'], expected['i_sc'])
False
>>> np.isclose(out['i_sc'], expected['i_sc'], atol=3)
True
>>> out['v_oc'], expected['v_oc']
(8.1063001465863103, 8.106300146586308)
>>> out['v_mp'], expected['v_mp']
(6.2243393757884284, 6.221535886625464)
>>> out['i_mp'], expected['i_mp']
(6.1362673597376753, 6.13902517979357)
>>> out['i'], expected['i']
(array([  7.00000000e+00,   6.53439455e+00,   3.48054918e-14]),
 array([  6.96517200e+00,   6.75588200e+00,   2.57571700e-14]))
>>> out['v'], expected['v']
(array([-0.7       ,  5.5749351 ,  8.10630015]),
 array([ 0.     ,  4.05315,  8.1063 ]))

IMHO these tolerance should be closer to 1e-3 maybe, or maybe set rtol?

@adriesse
Copy link
Member

Looks like a serious typo! I vote for rtol.

@wholmgren wholmgren added this to the 0.5.2 milestone Jan 31, 2018
@wholmgren
Copy link
Member

Yes. Probably best to merge a fix for this before merging #409. Do you want to make the PR? I can do a quick one this afternoon if you want to stay focused on your current pvlib work.

@markcampanelli
Copy link
Contributor

Nice catch!

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

No branches or pull requests

4 participants