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
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
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
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