Example #1
0
def require_numpy():
  global numpy
  if not numpy:
    try:
      import numpy
    except ImportError:
      error_missing_python_library("numpy")
Example #2
0
def require_scipy():
  require_numpy()
  global scipy
  if not scipy:
    try:
      import scipy
      import scipy.special
      import scipy.optimize
    except ImportError:
      error_missing_python_library("scipy")
Example #3
0
def require_mpmath():
  global mpmath
  if not mpmath:
    try:
      import mpmath
    except ImportError:
      error_missing_python_library("mpmath")
    
    if not hasattr(mpmath, 'besselj'):
      mpmath.besselj = mpmath.jn
    mpmath.mp.prec = 64