Skip to content

Commit 9410aa5

Browse files
authored
Merge pull request #134 from OpenSourceBrain/test_jnml
To v0.3.6 & ruff formatting
2 parents a9ad8dc + a233072 commit 9410aa5

33 files changed

+93
-132
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
pip install .
6666
pip install scipy sympy matplotlib cython pandas tables
6767
#sudo apt install octave
68+
sudo apt-get install -y subversion # for neuroConstruct full install...
6869
6970
- name: Run OMV tests on engine ${{ matrix.engine }}
7071
run: |

omv/autogen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def read_option(options, default=0):
2727
opt = None
2828
while opt is None:
2929
try:
30-
sel = int(raw_input("Select option number [default: %s]: " % default))
30+
sel = int(input("Select option number [default: %s]: " % default))
3131
opt = options[sel]
3232
except IndexError:
3333
print("invalid index!")

omv/common/inout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def check_output(cmds, cwd=".", shell=False, verbosity=0, env=None):
103103
if env:
104104
joint_env.update(env)
105105
for k in os.environ:
106-
if not k in joint_env:
106+
if k not in joint_env:
107107
joint_env[k] = os.environ[k]
108108

109109
try:

omv/engines/engine.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from os.path import realpath
22
from os import environ
3-
import sys
43
from omv.common.inout import inform
54
import platform
65

@@ -78,8 +77,8 @@ def build_query_string(self, name, cmd):
7877
def set_environment(self):
7978
if self.environment_vars:
8079
for name, val in self.environment_vars.items():
81-
if name in environ and not "HOME" in name:
82-
if not ":%s:" % val in environ[name]:
80+
if name in environ and "HOME" not in name:
81+
if ":%s:" % val not in environ[name]:
8382
environ[name] = "%s:%s" % (environ[name], val)
8483
else:
8584
environ[name] = val

omv/engines/getarbor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def install_arbor(version=None):
88
pip_install("arbor==%s" % version)
99
import arbor
1010

11-
m = "Successfully installed Arbor..."
11+
m = "Successfully installed Arbor %s..."%arbor.__version__
1212
except Exception as e:
1313
m = "ERROR installing Arbor: " + str(e)
1414
finally:

omv/engines/getbrian1.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import pip
32
from omv.common.inout import inform, check_output
43
from omv.engines.utils.wdir import working_dir
54

omv/engines/getbrian2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def install_brian2(version):
1010
pip_install("brian2", version)
1111
import brian2
1212

13-
m = "Successfully installed Brian2..."
13+
m = "Successfully installed Brian2 %s..."%brian2.__version__
1414
except Exception as e:
1515
m = "ERROR installing Brian2: " + str(e)
1616
finally:

omv/engines/getjnml.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
def install_jnml(version):
11-
1211
if not version:
1312
version = "v0.14.0"
1413

@@ -45,4 +44,4 @@ def install_jnml(version):
4544
)
4645
check_output(["unzip", "jNeuroML.zip"])
4746

48-
inform("Successfully installed jNeuroML "+version, indent=1)
47+
inform("Successfully installed jNeuroML " + version, indent=1)

omv/engines/getpynn.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def install_pynn(version=None):
1515

1616
pip_install("pynn", version)
1717
import pyNN
18-
'''
18+
19+
"""
1920
install_root = os.environ["HOME"]
2021
2122
pyNN_src = "PyNN_src"
@@ -36,7 +37,7 @@ def install_pynn(version=None):
3637
print(check_output(["pwd"]))
3738
print("Finished attempting to install PyNN")
3839
# import pyNN
39-
'''
40+
"""
4041
m = "Successfully installed pyNN..."
4142
except Exception as e:
4243
m = "ERROR during install_pynn: %s" % e

omv/engines/getxpp.py

Lines changed: 16 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,18 @@
33

44
from omv.engines.utils.wdir import working_dir
55
from sysconfig import get_paths
6-
import sys
7-
8-
import fileinput
96

107

11-
def install_xpp(version='latest'):
128

13-
if version is None:
14-
version='latest'
15-
elif not version=='latest':
16-
raise Exception('Can currently only install the latest XPP version')
9+
def install_xpp(version="latest"):
10+
if version is None:
11+
version = "latest"
12+
elif not version == "latest":
13+
raise Exception("Can currently only install the latest XPP version")
1714

1815
inform("Installing XPP", indent=2, verbosity=1)
1916
xppinstallpath = os.path.join(os.environ["HOME"])
20-
xpphomepath = os.path.join(xppinstallpath, 'xppaut')
17+
xpphomepath = os.path.join(xppinstallpath, "xppaut")
2118

2219
inform(
2320
"Installing XPP to: %s" % (xpphomepath),
@@ -27,56 +24,27 @@ def install_xpp(version='latest'):
2724
pypaths = get_paths()
2825
inform("Python lib info: %s" % (pypaths), indent=2, verbosity=1)
2926

30-
3127
with working_dir(xppinstallpath):
32-
print(
33-
check_output(
34-
[
35-
"git",
36-
"clone",
37-
"https://github.com/NeuroML/xppaut"
38-
]
39-
)
40-
)
28+
print(check_output(["git", "clone", "https://github.com/NeuroML/xppaut"]))
4129

4230
with working_dir(xpphomepath):
43-
print(
44-
check_output(
45-
[
46-
"ls",
47-
"-alth"
48-
]
49-
)
50-
)
31+
print(check_output(["ls", "-alth"]))
32+
33+
makefile = os.path.join(xpphomepath, "Makefile")
5134

52-
makefile = os.path.join(xpphomepath, 'Makefile')
53-
54-
print(' - Replacing text in %s'%makefile)
55-
with open(makefile, 'r') as file:
35+
print(" - Replacing text in %s" % makefile)
36+
with open(makefile, "r") as file:
5637
filedata = file.read()
5738

5839
# Replace the target string
59-
filedata = filedata.replace("/usr/local/", "%s/"%xpphomepath)
40+
filedata = filedata.replace("/usr/local/", "%s/" % xpphomepath)
6041

6142
# Write the file out again
62-
with open(makefile, 'w') as file:
43+
with open(makefile, "w") as file:
6344
file.write(filedata)
6445

65-
print(
66-
check_output(
67-
[
68-
"make", "-j4"
69-
]
70-
)
71-
)
72-
print(
73-
check_output(
74-
[
75-
"make", "install"
76-
]
77-
)
78-
)
79-
46+
print(check_output(["make", "-j4"]))
47+
print(check_output(["make", "install"]))
8048

8149

8250
if __name__ == "__main__":

0 commit comments

Comments
 (0)