8000 BUG: fix brentq doesn't raise error in singlediode (#556) · aliyevsultan/pvlib-python@affc1bf · GitHub
[go: up one dir, main page]

Skip to content

Commit affc1bf

Browse files
mikofskiwholmgren
authored andcommitted
BUG: fix brentq doesn't raise error in singlediode (pvlib#556)
* if `brentq` is called in `singlediode.py` but no SciPy, then should raise an exception * currently using `NotImplemented` raises TypeError: 'NotImplementedType' object is not callable because `NotImplemented` is a constant
1 parent 45109de commit affc1bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pvlib/singlediode.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
try:
1414
from scipy.optimize import brentq
1515
except ImportError:
16-
brentq = NotImplemented
16+
def brentq(): raise NotImplementedError(
17+
"brentq can't be imported because scipy isn't installed")
1718

1819
# FIXME: change this to newton when scipy-1.2 is released
1920
try:

0 commit comments

Comments
 (0)
0