def run(self): np = 2 try: inform("Running file %s with %s" % (trim_path(self.modelpath), JNeuroMLNetPyNEEngine.name), indent=1) from omv.engines.jneuroml import JNeuroMLEngine jnml = JNeuroMLEngine.get_executable() self.stdout = check_output([ jnml, self.modelpath, '-netpyne', '-nogui', '-run', '-np', '%s' % np ], cwd=os.path.dirname(self.modelpath), env=JNeuroMLEngine.get_environment()) inform("Success with running ", JNeuroMLNetPyNEEngine.name, indent=1) self.returncode = 0 except sp.CalledProcessError as err: inform("Error with ", JNeuroMLNetPyNEEngine.name, indent=1) self.returncode = err.returncode self.stdout = err.output raise EngineExecutionError
def run(self): try: path_s = resolve_paths(self.modelpath) from omv.engines.jneuroml import JNeuroMLEngine jnml = JNeuroMLEngine.get_executable() cmds = [jnml, '-validatev1'] for p in path_s: cmds.append(p) inform("Running with %s, using %s..." % (JNeuroMLValidateV1Engine.name, cmds), indent=1) self.stdout = sp.check_output(cmds, cwd=os.path.dirname(self.modelpath), env=JNeuroMLEngine.get_environment()) inform("Success with running ", JNeuroMLValidateV1Engine.name, indent=1, verbosity=1) self.returncode = 0 except sp.CalledProcessError as err: self.returncode = err.returncode self.stdout = err.output raise EngineExecutionError
def run(self): try: inform("Running file %s with %s" % (trim_path(self.modelpath), JNeuroMLBrianEngine.name), indent=1) from omv.engines.jneuroml import JNeuroMLEngine jnml = JNeuroMLEngine.get_executable() self.stdout = check_output([jnml, self.modelpath, '-brian'], cwd=os.path.dirname(self.modelpath),env=JNeuroMLEngine.get_environment()) self.stdout += check_output(['python', self.modelpath.replace('.xml', '_brian.py'), '-nogui'], cwd=os.path.dirname(self.modelpath)) inform("Success with running ", JNeuroMLBrianEngine.name, indent=1) self.returncode = 0 except sp.CalledProcessError as err: inform("Error with ", JNeuroMLBrianEngine.name, indent=1) self.returncode = err.returncode self.stdout = err.output raise EngineExecutionError
def run_using_jnmlnrn_env(engine, modelpath, args): try: env = JNeuroMLNRNEngine.get_jnmlnrnenv() inform("Running file %s with %s, env: %s" % (trim_path(modelpath), engine, env), indent=1) from omv.engines.jneuroml import JNeuroMLEngine jnml = JNeuroMLEngine.get_executable() cmds = [jnml, modelpath] cmds.extend(args) stdout = check_output(cmds, cwd=os.path.dirname(modelpath), env=env) inform("Success with running ", engine, indent=1) returncode = 0 return stdout, returncode except sp.CalledProcessError as err: inform("Error with ", engine, indent=1) returncode = err.returncode stdout = err.output return stdout, returncode