Пример #1
0
    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 get_jnmlnrnenv():

        environment_vars_nrn, path_nrn = NeuronEngine.get_nrn_environment()

        JNeuroMLNRNEngine.path = JNeuroMLEngine.path + \
            ":" + path_nrn
        JNeuroMLNRNEngine.environment_vars = {}
        JNeuroMLNRNEngine.environment_vars.update(
            JNeuroMLEngine.environment_vars)
        JNeuroMLNRNEngine.environment_vars.update(environment_vars_nrn)

        JNeuroMLNRNEngine.environment_vars.update(
            JNeuroMLEngine.get_environment())

        inform("PATH: " + JNeuroMLNRNEngine.path)
        inform("Env vars: %s" % JNeuroMLNRNEngine.environment_vars)
        del JNeuroMLNRNEngine.environment_vars['PYTHONPATH']

        return JNeuroMLNRNEngine.environment_vars
 def run(self):
     try:
         inform("Running file %s with %s" %
                (trim_path(self.modelpath), JNeuroMLBrian2Engine.name),
                indent=1)
         from omv.engines.jneuroml import JNeuroMLEngine
         jnml = JNeuroMLEngine.get_executable()
         self.stdout = check_output([jnml, self.modelpath, '-brian2'],
                                    cwd=os.path.dirname(self.modelpath),
                                    env=JNeuroMLEngine.get_environment())
         self.stdout += check_output([
             'python',
             self.modelpath.replace('.xml', '_brian2.py'), '-nogui'
         ],
                                     cwd=os.path.dirname(self.modelpath))
         inform("Success with running ",
                JNeuroMLBrian2Engine.name,
                indent=1)
         self.returncode = 0
     except sp.CalledProcessError as err:
         inform("Error with ", JNeuroMLBrian2Engine.name, indent=1)
         self.returncode = err.returncode
         self.stdout = err.output
         raise EngineExecutionError