예제 #1
0
파일: moose.py 프로젝트: hrani/moose-core
def mooseReadSBML(filepath, loadpath, solver='ee',validate="on"):
    """Load SBML model.

    Parameter
    --------
    filepath: str
        filepath to be loaded.
    loadpath : str 
        Root path for this model e.g. /model/mymodel
    solver : str
        Solver to use (default 'ee').
        Available options are "ee", "gsl", "stochastic", "gillespie"
            "rk", "deterministic" 
            For full list see ??
    """
    global sbmlImport_
    if sbmlImport_:
        modelpath = _readSBML.mooseReadSBML(filepath, loadpath, solver, validate)
        sc = solver.lower()
        if sc in ["gssa","gillespie","stochastic","gsolve"]:
            method = "gssa"
        elif sc in ["gsl","runge kutta","deterministic","ksolve","rungekutta","rk5","rkf","rk"]:
            method = "gsl"
        elif sc in ["exponential euler","exponentialeuler","neutral"]:
            method = "ee"
        else:
            method = "ee"

        if method != 'ee':
            chemError = _chemUtil.add_Delete_ChemicalSolver.mooseAddChemSolver(modelpath[0].path, method)

        return modelpath
    else:
        print( sbmlError_ )
        return False
예제 #2
0
파일: moose.py 프로젝트: AdrianW15/moose
def mooseReadSBML(filepath, loadpath, solver='ee'):
    """Load SBML model.

    keyword arguments: \n

    filepath -- filepath to be loaded \n
    loadpath -- Root path for this model e.g. /model/mymodel \n
    solver   -- Solver to use (default 'ee' ) \n

    """
    global sbmlImport_
    if sbmlImport_:
        return _readSBML.mooseReadSBML( filepath, loadpath, solver )
    else:
        print( sbmlError_ )
        return False
예제 #3
0
def mooseReadSBML(filepath, loadpath, solver='ee'):
    """Load SBML model.

    keyword arguments: \n

    filepath -- filepath to be loaded \n
    loadpath -- Root path for this model e.g. /model/mymodel \n
    solver   -- Solver to use (default 'ee' ) \n

    """
    global sbmlImport_
    if sbmlImport_:
        return _readSBML.mooseReadSBML( filepath, loadpath, solver )
    else:
        print( sbmlError_ )
        return False
예제 #4
0
def mooseReadSBML(filepath, loadpath, solver="ee", validate="on"):
    """Load SBML model (inner helper function for readSBML)."""
    global sbmlImport_, sbmlError_
    if not sbmlImport_:
        raise ImportError("SBML support could not be loaded because of '%s'" %
                          sbmlError_)

    modelpath = _readSBML.mooseReadSBML(filepath, loadpath, solver, validate)
    sc = solver.lower().replace(" ", "")
    if sc in ["gssa", "gillespie", "stochastic", "gsolve"]:
        method = "gssa"
    elif sc in ["gsl", "deterministic", "rungekutta", "rk5", "rk"]:
        method = "gsl"
    else:
        method = "ee"

    if method != "ee":
        _chemUtil.add_Delete_ChemicalSolver.mooseAddChemSolver(
            modelpath[0].path, method)
    return modelpath
예제 #5
0
def mooseReadSBML(filepath, loadpath, solver='ee', validate="on"):
    """Load SBML model.

    Parameter
    --------
    filepath: str
        filepath to be loaded.
    loadpath : str 
        Root path for this model e.g. /model/mymodel
    solver : str
        Solver to use (default 'ee').
        Available options are "ee", "gsl", "stochastic", "gillespie"
            "rk", "deterministic" 
            For full list see ??
    """
    global sbmlImport_
    if sbmlImport_:
        modelpath = _readSBML.mooseReadSBML(filepath, loadpath, solver,
                                            validate)
        sc = solver.lower()
        if sc in ["gssa", "gillespie", "stochastic", "gsolve"]:
            method = "gssa"
        elif sc in [
                "gsl", "runge kutta", "deterministic", "ksolve", "rungekutta",
                "rk5", "rkf", "rk"
        ]:
            method = "gsl"
        elif sc in ["exponential euler", "exponentialeuler", "neutral"]:
            method = "ee"
        else:
            method = "ee"

        if method != 'ee':
            chemError = _chemUtil.add_Delete_ChemicalSolver.mooseAddChemSolver(
                modelpath[0].path, method)

        return modelpath
    else:
        print(sbmlError_)
        return False