Commit 22301027 authored by Pablo Piskunow's avatar Pablo Piskunow
Browse files

add global variable to check the scipy version.

parent c024d7e0
Pipeline #5183 failed with stages
in 2 minutes and 42 seconds
......@@ -21,6 +21,8 @@ from .operator import _LocalOperator
__all__ = ['SpectralDensity', 'LocalSpectralDensity', 'TimeSpectralDensity']
ENABLE_IVP = True if float(scipy.__version__[0]) > 0 else False
class SpectralDensity:
"""Calculate the spectral density of an operator.
......@@ -583,6 +585,10 @@ class TimeSpectralDensity(SpectralDensity):
kernel='J', accumulate=True, save_vectors=False,
time_interval=None, time_points=None, method='pade'):
if method == 'ivp' and ENABLE_IVP is False:
raise ValueError("Scipy version 1.0 or greater is needed "
"for the 'ivp' method.")
# accumulate is temporarily not implemented in this subclass
self.accumulate = False # override accumulate
self.method = method
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment