Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/ci_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,22 @@ jobs:
pip install .
pip list


- name: Run pytest
run: |
pip install pytest
cd omv/test
pytest -vs

- name: Run simple OMV tests
run: |
omv all -V --engine=jNeuroML_NEURON
omv test -V utilities/tests/.test.exIzh.jnmlnetpyne.omt

- name: Run broken test with flag --exit-zero
run: |
# This is known to fail, but should not cause the CI to fail due to the --exit-zero flag
omv test -V utilities/tests/brokentest/.test.ex9.jnml.omt.broken --exit-zero

- name: OMV final version info
run: |
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

# OSB Model Validation

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:
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:

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

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

| OSB project | Tests on GitHub Actions | Test workflow script |
| OSBv1 project | Tests on GitHub Actions | Test workflow script |
|----------|:-------------:|:------:|
|[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) |
|[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) |
Expand Down Expand Up @@ -54,7 +54,7 @@ Setting up validation for a model and simulation written in NeuroML2/LEMS requir
### Write MEP files

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.
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).
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).

``` yaml
# Script for running automated tests on OSBrain, see https://github.com/OpenSourceBrain/osb-model-validation
Expand Down
2 changes: 0 additions & 2 deletions omv/engines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from omv.engines.pylemsnml2 import PyLemsNeuroML2Engine
from omv.engines.genesis import GenesisEngine

# from omv.engines.brian1 import Brian1Engine
from omv.engines.brian2_ import Brian2Engine
from omv.engines.arbor_ import ArborEngine
from omv.engines.xpp import XppEngine
Expand All @@ -33,7 +32,6 @@
from omv.engines.pynnneuron import PyNNNRNEngine
from omv.engines.pyneuron import PyNRNEngine

# from omv.engines.pynnbrian1 import PyNNBrian1Engine
from omv.engines.pynnbrian2 import PyNNBrian2Engine
from omv.engines.pynnnest import PyNNNestEngine
from omv.engines.pynnneuroml import PyNNNeuroMLEngine
Expand Down
59 changes: 0 additions & 59 deletions omv/engines/brian1.py

This file was deleted.

2 changes: 0 additions & 2 deletions omv/engines/getbrian2.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from omv.common.inout import pip_install

from omv.engines.getbrian1 import check_scipy_dev


def install_brian2(version):
if not version:
Expand Down
65 changes: 0 additions & 65 deletions omv/engines/jneuromlbrian.py

This file was deleted.

59 changes: 0 additions & 59 deletions omv/engines/pynnbrian1.py

This file was deleted.

27 changes: 12 additions & 15 deletions omv/omv_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
============================================

Usage:
omv all [-V | --verbose] [--engine=engine] [--ignore-non-py3]
omv all_ [-V | --verbose] [--engine=engine]
omv test <testMe.omt> [-V | --verbose]
omv all [-V | --verbose] [--engine=engine] [--ignore-non-py3] [--exit-zero]
omv all_ [-V | --verbose] [--engine=engine] [--ignore-non-py3] [--exit-zero]
omv test <testMe.omt> [-V | --verbose] [--exit-zero]
omv autogen [options]
omv install <engine>
omv find
Expand All @@ -20,6 +20,7 @@
-V --verbose Display additional diagnosis messages [default: False].
--version Show version.
--ignore-non-py3 If Python 3, ignore tests on non Py3 compatible engines [default: False]
--exit-zero Run tests as normal and report failures, but always exit with code 0 [default: False]
-y Auto-select default options (non-interactive mode)
"""

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

exit_zero = arguments["--exit-zero"]

if arguments["test"]:
try:
test_one(arguments["<testMe.omt>"])
except AssertionError:
inform("Failed due to non passing tests")
exit(1)
if not exit_zero:
exit(1)

elif arguments["all"]:
try:
Expand All @@ -74,7 +78,8 @@ def main():
)
except AssertionError:
inform("Failed due to non passing tests")
exit(1)
if not exit_zero:
exit(1)

# Includes *.omt_, i.e. temporary test files
elif arguments["all_"]:
Expand All @@ -86,7 +91,8 @@ def main():
)
except AssertionError:
inform("Failed due to non passing tests")
exit(1)
if not exit_zero:
exit(1)

elif arguments["find"]:
try:
Expand Down Expand Up @@ -364,15 +370,6 @@ def _install_engine(eng):

install_netpyne(engine_version)

elif eng.lower() == "Brian".lower():
if engine_version is not None:
raise Exception(
"Currently, cannot install a specific version of engine %s" % eng
)
from omv.engines.getbrian1 import install_brian

install_brian()

elif eng.lower() == "Brian2".lower():
from omv.engines.brian2_ import Brian2Engine as ee

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = OSBModelValidation
version = 0.3.11
version = 0.4.0
author = Boris Marin, Padraig Gleeson
author_email = borismarin@gmail.com
url = https://github.com/OpenSourceBrain/osb-model-validation
Expand Down
26 changes: 26 additions & 0 deletions utilities/tests/brokentest/.test.ex9.jnml.omt.broken
Original file line number Diff line number Diff line change
@@ -0,0 +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
mep: .test.ex9.mep
experiments:
V:
observables:
spike times:
file:
path: ../ex9.dat
columns: [0,1]
scaling: [1000, 1000]
spike detection:
method: derivative
tolerance: 0.004099
W:
observables:
spike times:
file:
path: ../ex9.dat
columns: [0,2]
scaling: [1000, 1]
spike detection:
method: derivative
tolerance: 0.000616
9 changes: 9 additions & 0 deletions utilities/tests/brokentest/.test.ex9.mep
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
system: Test Ex9

experiments:
V:
expected:
spike times: [2440.0]
W:
expected:
spike times: [16260, 52790]
3 changes: 0 additions & 3 deletions utilities/tests/test_brian1.py

This file was deleted.

7 changes: 6 additions & 1 deletion utilities/tests/test_pynn_simulators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from pyNN.utility import get_script_args
import sys

if len(sys.argv) > 1 and sys.argv[1].lower() in ["nest", "neuron", "brian2"]:
simulator = get_script_args(1)[0]
else:
simulator = "neuroml"

simulator = get_script_args(1)[0]
print("Importing pyNN.%s..." % simulator)
exec("import pyNN.%s as simulator" % simulator)

Expand Down
Loading