Skip to content

Commit 61848bf

Browse files
authored
Merge pull request #158 from OpenSourceBrain/development
To v0.4.0; Remove brian1 features, update README and add --exit-zero option
2 parents a680c91 + d2d0170 commit 61848bf

13 files changed

Lines changed: 68 additions & 210 deletions

File tree

.github/workflows/ci_versions.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,22 @@ jobs:
4444
pip install .
4545
pip list
4646
47+
48+
- name: Run pytest
49+
run: |
50+
pip install pytest
51+
cd omv/test
52+
pytest -vs
53+
4754
- name: Run simple OMV tests
4855
run: |
4956
omv all -V --engine=jNeuroML_NEURON
5057
omv test -V utilities/tests/.test.exIzh.jnmlnetpyne.omt
5158
59+
- name: Run broken test with flag --exit-zero
60+
run: |
61+
# This is known to fail, but should not cause the CI to fail due to the --exit-zero flag
62+
omv test -V utilities/tests/brokentest/.test.ex9.jnml.omt.broken --exit-zero
5263
5364
- name: OMV final version info
5465
run: |

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99

1010
# OSB Model Validation
1111

12-
Tools for automated model validation in [Open Source Brain](http://www.opensourcebrain.org) projects, which can also be used for testing model behaviour on many [simulation engines](https://github.com/OpenSourceBrain/osb-model-validation/tree/master/omv/engines) both:
12+
Tools for automated model validation in [Open Source Brain](https://www.opensourcebrain.org) projects, which can also be used for testing model behaviour on many [simulation engines](https://github.com/OpenSourceBrain/osb-model-validation/tree/master/omv/engines) both:
1313

1414
- on your local machine when developing models
1515
- on [GitHub Actions](https://github.com/features/actions), to ensure tests pass on every commit.
1616

1717
To see this framework in action, click on some of the green buttons below:
1818

19-
| OSB project | Tests on GitHub Actions | Test workflow script |
19+
| OSBv1 project | Tests on GitHub Actions | Test workflow script |
2020
|----------|:-------------:|:------:|
2121
|[FitzHugh Nagumo](http://www.opensourcebrain.org/projects/fitzhugh-nagumo-fitzhugh-1969) | [![Continuous build using OMV](https://github.com/OpenSourceBrain/FitzHugh-Nagumo/actions/workflows/omv-ci.yml/badge.svg)](https://github.com/OpenSourceBrain/FitzHugh-Nagumo/actions/workflows/omv-ci.yml) | [omv-ci.yml](https://github.com/OpenSourceBrain/FitzHugh-Nagumo/blob/master/.github/workflows/omv-ci.yml) |
2222
|[Auditory cortex network](http://www.opensourcebrain.org/projects/acnet2)| [![Continuous build using OMV](https://github.com/OpenSourceBrain/ACnet2/actions/workflows/omv-ci.yml/badge.svg)](https://github.com/OpenSourceBrain/ACnet2/actions/workflows/omv-ci.yml) | [omv-ci.yml](https://github.com/OpenSourceBrain/ACnet2/blob/master/.github/workflows/omv-ci.yml) |
@@ -54,7 +54,7 @@ Setting up validation for a model and simulation written in NeuroML2/LEMS requir
5454
### Write MEP files
5555

5656
Depending on the size of your model, you can run validation on the full fledged model, or you can create smaller stripped down versions that test particular aspects of the model.
57-
Here is an example LEMS file for the FitzHugh-Nagumo model on Open Source Brain: [LEMS_FitzHugNagamo.xml](https://github.com/OpenSourceBrain/FitzHugh-Nagumo/blob/master/NeuroML2/LEMS_FitzHughNagumo.xml).
57+
Here is an example LEMS file for the FitzHugh-Nagumo model on Open Source Brain: [LEMS_FitzHughNagumo.xml](https://github.com/OpenSourceBrain/FitzHugh-Nagumo/blob/master/NeuroML2/LEMS_FitzHughNagumo.xml).
5858

5959
``` yaml
6060
# Script for running automated tests on OSBrain, see https://github.com/OpenSourceBrain/osb-model-validation

omv/engines/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from omv.engines.pylemsnml2 import PyLemsNeuroML2Engine
2222
from omv.engines.genesis import GenesisEngine
2323

24-
# from omv.engines.brian1 import Brian1Engine
2524
from omv.engines.brian2_ import Brian2Engine
2625
from omv.engines.arbor_ import ArborEngine
2726
from omv.engines.xpp import XppEngine
@@ -33,7 +32,6 @@
3332
from omv.engines.pynnneuron import PyNNNRNEngine
3433
from omv.engines.pyneuron import PyNRNEngine
3534

36-
# from omv.engines.pynnbrian1 import PyNNBrian1Engine
3735
from omv.engines.pynnbrian2 import PyNNBrian2Engine
3836
from omv.engines.pynnnest import PyNNNestEngine
3937
from omv.engines.pynnneuroml import PyNNNeuroMLEngine

omv/engines/brian1.py

Lines changed: 0 additions & 59 deletions
This file was deleted.

omv/engines/getbrian2.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from omv.common.inout import pip_install
22

3-
from omv.engines.getbrian1 import check_scipy_dev
4-
53

64
def install_brian2(version):
75
if not version:

omv/engines/jneuromlbrian.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

omv/engines/pynnbrian1.py

Lines changed: 0 additions & 59 deletions
This file was deleted.

omv/omv_util.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
============================================
33
44
Usage:
5-
omv all [-V | --verbose] [--engine=engine] [--ignore-non-py3]
6-
omv all_ [-V | --verbose] [--engine=engine]
7-
omv test <testMe.omt> [-V | --verbose]
5+
omv all [-V | --verbose] [--engine=engine] [--ignore-non-py3] [--exit-zero]
6+
omv all_ [-V | --verbose] [--engine=engine] [--ignore-non-py3] [--exit-zero]
7+
omv test <testMe.omt> [-V | --verbose] [--exit-zero]
88
omv autogen [options]
99
omv install <engine>
1010
omv find
@@ -20,6 +20,7 @@
2020
-V --verbose Display additional diagnosis messages [default: False].
2121
--version Show version.
2222
--ignore-non-py3 If Python 3, ignore tests on non Py3 compatible engines [default: False]
23+
--exit-zero Run tests as normal and report failures, but always exit with code 0 [default: False]
2324
-y Auto-select default options (non-interactive mode)
2425
"""
2526

@@ -46,12 +47,15 @@ def main():
4647
if arguments["--verbose"]:
4748
set_verbosity(1)
4849

50+
exit_zero = arguments["--exit-zero"]
51+
4952
if arguments["test"]:
5053
try:
5154
test_one(arguments["<testMe.omt>"])
5255
except AssertionError:
5356
inform("Failed due to non passing tests")
54-
exit(1)
57+
if not exit_zero:
58+
exit(1)
5559

5660
elif arguments["all"]:
5761
try:
@@ -74,7 +78,8 @@ def main():
7478
)
7579
except AssertionError:
7680
inform("Failed due to non passing tests")
77-
exit(1)
81+
if not exit_zero:
82+
exit(1)
7883

7984
# Includes *.omt_, i.e. temporary test files
8085
elif arguments["all_"]:
@@ -86,7 +91,8 @@ def main():
8691
)
8792
except AssertionError:
8893
inform("Failed due to non passing tests")
89-
exit(1)
94+
if not exit_zero:
95+
exit(1)
9096

9197
elif arguments["find"]:
9298
try:
@@ -364,15 +370,6 @@ def _install_engine(eng):
364370

365371
install_netpyne(engine_version)
366372

367-
elif eng.lower() == "Brian".lower():
368-
if engine_version is not None:
369-
raise Exception(
370-
"Currently, cannot install a specific version of engine %s" % eng
371-
)
372-
from omv.engines.getbrian1 import install_brian
373-
374-
install_brian()
375-
376373
elif eng.lower() == "Brian2".lower():
377374
from omv.engines.brian2_ import Brian2Engine as ee
378375

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = OSBModelValidation
3-
version = 0.3.11
3+
version = 0.4.0
44
author = Boris Marin, Padraig Gleeson
55
author_email = borismarin@gmail.com
66
url = https://github.com/OpenSourceBrain/osb-model-validation
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Script for running automated tests on OSB using Travis-CI, see https://github.com/OpenSourceBrain/osb-model-validation
2+
3+
target: ../LEMS_NML2_Ex9_FN.xml
4+
engine: jNeuroML
5+
mep: .test.ex9.mep
6+
experiments:
7+
V:
8+
observables:
9+
spike times:
10+
file:
11+
path: ../ex9.dat
12+
columns: [0,1]
13+
scaling: [1000, 1000]
14+
spike detection:
15+
method: derivative
16+
tolerance: 0.004099
17+
W:
18+
observables:
19+
spike times:
20+
file:
21+
path: ../ex9.dat
22+
columns: [0,2]
23+
scaling: [1000, 1]
24+
spike detection:
25+
method: derivative
26+
tolerance: 0.000616

0 commit comments

Comments
 (0)