OSBModelValidation 0.2.18__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- OSBModelValidation-0.2.18.dist-info/METADATA +184 -0
- OSBModelValidation-0.2.18.dist-info/RECORD +98 -0
- OSBModelValidation-0.2.18.dist-info/WHEEL +5 -0
- OSBModelValidation-0.2.18.dist-info/entry_points.txt +2 -0
- OSBModelValidation-0.2.18.dist-info/top_level.txt +1 -0
- omv/__init__.py +8 -0
- omv/analyzers/__init__.py +21 -0
- omv/analyzers/activation.py +24 -0
- omv/analyzers/analyzer.py +80 -0
- omv/analyzers/dryrun.py +13 -0
- omv/analyzers/input_resistance.py +47 -0
- omv/analyzers/morphology.py +16 -0
- omv/analyzers/rates.py +97 -0
- omv/analyzers/resting.py +37 -0
- omv/analyzers/spikes.py +113 -0
- omv/analyzers/temperature.py +12 -0
- omv/analyzers/timeseries.py +57 -0
- omv/analyzers/utils/__init__.py +0 -0
- omv/analyzers/utils/filenode.py +73 -0
- omv/analyzers/utils/timeseries.py +293 -0
- omv/autogen.py +106 -0
- omv/common/__init__.py +0 -0
- omv/common/inout.py +154 -0
- omv/engines/__init__.py +53 -0
- omv/engines/arbor_.py +57 -0
- omv/engines/brian1.py +59 -0
- omv/engines/brian2_.py +57 -0
- omv/engines/eden_.py +63 -0
- omv/engines/engine.py +111 -0
- omv/engines/genesis.py +86 -0
- omv/engines/getarbor.py +15 -0
- omv/engines/getbrian1.py +42 -0
- omv/engines/getbrian2.py +17 -0
- omv/engines/geteden.py +17 -0
- omv/engines/getgenesis.py +56 -0
- omv/engines/getjlems.py +20 -0
- omv/engines/getjnml.py +48 -0
- omv/engines/getlibsbml.py +13 -0
- omv/engines/getmoose.py +15 -0
- omv/engines/getnest.py +62 -0
- omv/engines/getnetpyne.py +52 -0
- omv/engines/getneuroconstruct.py +31 -0
- omv/engines/getnml2.py +26 -0
- omv/engines/getnrn.py +60 -0
- omv/engines/getoctave.py +11 -0
- omv/engines/getpylems.py +13 -0
- omv/engines/getpyneuroml.py +14 -0
- omv/engines/getpynn.py +40 -0
- omv/engines/jlems.py +48 -0
- omv/engines/jneuroml.py +101 -0
- omv/engines/jneuromlbrian.py +65 -0
- omv/engines/jneuromlbrian2.py +61 -0
- omv/engines/jneuromleden.py +61 -0
- omv/engines/jneuromlmoose.py +63 -0
- omv/engines/jneuromlnetpyne.py +73 -0
- omv/engines/jneuromlnetpyne_np2.py +45 -0
- omv/engines/jneuromlnetpyne_np4.py +45 -0
- omv/engines/jneuromlnrn.py +78 -0
- omv/engines/jneuromlpynnnrn.py +75 -0
- omv/engines/jneuromlvalidate.py +62 -0
- omv/engines/jneuromlvalidatev1.py +58 -0
- omv/engines/moose_.py +86 -0
- omv/engines/nestsli.py +84 -0
- omv/engines/netpyne_.py +120 -0
- omv/engines/netpyne__np2.py +47 -0
- omv/engines/netpyne__np4.py +47 -0
- omv/engines/neuron_.py +205 -0
- omv/engines/octave.py +51 -0
- omv/engines/pylems.py +57 -0
- omv/engines/pylemsnml2.py +59 -0
- omv/engines/pynest.py +111 -0
- omv/engines/pyneuroconstruct.py +67 -0
- omv/engines/pyneuroml_.py +55 -0
- omv/engines/pyneuromlvalidatesbml.py +83 -0
- omv/engines/pyneuron.py +94 -0
- omv/engines/pynn.py +63 -0
- omv/engines/pynnbrian1.py +59 -0
- omv/engines/pynnbrian2.py +60 -0
- omv/engines/pynnnest.py +56 -0
- omv/engines/pynnneuroml.py +57 -0
- omv/engines/pynnneuron.py +94 -0
- omv/engines/utils/__init__.py +21 -0
- omv/engines/utils/genesis_utils.g +26 -0
- omv/engines/utils/wdir.py +15 -0
- omv/experiment.py +18 -0
- omv/find_tests.py +126 -0
- omv/omt_mep_parser.py +59 -0
- omv/omv_util.py +439 -0
- omv/parse_omt.py +118 -0
- omv/tally.py +112 -0
- omv/test/__init__.py +0 -0
- omv/test/test_rates.py +38 -0
- omv/test/test_types.py +29 -0
- omv/validation/__init__.py +0 -0
- omv/validation/rx_validator.py +35 -0
- omv/validation/utils.py +51 -0
- omv/validation/validate.py +53 -0
- omv/validation/validate_mep.py +15 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import subprocess as sp
|
|
3
|
+
|
|
4
|
+
from omv.engines.jneuroml import JNeuroMLEngine, EngineExecutionError
|
|
5
|
+
from omv.common.inout import inform, check_output
|
|
6
|
+
from omv.engines.engine import PATH_DELIMITER
|
|
7
|
+
from omv.engines.utils import resolve_paths
|
|
8
|
+
|
|
9
|
+
class JNeuroMLValidateEngine(JNeuroMLEngine):
|
|
10
|
+
name = "jNeuroML_validate"
|
|
11
|
+
|
|
12
|
+
@staticmethod
|
|
13
|
+
def is_installed():
|
|
14
|
+
return JNeuroMLEngine.is_installed()
|
|
15
|
+
|
|
16
|
+
@staticmethod
|
|
17
|
+
def install(version):
|
|
18
|
+
if not JNeuroMLEngine.is_installed():
|
|
19
|
+
JNeuroMLEngine.install(None)
|
|
20
|
+
|
|
21
|
+
JNeuroMLValidateEngine.path = JNeuroMLEngine.path
|
|
22
|
+
JNeuroMLValidateEngine.environment_vars = {}
|
|
23
|
+
JNeuroMLValidateEngine.environment_vars.update(JNeuroMLEngine.environment_vars)
|
|
24
|
+
|
|
25
|
+
def run(self):
|
|
26
|
+
try:
|
|
27
|
+
path_s = resolve_paths(self.modelpath)
|
|
28
|
+
|
|
29
|
+
inform(
|
|
30
|
+
"Path [%s] expanded to: %s" % (self.modelpath, path_s),
|
|
31
|
+
indent=1,
|
|
32
|
+
verbosity=1,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
from omv.engines.jneuroml import JNeuroMLEngine
|
|
36
|
+
|
|
37
|
+
jnml = JNeuroMLEngine.get_executable()
|
|
38
|
+
cmds = [jnml, "-validate"]
|
|
39
|
+
for p in path_s:
|
|
40
|
+
cmds.append(p)
|
|
41
|
+
|
|
42
|
+
inform(
|
|
43
|
+
"Running with %s, using: %s..." % (JNeuroMLValidateEngine.name, cmds),
|
|
44
|
+
indent=1,
|
|
45
|
+
)
|
|
46
|
+
self.stdout = check_output(
|
|
47
|
+
cmds,
|
|
48
|
+
cwd=os.path.dirname(self.modelpath.split(PATH_DELIMITER)[0]),
|
|
49
|
+
env=JNeuroMLEngine.get_environment(),
|
|
50
|
+
)
|
|
51
|
+
inform(
|
|
52
|
+
"Success with running ",
|
|
53
|
+
JNeuroMLValidateEngine.name,
|
|
54
|
+
indent=1,
|
|
55
|
+
verbosity=1,
|
|
56
|
+
)
|
|
57
|
+
self.returncode = 0
|
|
58
|
+
except sp.CalledProcessError as err:
|
|
59
|
+
inform("Error with ", JNeuroMLValidateEngine.name, indent=1, verbosity=1)
|
|
60
|
+
self.returncode = err.returncode
|
|
61
|
+
self.stdout = err.output
|
|
62
|
+
raise EngineExecutionError
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import subprocess as sp
|
|
3
|
+
|
|
4
|
+
from omv.engines.jneuroml import JNeuroMLEngine, EngineExecutionError
|
|
5
|
+
from omv.engines.jneuromlvalidate import resolve_paths
|
|
6
|
+
|
|
7
|
+
from omv.common.inout import inform
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class JNeuroMLValidateV1Engine(JNeuroMLEngine):
|
|
11
|
+
name = "jNeuroML_validatev1"
|
|
12
|
+
|
|
13
|
+
@staticmethod
|
|
14
|
+
def is_installed():
|
|
15
|
+
return JNeuroMLEngine.is_installed()
|
|
16
|
+
|
|
17
|
+
@staticmethod
|
|
18
|
+
def install(version):
|
|
19
|
+
if not JNeuroMLEngine.is_installed():
|
|
20
|
+
JNeuroMLEngine.install(None)
|
|
21
|
+
|
|
22
|
+
JNeuroMLValidateV1Engine.path = JNeuroMLEngine.path
|
|
23
|
+
JNeuroMLValidateV1Engine.environment_vars = {}
|
|
24
|
+
JNeuroMLValidateV1Engine.environment_vars.update(
|
|
25
|
+
JNeuroMLEngine.environment_vars
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
def run(self):
|
|
29
|
+
try:
|
|
30
|
+
path_s = resolve_paths(self.modelpath)
|
|
31
|
+
|
|
32
|
+
from omv.engines.jneuroml import JNeuroMLEngine
|
|
33
|
+
|
|
34
|
+
jnml = JNeuroMLEngine.get_executable()
|
|
35
|
+
cmds = [jnml, "-validatev1"]
|
|
36
|
+
for p in path_s:
|
|
37
|
+
cmds.append(p)
|
|
38
|
+
|
|
39
|
+
inform(
|
|
40
|
+
"Running with %s, using %s..." % (JNeuroMLValidateV1Engine.name, cmds),
|
|
41
|
+
indent=1,
|
|
42
|
+
)
|
|
43
|
+
self.stdout = sp.check_output(
|
|
44
|
+
cmds,
|
|
45
|
+
cwd=os.path.dirname(self.modelpath),
|
|
46
|
+
env=JNeuroMLEngine.get_environment(),
|
|
47
|
+
)
|
|
48
|
+
inform(
|
|
49
|
+
"Success with running ",
|
|
50
|
+
JNeuroMLValidateV1Engine.name,
|
|
51
|
+
indent=1,
|
|
52
|
+
verbosity=1,
|
|
53
|
+
)
|
|
54
|
+
self.returncode = 0
|
|
55
|
+
except sp.CalledProcessError as err:
|
|
56
|
+
self.returncode = err.returncode
|
|
57
|
+
self.stdout = err.output
|
|
58
|
+
raise EngineExecutionError
|
omv/engines/moose_.py
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import subprocess as sp
|
|
3
|
+
|
|
4
|
+
from omv.engines.pyneuroml_ import PyNeuroMLEngine
|
|
5
|
+
|
|
6
|
+
from omv.common.inout import inform, trim_path, check_output, is_verbose
|
|
7
|
+
from omv.engines.engine import OMVEngine, EngineExecutionError
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class MooseEngine(OMVEngine):
|
|
11
|
+
name = "Moose"
|
|
12
|
+
|
|
13
|
+
@staticmethod
|
|
14
|
+
def is_installed():
|
|
15
|
+
if is_verbose():
|
|
16
|
+
inform(
|
|
17
|
+
"Checking whether the engine %s has been installed correctly..."
|
|
18
|
+
% MooseEngine.name,
|
|
19
|
+
indent=1,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
ret = True
|
|
23
|
+
try:
|
|
24
|
+
ret_str = sp.check_output(
|
|
25
|
+
['python -c "import moose; print(moose.__version__)"'],
|
|
26
|
+
shell=True,
|
|
27
|
+
stderr=sp.STDOUT,
|
|
28
|
+
)
|
|
29
|
+
ret = len(ret_str) > 0
|
|
30
|
+
|
|
31
|
+
if isinstance(ret_str, bytes):
|
|
32
|
+
ret_str = ret_str.decode("utf-8").strip()
|
|
33
|
+
|
|
34
|
+
if ret and is_verbose():
|
|
35
|
+
inform(
|
|
36
|
+
"%s is correctly installed (%s)..." % (MooseEngine.name, ret_str),
|
|
37
|
+
indent=2,
|
|
38
|
+
)
|
|
39
|
+
if ret:
|
|
40
|
+
# import moose
|
|
41
|
+
ret = "v%s" % ret_str
|
|
42
|
+
|
|
43
|
+
except Exception as err:
|
|
44
|
+
if is_verbose():
|
|
45
|
+
inform("Couldn't import moose into Python: ", err, indent=1)
|
|
46
|
+
ret = False
|
|
47
|
+
if not ret or not PyNeuroMLEngine.is_installed():
|
|
48
|
+
ret = False
|
|
49
|
+
|
|
50
|
+
inform("Moose is_installed(): %s" % ret, "", indent=1, verbosity=2)
|
|
51
|
+
return ret
|
|
52
|
+
|
|
53
|
+
@staticmethod
|
|
54
|
+
def install(version):
|
|
55
|
+
if not PyNeuroMLEngine.is_installed():
|
|
56
|
+
PyNeuroMLEngine.install(None)
|
|
57
|
+
inform(
|
|
58
|
+
"%s installed PyNeuroML..." % MooseEngine.name, indent=2, verbosity=1
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
from omv.engines.getmoose import install_moose
|
|
62
|
+
|
|
63
|
+
home = os.environ["HOME"]
|
|
64
|
+
inform("Will fetch and install the latest Moose..", indent=2)
|
|
65
|
+
install_moose(version)
|
|
66
|
+
inform("Done, Moose is correctly installed...", indent=2)
|
|
67
|
+
|
|
68
|
+
def run(self):
|
|
69
|
+
try:
|
|
70
|
+
inform(
|
|
71
|
+
"Running file %s with %s" % (trim_path(self.modelpath), self.name),
|
|
72
|
+
indent=1,
|
|
73
|
+
)
|
|
74
|
+
self.stdout = check_output(
|
|
75
|
+
["python", self.modelpath, "-nogui"],
|
|
76
|
+
cwd=os.path.dirname(self.modelpath),
|
|
77
|
+
)
|
|
78
|
+
self.returncode = 0
|
|
79
|
+
except sp.CalledProcessError as err:
|
|
80
|
+
self.returncode = err.returncode
|
|
81
|
+
self.stdout = err.output
|
|
82
|
+
raise EngineExecutionError
|
|
83
|
+
except Exception as err:
|
|
84
|
+
inform("Another error with running %s: " % self.name, err, indent=1)
|
|
85
|
+
self.returncode = -1
|
|
86
|
+
self.stdout = "???"
|
omv/engines/nestsli.py
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
import subprocess as sp
|
|
5
|
+
|
|
6
|
+
from omv.common.inout import inform, trim_path, check_output, is_verbose
|
|
7
|
+
from omv.engines.engine import OMVEngine, EngineExecutionError
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class NestEngine(OMVEngine):
|
|
11
|
+
name = "NEST"
|
|
12
|
+
|
|
13
|
+
@staticmethod
|
|
14
|
+
def get_nest_environment():
|
|
15
|
+
nestpath = os.path.join(os.environ["HOME"], "nest/nest/")
|
|
16
|
+
if "NEST_INSTALL_DIR" in os.environ:
|
|
17
|
+
nestpath = os.environ["NEST_INSTALL_DIR"] + "/"
|
|
18
|
+
elif "NEST_HOME" in os.environ:
|
|
19
|
+
nestpath = os.environ["NEST_HOME"] + "/"
|
|
20
|
+
|
|
21
|
+
environment_vars = {
|
|
22
|
+
"NEST_HOME": nestpath,
|
|
23
|
+
"PYTHONPATH": nestpath
|
|
24
|
+
+ "/lib/python%s.%s/site-packages/"
|
|
25
|
+
% (sys.version_info.major, sys.version_info.minor),
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return environment_vars
|
|
29
|
+
|
|
30
|
+
@staticmethod
|
|
31
|
+
def is_installed():
|
|
32
|
+
ret = True
|
|
33
|
+
environment_vars = NestEngine.get_nest_environment()
|
|
34
|
+
try:
|
|
35
|
+
FNULL = open(os.devnull, "w")
|
|
36
|
+
|
|
37
|
+
r = check_output(
|
|
38
|
+
[environment_vars["NEST_HOME"] + "bin/nest", "-v"], verbosity=2
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
ret = "%s" % r.split("version")[1].split()[0][:-1]
|
|
42
|
+
if "-" in ret:
|
|
43
|
+
ret = "v%s" % ret.split("-")[-1]
|
|
44
|
+
|
|
45
|
+
if not "v" in ret:
|
|
46
|
+
ret = "v%s" % ret
|
|
47
|
+
|
|
48
|
+
inform("NEST %s is correctly installed..." % ret, indent=2, verbosity=1)
|
|
49
|
+
|
|
50
|
+
except OSError as err:
|
|
51
|
+
if is_verbose():
|
|
52
|
+
inform("Couldn't execute NEST: ", err, indent=1)
|
|
53
|
+
ret = False
|
|
54
|
+
return ret
|
|
55
|
+
|
|
56
|
+
@staticmethod
|
|
57
|
+
def install(version):
|
|
58
|
+
from omv.engines.getnest import install_nest
|
|
59
|
+
|
|
60
|
+
install_nest(version)
|
|
61
|
+
inform("Done...", indent=2)
|
|
62
|
+
|
|
63
|
+
def run(self):
|
|
64
|
+
self.environment_vars = NestEngine.get_nest_environment()
|
|
65
|
+
self.set_environment()
|
|
66
|
+
|
|
67
|
+
try:
|
|
68
|
+
inform(
|
|
69
|
+
"Running file %s with %s" % (trim_path(self.modelpath), self.name),
|
|
70
|
+
indent=1,
|
|
71
|
+
)
|
|
72
|
+
self.stdout = check_output(
|
|
73
|
+
[self.environment_vars["NEST_HOME"] + "bin/nest", self.modelpath],
|
|
74
|
+
cwd=os.path.dirname(self.modelpath),
|
|
75
|
+
)
|
|
76
|
+
self.returncode = 0
|
|
77
|
+
except sp.CalledProcessError as err:
|
|
78
|
+
self.returncode = err.returncode
|
|
79
|
+
self.stdout = err.output
|
|
80
|
+
raise EngineExecutionError
|
|
81
|
+
except Exception as err:
|
|
82
|
+
inform("Another error with running %s: " % self.name, err, indent=1)
|
|
83
|
+
self.returncode = -1
|
|
84
|
+
self.stdout = "???"
|
omv/engines/netpyne_.py
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import subprocess as sp
|
|
3
|
+
|
|
4
|
+
from omv.engines.pyneuron import PyNRNEngine
|
|
5
|
+
from omv.engines.pyneuroml_ import PyNeuroMLEngine
|
|
6
|
+
|
|
7
|
+
from omv.common.inout import inform, trim_path, check_output, is_verbose
|
|
8
|
+
from omv.engines.engine import OMVEngine, EngineExecutionError
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class NetPyNEEngine(OMVEngine):
|
|
12
|
+
name = "NetPyNE"
|
|
13
|
+
|
|
14
|
+
@staticmethod
|
|
15
|
+
def is_installed(silent=True):
|
|
16
|
+
if is_verbose():
|
|
17
|
+
inform(
|
|
18
|
+
"Checking whether the engine %s has been installed correctly..."
|
|
19
|
+
% NetPyNEEngine.name,
|
|
20
|
+
indent=1,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
ret = True
|
|
24
|
+
try:
|
|
25
|
+
ret_str = sp.check_output(
|
|
26
|
+
['python -c "import netpyne; print(netpyne.__version__)"'],
|
|
27
|
+
shell=True,
|
|
28
|
+
stderr=sp.STDOUT,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
ret = len(ret_str) > 0
|
|
32
|
+
|
|
33
|
+
if isinstance(ret_str, bytes):
|
|
34
|
+
ret_str = ret_str.decode("utf-8")
|
|
35
|
+
|
|
36
|
+
ret_str = ret_str.strip().split("\n")[
|
|
37
|
+
-1
|
|
38
|
+
] # in case multiple lines (with warning) returned
|
|
39
|
+
|
|
40
|
+
if ret and is_verbose():
|
|
41
|
+
inform("%s is correctly installed..." % (NetPyNEEngine.name), indent=2)
|
|
42
|
+
|
|
43
|
+
if ret:
|
|
44
|
+
ret = "v%s" % str(ret_str.strip())
|
|
45
|
+
|
|
46
|
+
except Exception as err:
|
|
47
|
+
if not silent:
|
|
48
|
+
inform("Couldn't import netpyne into Python: ", err, indent=1)
|
|
49
|
+
ret = False
|
|
50
|
+
|
|
51
|
+
if not PyNRNEngine.is_installed() or not PyNeuroMLEngine.is_installed():
|
|
52
|
+
ret = False
|
|
53
|
+
|
|
54
|
+
if not silent:
|
|
55
|
+
inform("NetPyNE is_installed: %s" % ret, "", indent=1)
|
|
56
|
+
return ret
|
|
57
|
+
|
|
58
|
+
@staticmethod
|
|
59
|
+
def install(version):
|
|
60
|
+
if not PyNRNEngine.is_installed():
|
|
61
|
+
PyNRNEngine.install(None)
|
|
62
|
+
inform(
|
|
63
|
+
"%s installed PyNEURON..." % NetPyNEEngine.name, indent=2, verbosity=1
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
if not PyNeuroMLEngine.is_installed():
|
|
67
|
+
PyNeuroMLEngine.install(None)
|
|
68
|
+
inform(
|
|
69
|
+
"%s installed PyNeuroML..." % NetPyNEEngine.name, indent=2, verbosity=1
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
from omv.engines.getnetpyne import install_netpyne
|
|
73
|
+
|
|
74
|
+
home = os.environ["HOME"]
|
|
75
|
+
inform("Will fetch and install the latest NetPyNE..", indent=2)
|
|
76
|
+
install_netpyne()
|
|
77
|
+
inform("Done, NetPyNE is correctly installed...", indent=2)
|
|
78
|
+
|
|
79
|
+
NetPyNEEngine.path = PyNRNEngine.path
|
|
80
|
+
NetPyNEEngine.environment_vars = {}
|
|
81
|
+
NetPyNEEngine.environment_vars.update(PyNRNEngine.environment_vars)
|
|
82
|
+
|
|
83
|
+
inform("PATH: " + NetPyNEEngine.path, indent=2, verbosity=1)
|
|
84
|
+
inform("Env vars: %s" % NetPyNEEngine.environment_vars, indent=2, verbosity=1)
|
|
85
|
+
|
|
86
|
+
environment_vars, path = PyNRNEngine.get_nrn_environment()
|
|
87
|
+
inform(
|
|
88
|
+
"Using NEURON with env %s at %s..." % (environment_vars, path),
|
|
89
|
+
indent=2,
|
|
90
|
+
verbosity=1,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
# print(check_output([environment_vars['NEURON_HOME']+'/bin/nrnivmodl'], cwd=pynn_mod_dir)
|
|
94
|
+
|
|
95
|
+
def run(self):
|
|
96
|
+
try:
|
|
97
|
+
self.stdout = PyNRNEngine.compile_modfiles(self.modelpath)
|
|
98
|
+
except sp.CalledProcessError as err:
|
|
99
|
+
self.stderr = err.output
|
|
100
|
+
self.returncode = err.returncode
|
|
101
|
+
inform("Error compiling modfiles:", self.stderr, indent=2)
|
|
102
|
+
|
|
103
|
+
try:
|
|
104
|
+
inform(
|
|
105
|
+
"Running file %s with %s" % (trim_path(self.modelpath), self.name),
|
|
106
|
+
indent=1,
|
|
107
|
+
)
|
|
108
|
+
self.stdout = check_output(
|
|
109
|
+
["python", self.modelpath, "-nogui"],
|
|
110
|
+
cwd=os.path.dirname(self.modelpath),
|
|
111
|
+
)
|
|
112
|
+
self.returncode = 0
|
|
113
|
+
except sp.CalledProcessError as err:
|
|
114
|
+
self.returncode = err.returncode
|
|
115
|
+
self.stdout = err.output
|
|
116
|
+
raise EngineExecutionError
|
|
117
|
+
except Exception as err:
|
|
118
|
+
inform("Another error with running %s: " % self.name, err, indent=1)
|
|
119
|
+
self.returncode = -1
|
|
120
|
+
self.stdout = "???"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import subprocess as sp
|
|
3
|
+
|
|
4
|
+
from omv.engines.pyneuron import PyNRNEngine
|
|
5
|
+
from omv.engines.netpyne_ import NetPyNEEngine
|
|
6
|
+
|
|
7
|
+
from omv.common.inout import inform, trim_path, check_output
|
|
8
|
+
from omv.engines.engine import EngineExecutionError
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
A temporary engine for testing running NetPyNE models in parallel mode.
|
|
12
|
+
Would require update of NEURON installation process to ensure parallel
|
|
13
|
+
NEURON correctly installed, so mainly useful for local testing presently.
|
|
14
|
+
Would also be better to incorporate this into netpyne_.py, and have correct
|
|
15
|
+
handling of variables specified in *.omt files
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class NetPyNENP2Engine(NetPyNEEngine):
|
|
20
|
+
name = "NetPyNE_NP2"
|
|
21
|
+
|
|
22
|
+
def run(self):
|
|
23
|
+
try:
|
|
24
|
+
self.stdout = PyNRNEngine.compile_modfiles(self.modelpath)
|
|
25
|
+
except sp.CalledProcessError as err:
|
|
26
|
+
self.stderr = err.output
|
|
27
|
+
self.returncode = err.returncode
|
|
28
|
+
inform("Error compiling modfiles:", self.stderr, indent=2)
|
|
29
|
+
|
|
30
|
+
try:
|
|
31
|
+
inform(
|
|
32
|
+
"Running file %s with %s" % (trim_path(self.modelpath), self.name),
|
|
33
|
+
indent=1,
|
|
34
|
+
)
|
|
35
|
+
self.stdout = check_output(
|
|
36
|
+
["mpiexec", "-np", "2", "nrniv", "-mpi", self.modelpath, "-nogui"],
|
|
37
|
+
cwd=os.path.dirname(self.modelpath),
|
|
38
|
+
)
|
|
39
|
+
self.returncode = 0
|
|
40
|
+
except sp.CalledProcessError as err:
|
|
41
|
+
self.returncode = err.returncode
|
|
42
|
+
self.stdout = err.output
|
|
43
|
+
raise EngineExecutionError
|
|
44
|
+
except Exception as err:
|
|
45
|
+
inform("Another error with running %s: " % self.name, err, indent=1)
|
|
46
|
+
self.returncode = -1
|
|
47
|
+
self.stdout = "???"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import subprocess as sp
|
|
3
|
+
|
|
4
|
+
from omv.engines.pyneuron import PyNRNEngine
|
|
5
|
+
from omv.engines.netpyne_ import NetPyNEEngine
|
|
6
|
+
|
|
7
|
+
from omv.common.inout import inform, trim_path, check_output
|
|
8
|
+
from omv.engines.engine import EngineExecutionError
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
A temporary engine for testing running NetPyNE models in parallel mode.
|
|
12
|
+
Would require update of NEURON installation process to ensure parallel
|
|
13
|
+
NEURON correctly installed, so mainly useful for local testing presently.
|
|
14
|
+
Would also be better to incorporate this into netpyne_.py, and have correct
|
|
15
|
+
handling of variables specified in *.omt files
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class NetPyNENP4Engine(NetPyNEEngine):
|
|
20
|
+
name = "NetPyNE_NP4"
|
|
21
|
+
|
|
22
|
+
def run(self):
|
|
23
|
+
try:
|
|
24
|
+
self.stdout = PyNRNEngine.compile_modfiles(self.modelpath)
|
|
25
|
+
except sp.CalledProcessError as err:
|
|
26
|
+
self.stderr = err.output
|
|
27
|
+
self.returncode = err.returncode
|
|
28
|
+
inform("Error compiling modfiles:", self.stderr, indent=2)
|
|
29
|
+
|
|
30
|
+
try:
|
|
31
|
+
inform(
|
|
32
|
+
"Running file %s with %s" % (trim_path(self.modelpath), self.name),
|
|
33
|
+
indent=1,
|
|
34
|
+
)
|
|
35
|
+
self.stdout = check_output(
|
|
36
|
+
["mpiexec", "-np", "4", "nrniv", "-mpi", self.modelpath, "-nogui"],
|
|
37
|
+
cwd=os.path.dirname(self.modelpath),
|
|
38
|
+
)
|
|
39
|
+
self.returncode = 0
|
|
40
|
+
except sp.CalledProcessError as err:
|
|
41
|
+
self.returncode = err.returncode
|
|
42
|
+
self.stdout = err.output
|
|
43
|
+
raise EngineExecutionError
|
|
44
|
+
except Exception as err:
|
|
45
|
+
inform("Another error with running %s: " % self.name, err, indent=1)
|
|
46
|
+
self.returncode = -1
|
|
47
|
+
self.stdout = "???"
|