From ab47e6118a20983ce53409a8981c05e6fc92e59b Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Tue, 5 Dec 2023 16:05:45 +0000
Subject: [PATCH 01/22] Test install xpp
---
.github/workflows/ci.yml | 33 +-------------
omv/engines/__init__.py | 1 +
omv/engines/getxpp.py | 47 ++++++++++++++++++++
omv/engines/xpp.py | 76 ++++++++++++++++++++++++++++++++
omv/omv_util.py | 10 +++++
utilities/tests/.test.xpp.omt | 2 +
utilities/tests/nca.ode | 82 +++++++++++++++++++++++++++++++++++
7 files changed, 219 insertions(+), 32 deletions(-)
create mode 100644 omv/engines/getxpp.py
create mode 100644 omv/engines/xpp.py
create mode 100644 utilities/tests/.test.xpp.omt
create mode 100644 utilities/tests/nca.ode
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1c1e500..f5c543c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -18,38 +18,7 @@ jobs:
python-version: [ 3.9 ]
engine:
- Arbor
- - "Brian2:2.4"
- - Brian2
- - EDEN
- - "NEST:2.20.0"
- - "NEST:3.3"
- - PyNEST
- - PyNEST:2.20.0
- - PyNEST:3.1
- - "NEURON:7.8.2"
- - "PyNEURON:8.0.2"
- - PyNN
- - PyNN_Brian2
- - PyNN_NEURON
- - PyNN_Nest
- - PyNN_NeuroML
- - NetPyNE
- - PyLEMS
- - PyLEMS_NeuroML2
- - jLEMS
- - jNeuroML
- - "jNeuroML:v0.12.3"
- - jNeuroML_Brian2
- - jNeuroML_EDEN
- - "jNeuroML_NEURON:8.2.1"
- - jNeuroML_NetPyNE
- - jNeuroML_PyNN_NEURON
- - jNeuroML_validate
- - jNeuroML_validatev1
- - Py_neuroConstruct
- - pyNeuroML
- - jNeuroML_Moose
- - MOOSE
+ - XPP
steps:
- uses: actions/checkout@v3
diff --git a/omv/engines/__init__.py b/omv/engines/__init__.py
index 1d719b0..0bc59bf 100644
--- a/omv/engines/__init__.py
+++ b/omv/engines/__init__.py
@@ -23,6 +23,7 @@
# from omv.engines.brian1 import Brian1Engine
from omv.engines.brian2_ import Brian2Engine
from omv.engines.arbor_ import ArborEngine
+from omv.engines.xpp import XppEngine
from omv.engines.eden_ import EdenEngine
from omv.engines.nestsli import NestEngine
from omv.engines.pynest import PyNestEngine
diff --git a/omv/engines/getxpp.py b/omv/engines/getxpp.py
new file mode 100644
index 0000000..b7c0691
--- /dev/null
+++ b/omv/engines/getxpp.py
@@ -0,0 +1,47 @@
+import os
+from omv.common.inout import inform, check_output
+
+from omv.engines.utils.wdir import working_dir
+from sysconfig import get_paths
+import sys
+
+
+def install_xpp(version='latest'):
+
+ if version is None:
+ version='latest'
+ elif not version=='latest':
+ raise Exception('Can currently only install the latest XPP tarball')
+
+ inform("Installing XPP", indent=2, verbosity=1)
+ xppinstallpath = os.path.join(os.environ["HOME"], "xpp")
+
+ inform(
+ "Installing XPP to: %s" % (xppinstallpath),
+ indent=2,
+ verbosity=1,
+ )
+ pypaths = get_paths()
+ inform("Python lib info: %s" % (pypaths), indent=2, verbosity=1)
+
+ try:
+ os.mkdir(xppinstallpath)
+ except:
+ pass
+
+ with working_dir(xppinstallpath):
+
+ check_output(
+ [
+ "wget",
+ "-nv",
+ "https://sites.pitt.edu/~phase/bard/bardware/binary/%s/xpplinux.tgz" % (version),
+ ]
+ )
+ check_output(["tar", "xzvf", "xpplinux.tgz"])
+ check_output(["mv", "xppaut8.0ubuntu", "xppaut"])
+
+
+
+if __name__ == "__main__":
+ install_nest()
diff --git a/omv/engines/xpp.py b/omv/engines/xpp.py
new file mode 100644
index 0000000..86da14c
--- /dev/null
+++ b/omv/engines/xpp.py
@@ -0,0 +1,76 @@
+import os
+import sys
+
+import subprocess as sp
+
+from omv.common.inout import inform, trim_path, check_output, is_verbose
+from omv.engines.engine import OMVEngine, EngineExecutionError
+
+
+class XppEngine(OMVEngine):
+ name = "XPP"
+
+ @staticmethod
+ def get_xpp_environment():
+ xpppath = os.path.join(os.environ["HOME"], "xpp/")
+
+ if "XPP_HOME" in os.environ:
+ xpppath = os.environ["XPP_HOME"] + "/"
+
+ environment_vars = {
+ "XPP_HOME": xpppath,
+ }
+
+ return environment_vars
+
+ @staticmethod
+ def is_installed():
+ ret = True
+ environment_vars = XppEngine.get_xpp_environment()
+ try:
+ FNULL = open(os.devnull, "w")
+
+ r = check_output(
+ [environment_vars["XPP_HOME"] + "/xppaut", "-version"], verbosity=2
+ )
+ ret = "%s" % r.split()[2]
+ if not "v" in ret:
+ ret = "v%s" % ret
+
+ inform("XPP %s is correctly installed..." % ret, indent=2, verbosity=1)
+
+ except OSError as err:
+ if is_verbose():
+ inform("Couldn't execute XPP: ", err, indent=1)
+ ret = False
+ return ret
+
+ @staticmethod
+ def install(version):
+ from omv.engines.getxpp import install_xpp
+
+ install_xpp(version)
+ inform("Done...", indent=2)
+
+ def run(self):
+ self.environment_vars = XppEngine.get_xpp_environment()
+ self.set_environment()
+
+ try:
+ inform(
+ "Running file %s with %s" % (trim_path(self.modelpath), self.name),
+ indent=1,
+ )
+ self.stdout = check_output(
+ [self.environment_vars["XPP_HOME"] + "/xppaut", self.modelpath, '-silent'],
+ cwd=os.path.dirname(self.modelpath),
+ )
+ self.returncode = 0
+ except sp.CalledProcessError as err:
+ self.returncode = err.returncode
+ self.stdout = err.output
+ raise EngineExecutionError
+ except Exception as err:
+ inform("Another error with running %s: " % self.name, err, indent=1)
+ self.returncode = -1
+ self.stdout = "???"
diff --git a/omv/omv_util.py b/omv/omv_util.py
index a9dc0d0..d31c72c 100644
--- a/omv/omv_util.py
+++ b/omv/omv_util.py
@@ -278,6 +278,16 @@ def _install_engine(eng):
install_arbor(engine_version)
+ elif eng.lower() == "XPP".lower():
+ from omv.engines.xpp import XppEngine as ee
+
+ if ee.is_installed():
+ already_installed = True
+ else:
+ from omv.engines.getxpp import install_xpp
+
+ install_xpp(engine_version)
+
elif eng.lower() == "EDEN".lower():
from omv.engines.eden_ import EdenEngine as ee
diff --git a/utilities/tests/.test.xpp.omt b/utilities/tests/.test.xpp.omt
new file mode 100644
index 0000000..6f1f084
--- /dev/null
+++ b/utilities/tests/.test.xpp.omt
@@ -0,0 +1,2 @@
+target: nca.ode
+engine: XPP
diff --git a/utilities/tests/nca.ode b/utilities/tests/nca.ode
new file mode 100644
index 0000000..e6ce45f
--- /dev/null
+++ b/utilities/tests/nca.ode
@@ -0,0 +1,82 @@
+# Excitatory cortical neurons, normal [Ca].
+#
+number Cm=1.0
+number pms=3,pns=4
+number VNa=55.0,t_tauh=-40.5,t_taun=-27.0
+number thetaa=-50.0,sigmaa=20.0,thetab=-80.0,sigmab=-6.0,tauBs=15.0
+number thetam=-30.0,sigmam=9.5,sigmah=-7.0,sigman=10.0,sigmaz=5.0
+number VCa=120
+number thetar=-20.0,sigmar=10.0,thetac=-30,sigmac=7
+number pwrc=1,pwrq=4
+#
+p gNa=35.0,gKdr=6.0,gL=0.05,Iapp=1.0
+p gA=1.4,gNaP=0.2,gZ=1.0
+p thetaz=-39.0,tauZs=75.0
+p phi=10.0, thetah=-45.0
+p thetan=-35.0,thetap=-41.0,sigmap=3.0
+p VK=-90.0,VL=-70.0
+p gCa=0.08,gKCa=10.0,gKAHP=5
+p tauRs=1.0,aq=2,ac=6,tauq=450,tauCa=13,uuCa=0.13,tauKc=2
+#
+GAMMAF(VV,theta,sigma)=1.0/(1.0+exp(-(VV-theta)/sigma))
+ZFUNC(AA,CA,zz)=1/(1+(AA^zz/CA^zz))
+#
+VVs'=(-gL*(VVs-VL)-INa-INaP-IKdr-IA-Iz-ICa-IKC-IAHP+Iappx)/Cm
+hhs'=phi*(GAMMAF(VVs,thetah,sigmah)-hhs)/(1.0+7.5*GAMMAF(VVs,t_tauh,-6.0))
+nns'=phi*(GAMMAF(VVs,thetan,sigman)-nns)/(1.0+5.0*GAMMAF(VVs,t_taun,-15.0))
+bbs'=(GAMMAF(VVs,thetab,sigmab)-bbs)/tauBs
+zzs'=(GAMMAF(VVs,thetaz,sigmaz)-zzs)/tauZs
+rrs'=(GAMMAF(VVs,thetar,sigmar)-rrs)/tauRs
+ccs'=(GAMMAF(VVs,thetac,sigmac)-ccs)/tauKc
+qqs'=(ZFUNC(aq,Ca,pwrq)-qqs)/tauq
+Ca'=-uuCa*ICa-Ca/tauCa
+#
+Iappx=Iapp
+#if(t<=3.0)then(Iapp)else(0.0)
+Minfs=GAMMAF(VVs,thetam,sigmam)
+Pinfs=GAMMAF(VVs,thetap,sigmap)
+Ainfs=GAMMAF(VVs,thetaa,sigmaa)
+mKCa=ZFUNC(ac,Ca,pwrc)
+#
+INa=gNa*(Minfs^pms)*hhs*(VVs-VNa)
+INaP=gNaP*Pinfs*(VVs-VNa)
+IKdr=gKdr*(nns^pns)*(VVs-VK)
+IA=gA*Ainfs^3*bbs*(VVs-VK)
+Iz=gZ*zzs*(VVs-VK)
+ICa=gCa*rrs^2*(VVs-VCa)
+IKC=gKCa*mKCa*ccs*(VVs-VK)
+IAHP=gKAHP*qqs*(VVs-VK)
+#
+VVs(0)=-71.962
+hhs(0)=0.979199
+nns(0)=0.0242166
+bbs(0)=0.207565
+zzs(0)=0.0013689
+Ca[0]=0.000787
+rrs(0)=0.005507
+ccs(0)=0.002486
+qqs(0)=0.0
+#
+@ MAXSTOR=800000
+@ BACK=Black
+@ XP=T
+@ YP=VVs
+@ AXES=2
+@ TOTAL=500.0
+@ DT=0.05
+@ NJMP=1
+@ T0=0.0
+@ TRANS=0.0
+@ NMESH=40
+@ METH=rungekutta
+@ DTMIN=0.001
+@ DTMAX=1.0
+@ TOLER=0.00001
+@ BOUND=10000.0
+@ DELAY=0
+@ XLO=0.0, XHI=500.0, YLO=-90.0, YHI=30.0
+@ NTST=50,NMAX=2000,NPR=50
+@ DS=0.02,DSMIN=0.001,DSMAX=0.5
+@ PARMIN=-10,PARMAX=50,NORMMIN=0.0,NORMMAX=10000.0
+@ AUTOVAR=VVs1,AUTOXMIN=-10.0,AUTOXMAX=50.0,AUTOYMIN=-90.0,AUTOYMAX=50.0
+done
From 95d4374868d099baf44dffeb24b8f429cd8e9643 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Tue, 5 Dec 2023 16:16:15 +0000
Subject: [PATCH 02/22] More testing xpp
---
omv/engines/getxpp.py | 2 +-
utilities/tests/.test.xpp.mep | 7 +++++++
utilities/tests/.test.xpp.omt | 15 +++++++++++++++
3 files changed, 23 insertions(+), 1 deletion(-)
create mode 100644 utilities/tests/.test.xpp.mep
diff --git a/omv/engines/getxpp.py b/omv/engines/getxpp.py
index b7c0691..c94ac42 100644
--- a/omv/engines/getxpp.py
+++ b/omv/engines/getxpp.py
@@ -14,7 +14,7 @@ def install_xpp(version='latest'):
raise Exception('Can currently only install the latest XPP tarball')
inform("Installing XPP", indent=2, verbosity=1)
- xppinstallpath = os.path.join(os.environ["HOME"], "xpp")
+ xppinstallpath = os.path.join(os.environ["HOME"], "xpp/xppaut")
inform(
"Installing XPP to: %s" % (xppinstallpath),
diff --git a/utilities/tests/.test.xpp.mep b/utilities/tests/.test.xpp.mep
new file mode 100644
index 0000000..1a79762
--- /dev/null
+++ b/utilities/tests/.test.xpp.mep
@@ -0,0 +1,7 @@
+system: Test XPP
+
+experiments:
+ spikes:
+ expected:
+ spike times: [32.25, 60.400002, 156.60001, 256.45001, 356.10001, 455.79999]
+
diff --git a/utilities/tests/.test.xpp.omt b/utilities/tests/.test.xpp.omt
index 6f1f084..9be032c 100644
--- a/utilities/tests/.test.xpp.omt
+++ b/utilities/tests/.test.xpp.omt
@@ -1,2 +1,17 @@
target: nca.ode
engine: XPP
+
+mep: .test.xpp.mep
+experiments:
+ spikes:
+ observables:
+ spike times:
+ file:
+ path: output.dat
+ columns: [0,1]
+ scaling: [1, 1]
+ spike detection:
+ method: threshold
+ threshold: 0
+ tolerance: 0.00
+
From eb50821221cdd12da7d8bb8eae51f0ef1450c151 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Tue, 5 Dec 2023 16:20:36 +0000
Subject: [PATCH 03/22] More xpp path updates
---
omv/engines/getxpp.py | 2 +-
omv/engines/xpp.py | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/omv/engines/getxpp.py b/omv/engines/getxpp.py
index c94ac42..b7c0691 100644
--- a/omv/engines/getxpp.py
+++ b/omv/engines/getxpp.py
@@ -14,7 +14,7 @@ def install_xpp(version='latest'):
raise Exception('Can currently only install the latest XPP tarball')
inform("Installing XPP", indent=2, verbosity=1)
- xppinstallpath = os.path.join(os.environ["HOME"], "xpp/xppaut")
+ xppinstallpath = os.path.join(os.environ["HOME"], "xpp")
inform(
"Installing XPP to: %s" % (xppinstallpath),
diff --git a/omv/engines/xpp.py b/omv/engines/xpp.py
index 86da14c..a4ff042 100644
--- a/omv/engines/xpp.py
+++ b/omv/engines/xpp.py
@@ -12,7 +12,9 @@ class XppEngine(OMVEngine):
@staticmethod
def get_xpp_environment():
- xpppath = os.path.join(os.environ["HOME"], "xpp/")
+
+ # Default, if it was installed by omv...
+ xpppath = os.path.join(os.environ["HOME"], "xpp/xppaut/")
if "XPP_HOME" in os.environ:
xpppath = os.environ["XPP_HOME"] + "/"
From cd528ee8e0b42e74b291b435cad94f76676ef716 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Wed, 6 Dec 2023 20:36:57 +0000
Subject: [PATCH 04/22] Tweak if -version doesn't work with xppaut
---
omv/engines/xpp.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/omv/engines/xpp.py b/omv/engines/xpp.py
index a4ff042..7291044 100644
--- a/omv/engines/xpp.py
+++ b/omv/engines/xpp.py
@@ -35,9 +35,13 @@ def is_installed():
r = check_output(
[environment_vars["XPP_HOME"] + "/xppaut", "-version"], verbosity=2
)
- ret = "%s" % r.split()[2]
- if not "v" in ret:
- ret = "v%s" % ret
+ if "Problem" in r:
+ ret = 'v???'
+
+ else:
+ ret = "%s" % r.split()[2]
+ if not "v" in ret:
+ ret = "v%s" % ret
inform("XPP %s is correctly installed..." % ret, indent=2, verbosity=1)
From eb21cad3bfa6ab9092ad5a442c8c2f3a9aa0ee65 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Mon, 29 Jan 2024 11:26:38 +0000
Subject: [PATCH 05/22] Test making xpp
---
omv/engines/getxpp.py | 38 +++++++++++++++++++++++++++++++++++---
1 file changed, 35 insertions(+), 3 deletions(-)
diff --git a/omv/engines/getxpp.py b/omv/engines/getxpp.py
index b7c0691..8436ab9 100644
--- a/omv/engines/getxpp.py
+++ b/omv/engines/getxpp.py
@@ -14,16 +14,48 @@ def install_xpp(version='latest'):
raise Exception('Can currently only install the latest XPP tarball')
inform("Installing XPP", indent=2, verbosity=1)
- xppinstallpath = os.path.join(os.environ["HOME"], "xpp")
+ xppinstallpath = os.path.join(os.environ["HOME"])
+ xpphomepath = os.path.join(xppinstallpath, 'xppaut')
inform(
- "Installing XPP to: %s" % (xppinstallpath),
+ "Installing XPP to: %s" % (xpphomepath),
indent=2,
verbosity=1,
)
pypaths = get_paths()
inform("Python lib info: %s" % (pypaths), indent=2, verbosity=1)
+
+ with working_dir(xppinstallpath):
+ print(
+ check_output(
+ [
+ "git",
+ "clone",
+ "https://github.com/Ermentrout/xppaut"
+ ]
+ )
+ )
+
+ with working_dir(xpphomepath):
+ print(
+ check_output(
+ [
+ "ls",
+ "-alth"
+ ]
+ )
+ )
+ print(
+ check_output(
+ [
+ "make"
+ ]
+ )
+ )
+
+
+ '''
try:
os.mkdir(xppinstallpath)
except:
@@ -39,7 +71,7 @@ def install_xpp(version='latest'):
]
)
check_output(["tar", "xzvf", "xpplinux.tgz"])
- check_output(["mv", "xppaut8.0ubuntu", "xppaut"])
+ check_output(["mv", "xppaut8.0ubuntu", "xppaut"])'''
From f76f764f8b7342d4bcf293f1d5c6335c3b488a03 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 12:37:11 +0100
Subject: [PATCH 06/22] Test install deps for xpp
---
.github/workflows/ci.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9b128ef..71152d7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -37,6 +37,8 @@ jobs:
- name: Run OMV tests on engine ${{ matrix.engine }}
run: |
# Not yet checked: Octave, genesis
+ sudo apt install gcc libx11-dev libc6-dev libx11-6 libc6
+
omv all -V --engine=${{ matrix.engine }}
- name: OMV final version info
From 81e7a2505ebc0837989367ce38c6f0efa703a8cc Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 12:41:08 +0100
Subject: [PATCH 07/22] Test explicit make
---
.github/workflows/ci.yml | 9 +++++++--
.github/workflows/ci_versions.yml | 4 ++--
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 71152d7..9a01562 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -38,8 +38,13 @@ jobs:
run: |
# Not yet checked: Octave, genesis
sudo apt install gcc libx11-dev libc6-dev libx11-6 libc6
-
- omv all -V --engine=${{ matrix.engine }}
+ cd /tmp
+ wget http://www.math.pitt.edu/~bard/bardware/xppaut_latest.tar.gz
+ mkdir xpp
+ tar zxvf xppaut_latest.tar.gz --directory xpp
+ cd xpp
+ make
+ make install
- name: OMV final version info
run: |
diff --git a/.github/workflows/ci_versions.yml b/.github/workflows/ci_versions.yml
index f339de4..274788f 100644
--- a/.github/workflows/ci_versions.yml
+++ b/.github/workflows/ci_versions.yml
@@ -2,9 +2,9 @@ name: Test across versions
on:
push:
- branches: [ master, development, experimental, test* ]
+ branches: [ master, development, experimental, test__* ]
pull_request:
- branches: [ master, development, experimental, test* ]
+ branches: [ master, development, experimental, test__* ]
jobs:
build:
From 384f0496de25fd423ab4b89aa37bd76623003f79 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 13:22:40 +0100
Subject: [PATCH 08/22] Install from neuoml
---
.github/workflows/ci.yml | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9a01562..57558b5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -38,11 +38,9 @@ jobs:
run: |
# Not yet checked: Octave, genesis
sudo apt install gcc libx11-dev libc6-dev libx11-6 libc6
- cd /tmp
- wget http://www.math.pitt.edu/~bard/bardware/xppaut_latest.tar.gz
- mkdir xpp
- tar zxvf xppaut_latest.tar.gz --directory xpp
- cd xpp
+ git clone https://github.com/NeuroML/xppaut
+
+ cd xppaut
make
make install
From 6892d0a5e87ec6ec142d7538dd3323a5db23fe8c Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 13:31:27 +0100
Subject: [PATCH 09/22] Retest
---
.github/workflows/ci.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 57558b5..6de05ef 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -42,7 +42,8 @@ jobs:
cd xppaut
make
- make install
+ sudo make install
+ xppaut -version
- name: OMV final version info
run: |
From 0981ccfff94ce595d6dc4de61c3514734d781c8c Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 13:34:38 +0100
Subject: [PATCH 10/22] test on omv
---
.github/workflows/ci.yml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 6de05ef..9786323 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -45,6 +45,11 @@ jobs:
sudo make install
xppaut -version
+ omv list -V # list installed engines
+
+ omv all -V --engine=${{ matrix.engine }}
+
+
- name: OMV final version info
run: |
omv list -V # list installed engines
From 5ecb6d30b09d305cb13870d0b0738453c06caa91 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 13:39:47 +0100
Subject: [PATCH 11/22] Test using nml version xpp
---
.github/workflows/ci.yml | 12 ++++++------
omv/engines/getxpp.py | 9 ++++++++-
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9786323..f34d723 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -37,13 +37,13 @@ jobs:
- name: Run OMV tests on engine ${{ matrix.engine }}
run: |
# Not yet checked: Octave, genesis
- sudo apt install gcc libx11-dev libc6-dev libx11-6 libc6
- git clone https://github.com/NeuroML/xppaut
+ # sudo apt install gcc libx11-dev libc6-dev libx11-6 libc6
+ # git clone https://github.com/NeuroML/xppaut
- cd xppaut
- make
- sudo make install
- xppaut -version
+ # cd xppaut
+ # make
+ # sudo make install
+ # xppaut -version
omv list -V # list installed engines
diff --git a/omv/engines/getxpp.py b/omv/engines/getxpp.py
index 8436ab9..f10a100 100644
--- a/omv/engines/getxpp.py
+++ b/omv/engines/getxpp.py
@@ -32,7 +32,7 @@ def install_xpp(version='latest'):
[
"git",
"clone",
- "https://github.com/Ermentrout/xppaut"
+ "https://github.com/NeuroML/xppaut"
]
)
)
@@ -53,6 +53,13 @@ def install_xpp(version='latest'):
]
)
)
+ print(
+ check_output(
+ [
+ "make install"
+ ]
+ )
+ )
'''
From 0c35c89e0a5db98356132fe96864f389a4fce81c Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 14:10:21 +0100
Subject: [PATCH 12/22] Test make install
---
omv/engines/getxpp.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/omv/engines/getxpp.py b/omv/engines/getxpp.py
index f10a100..4b55c07 100644
--- a/omv/engines/getxpp.py
+++ b/omv/engines/getxpp.py
@@ -46,17 +46,24 @@ def install_xpp(version='latest'):
]
)
)
+ print(
+ check_output(
+ [
+ "sed", "-i", "-e", "s/'BINDIR = \/usr\/local\/bin'/'BINDIR = $(HOME)\/xppaut'/g", "Makefile"
+ ]
+ )
+ )
print(
check_output(
[
- "make"
+ "make", "-j4"
]
)
)
print(
check_output(
[
- "make install"
+ "make", "install"
]
)
)
From c31c00dd124295018cbfe82e951d80cf8ca2e339 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 14:30:46 +0100
Subject: [PATCH 13/22] More xpp tests
---
omv/engines/getxpp.py | 20 +++++++++++++++++++-
omv/engines/xpp.py | 2 +-
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/omv/engines/getxpp.py b/omv/engines/getxpp.py
index 4b55c07..c9b22b1 100644
--- a/omv/engines/getxpp.py
+++ b/omv/engines/getxpp.py
@@ -4,6 +4,8 @@
from omv.engines.utils.wdir import working_dir
from sysconfig import get_paths
import sys
+
+import fileinput
def install_xpp(version='latest'):
@@ -46,13 +48,29 @@ def install_xpp(version='latest'):
]
)
)
+
+ makefile = os.path.join(xpphomepath, 'Makefile')
+
+ print(' - Replacing text in %s'%makefile)
+ with open(makefile, 'r') as file:
+ filedata = file.read()
+
+ # Replace the target string
+ filedata = filedata.replace("BINDIR = /usr/local/bin", "BINDIR = %s/bin"%xpphomepath)
+
+ # Write the file out again
+ with open(makefile, 'w') as file:
+ file.write(filedata)
+
+ '''
+ line.replace("BINDIR = \/usr\/local\/bin", "BINDIR = $(HOME)\/xppaut")
print(
check_output(
[
"sed", "-i", "-e", "s/'BINDIR = \/usr\/local\/bin'/'BINDIR = $(HOME)\/xppaut'/g", "Makefile"
]
)
- )
+ )'''
print(
check_output(
[
diff --git a/omv/engines/xpp.py b/omv/engines/xpp.py
index 7291044..0239af9 100644
--- a/omv/engines/xpp.py
+++ b/omv/engines/xpp.py
@@ -14,7 +14,7 @@ class XppEngine(OMVEngine):
def get_xpp_environment():
# Default, if it was installed by omv...
- xpppath = os.path.join(os.environ["HOME"], "xpp/xppaut/")
+ xpppath = os.path.join(os.environ["HOME"], "xppaut/bin")
if "XPP_HOME" in os.environ:
xpppath = os.environ["XPP_HOME"] + "/"
From e4ade67e5268752722202cd2e9b0f48ede17368a Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 14:42:04 +0100
Subject: [PATCH 14/22] More output
---
omv/common/inout.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/omv/common/inout.py b/omv/common/inout.py
index 9a2e9ed..0bbc2c2 100644
--- a/omv/common/inout.py
+++ b/omv/common/inout.py
@@ -121,8 +121,8 @@ def check_output(cmds, cwd=".", shell=False, verbosity=0, env=None):
except sp.CalledProcessError as err:
inform(
- "Error running commands: %s in %s (return code: %s)"
- % (cmds, cwd, err.returncode),
+ "CalledProcessError running commands: %s in %s (return code: %s), output:\n%s"
+ % (cmds, cwd, err.returncode, exc.output),
indent=2,
verbosity=verbosity,
)
From 1a3e2eefa49f1dd09c978ae597b9777107ad2fb2 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 14:44:40 +0100
Subject: [PATCH 15/22] Typo fix
---
omv/common/inout.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/omv/common/inout.py b/omv/common/inout.py
index 0bbc2c2..27cf80a 100644
--- a/omv/common/inout.py
+++ b/omv/common/inout.py
@@ -122,7 +122,7 @@ def check_output(cmds, cwd=".", shell=False, verbosity=0, env=None):
except sp.CalledProcessError as err:
inform(
"CalledProcessError running commands: %s in %s (return code: %s), output:\n%s"
- % (cmds, cwd, err.returncode, exc.output),
+ % (cmds, cwd, err.returncode, err.output),
indent=2,
verbosity=verbosity,
)
From 669c5dfdd835986117ee33b7803ef2913495c4d2 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 14:48:44 +0100
Subject: [PATCH 16/22] More general replace
---
omv/engines/getxpp.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/omv/engines/getxpp.py b/omv/engines/getxpp.py
index c9b22b1..9fa649f 100644
--- a/omv/engines/getxpp.py
+++ b/omv/engines/getxpp.py
@@ -56,7 +56,7 @@ def install_xpp(version='latest'):
filedata = file.read()
# Replace the target string
- filedata = filedata.replace("BINDIR = /usr/local/bin", "BINDIR = %s/bin"%xpphomepath)
+ filedata = filedata.replace("/usr/local/", "%s/bin/"%xpphomepath)
# Write the file out again
with open(makefile, 'w') as file:
From 9c29287b5b2fba6bb2436e3c41381c074443b5ae Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 14:51:04 +0100
Subject: [PATCH 17/22] Remove one bin
---
omv/engines/getxpp.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/omv/engines/getxpp.py b/omv/engines/getxpp.py
index 9fa649f..7fc16a0 100644
--- a/omv/engines/getxpp.py
+++ b/omv/engines/getxpp.py
@@ -56,7 +56,7 @@ def install_xpp(version='latest'):
filedata = file.read()
# Replace the target string
- filedata = filedata.replace("/usr/local/", "%s/bin/"%xpphomepath)
+ filedata = filedata.replace("/usr/local/", "%s/"%xpphomepath)
# Write the file out again
with open(makefile, 'w') as file:
From 400fb08902e3de85140bef5debfee81aab0f7be1 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 15:48:51 +0100
Subject: [PATCH 18/22] Remove commented out lines
---
omv/engines/getxpp.py | 28 ----------------------------
1 file changed, 28 deletions(-)
diff --git a/omv/engines/getxpp.py b/omv/engines/getxpp.py
index 7fc16a0..2df8d44 100644
--- a/omv/engines/getxpp.py
+++ b/omv/engines/getxpp.py
@@ -62,15 +62,6 @@ def install_xpp(version='latest'):
with open(makefile, 'w') as file:
file.write(filedata)
- '''
- line.replace("BINDIR = \/usr\/local\/bin", "BINDIR = $(HOME)\/xppaut")
- print(
- check_output(
- [
- "sed", "-i", "-e", "s/'BINDIR = \/usr\/local\/bin'/'BINDIR = $(HOME)\/xppaut'/g", "Makefile"
- ]
- )
- )'''
print(
check_output(
[
@@ -87,25 +78,6 @@ def install_xpp(version='latest'):
)
- '''
- try:
- os.mkdir(xppinstallpath)
- except:
- pass
-
- with working_dir(xppinstallpath):
-
- check_output(
- [
- "wget",
- "-nv",
- "https://sites.pitt.edu/~phase/bard/bardware/binary/%s/xpplinux.tgz" % (version),
- ]
- )
- check_output(["tar", "xzvf", "xpplinux.tgz"])
- check_output(["mv", "xppaut8.0ubuntu", "xppaut"])'''
-
-
if __name__ == "__main__":
install_nest()
From 5610ffb5d1d1ed939e585fe219399be0c38ef9d3 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 15:50:42 +0100
Subject: [PATCH 19/22] Reverto to full tests
---
.github/workflows/ci.yml | 45 +++++++++++++++++++++++++++++-----------
1 file changed, 33 insertions(+), 12 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f34d723..2a158a8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -18,7 +18,39 @@ jobs:
python-version: [ 3.9 ]
engine:
- Arbor
- - XPP
+ - "Brian2:2.4"
+ - Brian2
+ - EDEN
+ - "NEST:2.20.0"
+ - "NEST:3.3"
+ - PyNEST
+ - PyNEST:2.20.0
+ - PyNEST:3.1
+ - "NEURON:7.8.2"
+ - "PyNEURON:8.0.2"
+ - PyNN
+ - PyNN_Brian2
+ - PyNN_NEURON
+ - PyNN_Nest
+ - PyNN_NeuroML
+ - NetPyNE
+ - PyLEMS
+ - PyLEMS_NeuroML2
+ - jLEMS
+ - jNeuroML
+ - "jNeuroML:v0.12.3"
+ - jNeuroML_Brian2
+ - jNeuroML_EDEN
+ - "jNeuroML_NEURON:8.2.1"
+ - jNeuroML_NetPyNE
+ - jNeuroML_PyNN_NEURON
+ - jNeuroML_validate
+ - jNeuroML_validatev1
+ - Py_neuroConstruct
+ - pyNeuroML
+ - pyNeuroML_validate_sbml
+ - jNeuroML_Moose
+ - MOOSE:3.1.5
steps:
- uses: actions/checkout@v4
@@ -37,19 +69,8 @@ jobs:
- name: Run OMV tests on engine ${{ matrix.engine }}
run: |
# Not yet checked: Octave, genesis
- # sudo apt install gcc libx11-dev libc6-dev libx11-6 libc6
- # git clone https://github.com/NeuroML/xppaut
-
- # cd xppaut
- # make
- # sudo make install
- # xppaut -version
-
- omv list -V # list installed engines
-
omv all -V --engine=${{ matrix.engine }}
-
- name: OMV final version info
run: |
omv list -V # list installed engines
From caab7f8e7c2167bc58f65fc60c5a209b61d43666 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 15:51:19 +0100
Subject: [PATCH 20/22] Add back xpp test
---
.github/workflows/ci.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2a158a8..1eec623 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -51,6 +51,7 @@ jobs:
- pyNeuroML_validate_sbml
- jNeuroML_Moose
- MOOSE:3.1.5
+ - XPP
steps:
- uses: actions/checkout@v4
From d2354b7aa54c469d66a1a33d43f30a2ab76a6b23 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 15:56:00 +0100
Subject: [PATCH 21/22] To v0.2.21
---
omv/engines/getxpp.py | 2 +-
setup.cfg | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/omv/engines/getxpp.py b/omv/engines/getxpp.py
index 2df8d44..4451b31 100644
--- a/omv/engines/getxpp.py
+++ b/omv/engines/getxpp.py
@@ -13,7 +13,7 @@ def install_xpp(version='latest'):
if version is None:
version='latest'
elif not version=='latest':
- raise Exception('Can currently only install the latest XPP tarball')
+ raise Exception('Can currently only install the latest XPP version')
inform("Installing XPP", indent=2, verbosity=1)
xppinstallpath = os.path.join(os.environ["HOME"])
diff --git a/setup.cfg b/setup.cfg
index 44e4ee9..0bea953 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = OSBModelValidation
-version = 0.2.20
+version = 0.2.21
author = Boris Marin, Padraig Gleeson
author_email = borismarin@gmail.com
url = https://github.com/OpenSourceBrain/osb-model-validation
From 1dcf15bc2b74aee7c3f753d08eafcf131e6d5f7a Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 17 Apr 2024 16:11:39 +0100
Subject: [PATCH 22/22] Reenable version checks
Add 3.12 to supported versions
---
.github/workflows/ci_versions.yml | 4 ++--
setup.cfg | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/ci_versions.yml b/.github/workflows/ci_versions.yml
index 274788f..f339de4 100644
--- a/.github/workflows/ci_versions.yml
+++ b/.github/workflows/ci_versions.yml
@@ -2,9 +2,9 @@ name: Test across versions
on:
push:
- branches: [ master, development, experimental, test__* ]
+ branches: [ master, development, experimental, test* ]
pull_request:
- branches: [ master, development, experimental, test__* ]
+ branches: [ master, development, experimental, test* ]
jobs:
build:
diff --git a/setup.cfg b/setup.cfg
index 0bea953..c66d04d 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -18,6 +18,7 @@ classifiers=
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
+ Programming Language :: Python :: 3.12
Topic :: Scientific/Engineering
[options]