Skip to content

Commit

Permalink
Merge pull request #82 from OpenSourceBrain/test_arbor_eden
Browse files Browse the repository at this point in the history
Improved EDEN support
  • Loading branch information
pgleeson authored Apr 26, 2022
2 parents 968e2e1 + 3c9b5f8 commit 9a51c15
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
- jLEMS
- jNeuroML
- jNeuroML_Brian2
- jNeuroML_EDEN
- jNeuroML_NEURON
- jNeuroML_NetPyNE
- jNeuroML_PyNN_NEURON
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,5 @@ report*.txt
/getmoose
/envpy*
*_moose.py
/utilities/tests/*.gen.c
/utilities/tests/*_eden.py
1 change: 1 addition & 0 deletions omv/engines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from omv.engines.jneuromlnetpyne_np4 import JNeuroMLNetPyNENP4Engine
from omv.engines.jneuromlnetpyne_np2 import JNeuroMLNetPyNENP2Engine
#from omv.engines.jneuromlbrian import JNeuroMLBrianEngine
from omv.engines.jneuromleden import JNeuroMLEdenEngine
from omv.engines.jneuromlbrian2 import JNeuroMLBrian2Engine
from omv.engines.jneuromlmoose import JNeuroMLMooseEngine
from omv.engines.jneuromlvalidate import JNeuroMLValidateEngine
Expand Down
4 changes: 3 additions & 1 deletion omv/engines/eden_.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ def install(version):

def run(self):
try:
inform("Running a file %s with sim %s" % (trim_path(self.modelpath), self.name), indent=1)
inform("Running a file %s with the simulator %s" % (trim_path(self.modelpath), self.name), indent=1)

self.stdout = check_output(['python', self.modelpath],
cwd=os.path.dirname(self.modelpath))

self.returncode = 0
except sp.CalledProcessError as err:
self.returncode = err.returncode
Expand Down
2 changes: 1 addition & 1 deletion omv/engines/getjnml.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def install_jnml():

version='v0.11.1_pre'
version='v0.11.1_pre2'

jnmlpath = os.path.join(os.environ['HOME'],'jnml')
if not os.path.isdir(jnmlpath):
Expand Down
52 changes: 52 additions & 0 deletions omv/engines/jneuromleden.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import os
import subprocess as sp

from omv.engines.jneuroml import JNeuroMLEngine
from omv.engines.eden_ import EdenEngine
from omv.common.inout import inform, trim_path, check_output, is_verbose
from omv.engines.engine import EngineExecutionError


class JNeuroMLEdenEngine(JNeuroMLEngine):

name = "jNeuroML_EDEN"

@staticmethod
def is_installed(version):
if is_verbose():
inform("Checking whether %s is installed..." %
JNeuroMLEdenEngine.name, indent=1)
return JNeuroMLEngine.is_installed(None) and EdenEngine.is_installed(None)

@staticmethod
def install(version):

if not JNeuroMLEngine.is_installed(None):
JNeuroMLEngine.install(None)
if not EdenEngine.is_installed(None):
EdenEngine.install(None)

JNeuroMLEdenEngine.path = JNeuroMLEngine.path + \
":" + EdenEngine.path
JNeuroMLEdenEngine.environment_vars = {}
JNeuroMLEdenEngine.environment_vars.update(
JNeuroMLEngine.environment_vars)
JNeuroMLEdenEngine.environment_vars.update(
EdenEngine.environment_vars)
inform("PATH: " + JNeuroMLEdenEngine.path)
inform("Env vars: %s" % JNeuroMLEdenEngine.environment_vars)

def run(self):
try:
inform("Running file %s with %s" % (trim_path(self.modelpath), JNeuroMLEdenEngine.name), indent=1)
from omv.engines.jneuroml import JNeuroMLEngine
jnml = JNeuroMLEngine.get_executable()
self.stdout = check_output([jnml, self.modelpath, '-eden'], cwd=os.path.dirname(self.modelpath),env=JNeuroMLEngine.get_environment())
self.stdout += check_output(['python', self.modelpath.replace('.xml', '_eden.py')], cwd=os.path.dirname(self.modelpath))
inform("Success with running ", JNeuroMLEdenEngine.name, indent=1)
self.returncode = 0
except sp.CalledProcessError as err:
inform("Error with ", JNeuroMLEdenEngine.name, indent=1)
self.returncode = err.returncode
self.stdout = err.output
raise EngineExecutionError
2 changes: 0 additions & 2 deletions utilities/tests/.test.brian.omt

This file was deleted.

17 changes: 17 additions & 0 deletions utilities/tests/.test.ex5.jnmleden.omt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Script for running automated tests on OSB using Travis-CI, see https://github.com/OpenSourceBrain/osb-model-validation

target: LEMS_NML2_Ex5_DetCell.xml
engine: jNeuroML_EDEN
mep: .test.ex5.mep
experiments:
v:
observables:
spike times:
file:
path: ex5_v.dat
columns: [0,1]
scaling: [1000, 1000]
spike detection:
method: threshold
threshold: 0
tolerance: 0.001963746223565029
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Script for running automated tests on OSB using Travis-CI, see https://github.com/OpenSourceBrain/osb-model-validation
target: LEMS_NML2_Ex9_FN.xml
engine: jNeuroML_Brian

target: LEMS_NML2_Ex9_FN.xml
engine: jNeuroML_EDEN
mep: .test.ex9.mep
experiments:
V:
observables:
spike times:
file:
file:
path: ex9.dat
columns: [0,1]
scaling: [1000, 1000]
spike detection:
spike detection:
method: derivative
tolerance: 0.004099
tolerance: 4.098360645390339e-08
W:
observables:
spike times:
file:
file:
path: ex9.dat
columns: [0,2]
scaling: [1000, 1]
spike detection:
spike detection:
method: derivative
tolerance: 0.000616
tolerance: 5.0276520911579816e-8
16 changes: 16 additions & 0 deletions utilities/tests/.test.exIzh.jnmleden.omt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Script for running automated tests on OSB using Travis-CI, see https://github.com/OpenSourceBrain/osb-model-validation

target: LEMS_2007One.xml
engine: jNeuroML_EDEN
mep: .test.exIzh.mep
experiments:
v:
observables:
spike times:
file:
path: exIzh.dat
columns: [0,1]
scaling: [1000, 1000]
spike detection:
method: threshold
tolerance: 0.00014888369126089628
2 changes: 0 additions & 2 deletions utilities/tests/.test.pynn.brian.omt

This file was deleted.

0 comments on commit 9a51c15

Please sign in to comment.