From 65938f7647d6445c590870e3d9e72415970af6f8 Mon Sep 17 00:00:00 2001 From: Mark Mikofski Date: Tue, 4 Sep 2018 10:03:49 -0700 Subject: [PATCH] BUG: fix brentq doesn't raise error in singlediode * 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 --- pvlib/singlediode.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pvlib/singlediode.py b/pvlib/singlediode.py index cb5b8e6b13..d0ad27e995 100644 --- a/pvlib/singlediode.py +++ b/pvlib/singlediode.py @@ -13,7 +13,8 @@ try: from scipy.optimize import brentq except ImportError: - brentq = NotImplemented + def brentq(): raise NotImplementedError( + "brentq can't be imported because scipy isn't installed") # FIXME: change this to newton when scipy-1.2 is released try: