Changeset 847 for mystic


Ignore:
Timestamp:
12/12/15 11:35:11 (5 months ago)
Author:
mmckerns
Message:

slightly faster imports using imp

Location:
mystic
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • mystic/_math/integrate.py

    r776 r847  
    2626    scipy = True 
    2727    try:  
    28       from scipy.integrate import quad, dblquad, tplquad 
     28      import imp 
     29      imp.find_module('scipy') 
    2930    except ImportError: 
    3031      scipy = False 
  • mystic/mystic/_symbolic.py

    r839 r847  
    313313    if locals is None: locals = {} 
    314314    try: 
     315        import imp 
     316        imp.find_module('sympy') 
    315317        code = """from sympy import Eq, Symbol;""" 
    316318        code += """from sympy import solve as symsol;""" 
     
    483485    # if sympy not installed, return original constraints 
    484486    try: 
     487        import imp 
     488        imp.find_module('sympy') 
    485489        code = """from sympy import Eq, Symbol;""" 
    486490        code += """from sympy import solve as symsol;""" 
  • mystic/mystic/search.py

    r842 r847  
    8686            bestSol = tuple(_solver.bestSolution) 
    8787            bestRes = float(_solver.bestEnergy) 
    88             memo(*bestSol, out=l*bestRes) 
     88            memo(*bestSol, out=l*bestRes)  #FIXME: python2.5 
    8989        return memo 
    9090 
Note: See TracChangeset for help on using the changeset viewer.