OSBModelValidation 0.2.18__tar.gz

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.
Files changed (125) hide show
  1. OSBModelValidation-0.2.18/MANIFEST.in +3 -0
  2. OSBModelValidation-0.2.18/OSBModelValidation.egg-info/PKG-INFO +184 -0
  3. OSBModelValidation-0.2.18/OSBModelValidation.egg-info/SOURCES.txt +124 -0
  4. OSBModelValidation-0.2.18/OSBModelValidation.egg-info/dependency_links.txt +1 -0
  5. OSBModelValidation-0.2.18/OSBModelValidation.egg-info/entry_points.txt +2 -0
  6. OSBModelValidation-0.2.18/OSBModelValidation.egg-info/requires.txt +10 -0
  7. OSBModelValidation-0.2.18/OSBModelValidation.egg-info/top_level.txt +1 -0
  8. OSBModelValidation-0.2.18/PKG-INFO +184 -0
  9. OSBModelValidation-0.2.18/README.md +158 -0
  10. OSBModelValidation-0.2.18/omv/__init__.py +8 -0
  11. OSBModelValidation-0.2.18/omv/analyzers/__init__.py +21 -0
  12. OSBModelValidation-0.2.18/omv/analyzers/activation.py +24 -0
  13. OSBModelValidation-0.2.18/omv/analyzers/analyzer.py +80 -0
  14. OSBModelValidation-0.2.18/omv/analyzers/dryrun.py +13 -0
  15. OSBModelValidation-0.2.18/omv/analyzers/input_resistance.py +47 -0
  16. OSBModelValidation-0.2.18/omv/analyzers/morphology.py +16 -0
  17. OSBModelValidation-0.2.18/omv/analyzers/rates.py +97 -0
  18. OSBModelValidation-0.2.18/omv/analyzers/resting.py +37 -0
  19. OSBModelValidation-0.2.18/omv/analyzers/spikes.py +113 -0
  20. OSBModelValidation-0.2.18/omv/analyzers/temperature.py +12 -0
  21. OSBModelValidation-0.2.18/omv/analyzers/timeseries.py +57 -0
  22. OSBModelValidation-0.2.18/omv/analyzers/utils/__init__.py +0 -0
  23. OSBModelValidation-0.2.18/omv/analyzers/utils/filenode.py +73 -0
  24. OSBModelValidation-0.2.18/omv/analyzers/utils/timeseries.py +293 -0
  25. OSBModelValidation-0.2.18/omv/autogen.py +106 -0
  26. OSBModelValidation-0.2.18/omv/common/__init__.py +0 -0
  27. OSBModelValidation-0.2.18/omv/common/inout.py +154 -0
  28. OSBModelValidation-0.2.18/omv/engines/__init__.py +53 -0
  29. OSBModelValidation-0.2.18/omv/engines/arbor_.py +57 -0
  30. OSBModelValidation-0.2.18/omv/engines/brian1.py +59 -0
  31. OSBModelValidation-0.2.18/omv/engines/brian2_.py +57 -0
  32. OSBModelValidation-0.2.18/omv/engines/eden_.py +63 -0
  33. OSBModelValidation-0.2.18/omv/engines/engine.py +111 -0
  34. OSBModelValidation-0.2.18/omv/engines/genesis.py +86 -0
  35. OSBModelValidation-0.2.18/omv/engines/getarbor.py +15 -0
  36. OSBModelValidation-0.2.18/omv/engines/getbrian1.py +42 -0
  37. OSBModelValidation-0.2.18/omv/engines/getbrian2.py +17 -0
  38. OSBModelValidation-0.2.18/omv/engines/geteden.py +17 -0
  39. OSBModelValidation-0.2.18/omv/engines/getgenesis.py +56 -0
  40. OSBModelValidation-0.2.18/omv/engines/getjlems.py +20 -0
  41. OSBModelValidation-0.2.18/omv/engines/getjnml.py +48 -0
  42. OSBModelValidation-0.2.18/omv/engines/getlibsbml.py +13 -0
  43. OSBModelValidation-0.2.18/omv/engines/getmoose.py +15 -0
  44. OSBModelValidation-0.2.18/omv/engines/getnest.py +62 -0
  45. OSBModelValidation-0.2.18/omv/engines/getnetpyne.py +52 -0
  46. OSBModelValidation-0.2.18/omv/engines/getneuroconstruct.py +31 -0
  47. OSBModelValidation-0.2.18/omv/engines/getnml2.py +26 -0
  48. OSBModelValidation-0.2.18/omv/engines/getnrn.py +60 -0
  49. OSBModelValidation-0.2.18/omv/engines/getoctave.py +11 -0
  50. OSBModelValidation-0.2.18/omv/engines/getpylems.py +13 -0
  51. OSBModelValidation-0.2.18/omv/engines/getpyneuroml.py +14 -0
  52. OSBModelValidation-0.2.18/omv/engines/getpynn.py +40 -0
  53. OSBModelValidation-0.2.18/omv/engines/jlems.py +48 -0
  54. OSBModelValidation-0.2.18/omv/engines/jneuroml.py +101 -0
  55. OSBModelValidation-0.2.18/omv/engines/jneuromlbrian.py +65 -0
  56. OSBModelValidation-0.2.18/omv/engines/jneuromlbrian2.py +61 -0
  57. OSBModelValidation-0.2.18/omv/engines/jneuromleden.py +61 -0
  58. OSBModelValidation-0.2.18/omv/engines/jneuromlmoose.py +63 -0
  59. OSBModelValidation-0.2.18/omv/engines/jneuromlnetpyne.py +73 -0
  60. OSBModelValidation-0.2.18/omv/engines/jneuromlnetpyne_np2.py +45 -0
  61. OSBModelValidation-0.2.18/omv/engines/jneuromlnetpyne_np4.py +45 -0
  62. OSBModelValidation-0.2.18/omv/engines/jneuromlnrn.py +78 -0
  63. OSBModelValidation-0.2.18/omv/engines/jneuromlpynnnrn.py +75 -0
  64. OSBModelValidation-0.2.18/omv/engines/jneuromlvalidate.py +62 -0
  65. OSBModelValidation-0.2.18/omv/engines/jneuromlvalidatev1.py +58 -0
  66. OSBModelValidation-0.2.18/omv/engines/moose_.py +86 -0
  67. OSBModelValidation-0.2.18/omv/engines/nestsli.py +84 -0
  68. OSBModelValidation-0.2.18/omv/engines/netpyne_.py +120 -0
  69. OSBModelValidation-0.2.18/omv/engines/netpyne__np2.py +47 -0
  70. OSBModelValidation-0.2.18/omv/engines/netpyne__np4.py +47 -0
  71. OSBModelValidation-0.2.18/omv/engines/neuron_.py +205 -0
  72. OSBModelValidation-0.2.18/omv/engines/octave.py +51 -0
  73. OSBModelValidation-0.2.18/omv/engines/pylems.py +57 -0
  74. OSBModelValidation-0.2.18/omv/engines/pylemsnml2.py +59 -0
  75. OSBModelValidation-0.2.18/omv/engines/pynest.py +111 -0
  76. OSBModelValidation-0.2.18/omv/engines/pyneuroconstruct.py +67 -0
  77. OSBModelValidation-0.2.18/omv/engines/pyneuroml_.py +55 -0
  78. OSBModelValidation-0.2.18/omv/engines/pyneuromlvalidatesbml.py +83 -0
  79. OSBModelValidation-0.2.18/omv/engines/pyneuron.py +94 -0
  80. OSBModelValidation-0.2.18/omv/engines/pynn.py +63 -0
  81. OSBModelValidation-0.2.18/omv/engines/pynnbrian1.py +59 -0
  82. OSBModelValidation-0.2.18/omv/engines/pynnbrian2.py +60 -0
  83. OSBModelValidation-0.2.18/omv/engines/pynnnest.py +56 -0
  84. OSBModelValidation-0.2.18/omv/engines/pynnneuroml.py +57 -0
  85. OSBModelValidation-0.2.18/omv/engines/pynnneuron.py +94 -0
  86. OSBModelValidation-0.2.18/omv/engines/utils/__init__.py +21 -0
  87. OSBModelValidation-0.2.18/omv/engines/utils/genesis_utils.g +26 -0
  88. OSBModelValidation-0.2.18/omv/engines/utils/wdir.py +15 -0
  89. OSBModelValidation-0.2.18/omv/experiment.py +18 -0
  90. OSBModelValidation-0.2.18/omv/find_tests.py +126 -0
  91. OSBModelValidation-0.2.18/omv/omt_mep_parser.py +59 -0
  92. OSBModelValidation-0.2.18/omv/omv_util.py +439 -0
  93. OSBModelValidation-0.2.18/omv/parse_omt.py +118 -0
  94. OSBModelValidation-0.2.18/omv/schemata/mep.yaml +7 -0
  95. OSBModelValidation-0.2.18/omv/schemata/types/base/observable_datafile.yaml +9 -0
  96. OSBModelValidation-0.2.18/omv/schemata/types/base/observable_literal.yaml +10 -0
  97. OSBModelValidation-0.2.18/omv/schemata/types/base/observables.yaml +16 -0
  98. OSBModelValidation-0.2.18/omv/schemata/types/base/test/observable_datafile.yaml +1 -0
  99. OSBModelValidation-0.2.18/omv/schemata/types/base/test/observable_literal.1.yaml +1 -0
  100. OSBModelValidation-0.2.18/omv/schemata/types/base/test/observable_literal.3.yaml +1 -0
  101. OSBModelValidation-0.2.18/omv/schemata/types/expected.yaml +5 -0
  102. OSBModelValidation-0.2.18/omv/schemata/types/experiment.yaml +4 -0
  103. OSBModelValidation-0.2.18/omv/schemata/types/observable.yaml +4 -0
  104. OSBModelValidation-0.2.18/omv/schemata/types/protocol.yaml +7 -0
  105. OSBModelValidation-0.2.18/omv/schemata/types/protocol_properties.yaml +2 -0
  106. OSBModelValidation-0.2.18/omv/schemata/types/test/expected.1.yaml +1 -0
  107. OSBModelValidation-0.2.18/omv/schemata/types/test/expected.2.yaml +1 -0
  108. OSBModelValidation-0.2.18/omv/schemata/types/test/expected.3.yaml +5 -0
  109. OSBModelValidation-0.2.18/omv/schemata/types/test/expected.4.yaml +8 -0
  110. OSBModelValidation-0.2.18/omv/schemata/types/test/experiment.1.yaml +3 -0
  111. OSBModelValidation-0.2.18/omv/schemata/types/test/experiment.2.yaml +8 -0
  112. OSBModelValidation-0.2.18/omv/schemata/types/test/observable.yaml +1 -0
  113. OSBModelValidation-0.2.18/omv/schemata/types/test/protocol.1.yaml +5 -0
  114. OSBModelValidation-0.2.18/omv/schemata/types/test/protocol.2.yaml +1 -0
  115. OSBModelValidation-0.2.18/omv/tally.py +112 -0
  116. OSBModelValidation-0.2.18/omv/test/__init__.py +0 -0
  117. OSBModelValidation-0.2.18/omv/test/test_rates.py +38 -0
  118. OSBModelValidation-0.2.18/omv/test/test_types.py +29 -0
  119. OSBModelValidation-0.2.18/omv/validation/__init__.py +0 -0
  120. OSBModelValidation-0.2.18/omv/validation/rx_validator.py +35 -0
  121. OSBModelValidation-0.2.18/omv/validation/utils.py +51 -0
  122. OSBModelValidation-0.2.18/omv/validation/validate.py +53 -0
  123. OSBModelValidation-0.2.18/omv/validation/validate_mep.py +15 -0
  124. OSBModelValidation-0.2.18/pyproject.toml +3 -0
  125. OSBModelValidation-0.2.18/setup.cfg +52 -0
@@ -0,0 +1,3 @@
1
+ include README.md
2
+ include omv/engines/utils/genesis_utils.g
3
+ recursive-include omv/schemata *
@@ -0,0 +1,184 @@
1
+ Metadata-Version: 2.1
2
+ Name: OSBModelValidation
3
+ Version: 0.2.18
4
+ Summary: Open Source Brain Model validation
5
+ Home-page: https://github.com/OpenSourceBrain/osb-model-validation
6
+ Author: Boris Marin, Padraig Gleeson
7
+ Author-email: borismarin@gmail.com
8
+ License: LGPL-3.0-only
9
+ Classifier: Intended Audience :: Science/Research
10
+ Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
11
+ Classifier: Natural Language :: English
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3.7
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Topic :: Scientific/Engineering
19
+ Description-Content-Type: text/markdown
20
+ Requires-Dist: PyYAML
21
+ Requires-Dist: numpy
22
+ Requires-Dist: pyrx
23
+ Requires-Dist: pathlib; python_version < "3.4"
24
+ Requires-Dist: docopt
25
+ Requires-Dist: importlib-metadata; python_version < "3.8"
26
+
27
+ [![Continuous builds](https://github.com/OpenSourceBrain/osb-model-validation/actions/workflows/ci.yml/badge.svg)](https://github.com/OpenSourceBrain/osb-model-validation/actions/workflows/ci.yml)
28
+ [![PyPI](https://img.shields.io/pypi/v/osb-model-validation)](https://pypi.org/project/osb-model-validation/)
29
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/osb-model-validation)](https://pypi.org/project/osb-model-validation/)
30
+ [![GitHub](https://img.shields.io/github/license/OpenSourceBrain/osb-model-validation)](https://github.com/OpenSourceBrain/osb-model-validation/blob/master/LICENSE.lesser)
31
+ [![GitHub pull requests](https://img.shields.io/github/issues-pr/OpenSourceBrain/osb-model-validation)](https://github.com/OpenSourceBrain/osb-model-validation/pulls)
32
+ [![GitHub issues](https://img.shields.io/github/issues/OpenSourceBrain/osb-model-validation)](https://github.com/OpenSourceBrain/osb-model-validation/issues)
33
+ [![Gitter](https://badges.gitter.im/NeuroML/community.svg)](https://gitter.im/NeuroML/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
34
+ ------------------------------------------
35
+
36
+ # OSB Model Validation
37
+
38
+ 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:
39
+
40
+ - on your local machine when developing models
41
+ - on [GitHub Actions](https://github.com/features/actions), to ensure tests pass on every commit.
42
+
43
+ To see this framework in action, click on some of the green buttons below:
44
+
45
+ | OSB project | Tests on GitHub Actions | Test workflow script |
46
+ |----------|:-------------:|:------:|
47
+ |[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) |
48
+ |[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) |
49
+ | [SBML Showcase](http://www.opensourcebrain.org/projects/sbmlshowcase)| [![Continuous build using OMV](https://github.com/OpenSourceBrain/sbmlshowcase/actions/workflows/omv-ci.yml/badge.svg)](https://github.com/OpenSourceBrain/sbmlshowcase/actions/workflows/omv-ci.yml) | [omv-ci.yml](https://github.com/OpenSourceBrain/sbmlshowcase/blob/master/.github/workflows/omv-ci.yml) |
50
+
51
+ This framework has been used to test the 30+ NeuroML and PyNN models described in the [Open Source Brain paper (Gleeson et al. 2019)](https://www.cell.com/neuron/fulltext/S0896-6273(19)30444-1), and [many more](https://github.com/OpenSourceBrain/.github/blob/main/testsheet/README.md).
52
+
53
+ ## Installation
54
+
55
+ Quick system-wide install:
56
+
57
+ ``` bash
58
+ pip install osb-model-validation
59
+ ```
60
+
61
+ Or you can install from cloned repository (preferably in a virtual environment):
62
+
63
+ ``` bash
64
+ git clone https://github.com/OpenSourceBrain/osb-model-validation.git
65
+ cd osb-model-validation
66
+ pip install .
67
+ ```
68
+
69
+ ## Instructions
70
+
71
+ Any _Open Source Brain_ project can have automated testing incorporated.
72
+ For an overview of the various Open Source Brain projects with OMV tests, see https://github.com/OpenSourceBrain/.github/blob/main/testsheet/README.md (note not all of these use OMV yet).
73
+
74
+ Setting up validation for a model and simulation written in NeuroML2/LEMS requires two additional steps:
75
+
76
+ - write a <b>M</b>odel <b>E</b>mergent <b>P</b>roperties (_mep_) file.
77
+ - write the corresponding <b>O</b>SB <b>M</b>odel <b>T</b>est (_omt_) file.
78
+
79
+
80
+ ### Write MEP files
81
+
82
+ 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.
83
+ 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).
84
+
85
+ ``` yaml
86
+ # Script for running automated tests on OSBrain, see https://github.com/OpenSourceBrain/osb-model-validation
87
+
88
+ system: The Fitzhugh-Nagumo model, classical parameters
89
+
90
+ experiments:
91
+ experiment 1, free run:
92
+ expected:
93
+ spike times: [2.24, 39.82, 76.53, 113.24, 149.94, 186.65, 223.36, 260.07, 296.78, 333.49, 370.2]
94
+ ```
95
+
96
+ MEP files include information on what is expected from the simulation run.
97
+ OMV will run the simulation based on the OMT files (which we'll see below), and compare the output to the information provided in MEP files.
98
+ Multiple _experiments_ can be mentioned in the MEP file, and each project can have multiple MEP files.
99
+
100
+ The MEP file for the FitzHugh-Nagumo model is [here](https://github.com/OpenSourceBrain/FitzHugh-Nagumo/blob/master/fhn.mep).
101
+ It includes a single experiment, with the expected spike times that the simulation run should generate.
102
+
103
+ ### Writing OMT files
104
+
105
+ OMT files include information on simulating the model for validation.
106
+ The FitzHugh-Nagumo model on Open Source Brain includes multiple OMT files that can be seen [here](https://github.com/OpenSourceBrain/FitzHugh-Nagumo/tree/master/NeuroML2).
107
+
108
+ - Each OMT file specifies a _target_ file, which is the LEMS simulation file to be run.
109
+
110
+ - Each OMT file specifies an _engine_ that OMV supports.
111
+ Engines are simulators that OMV should use to run the model. See [here](https://github.com/OpenSourceBrain/osb-model-validation/tree/master/omv/engines) for the current list.
112
+ For example, the [.test.fhn.jnml.omt](https://github.com/OpenSourceBrain/FitzHugh-Nagumo/blob/master/NeuroML2/.test.fhn.jnml.omt) file uses the `jNeuroML` engine, which implies that the model should be run using plain jNeuroML (and not any of the simulators that jNeuroML supports, like NEURON).
113
+
114
+ ``` yaml
115
+ # Script for running automated tests on OSB, see https://github.com/OpenSourceBrain/osb-model-validation
116
+
117
+ target: LEMS_FitzHughNagumo.xml
118
+ engine: jNeuroML
119
+ mep: ../fhn.mep
120
+ experiments:
121
+ experiment 1, free run:
122
+ observables:
123
+ spike times:
124
+ file:
125
+ path: ./fhn.dat
126
+ columns: [0,1]
127
+ scaling: [1000, 1]
128
+ spike detection:
129
+ method: derivative
130
+ tolerance: 2.185696883946938e-16
131
+ ```
132
+
133
+ - Each OMT file specifies the MEP file that the output of its simulation run should be compared to.
134
+ In this case, we use the same MEP file for all OMT files.
135
+
136
+ - Finally, like MEP files, OMT files also include _experiments_.
137
+ The names of the experiments in the OMT files must correspond to those used in the MEP files, so that OMV knows what section of the OMT and MEP files are related to each other.
138
+ In each experiment, we specify our _observables_, which are to be compared to the information provided in the MEP file.
139
+ Here, we inform OMV that we are observing _spike times_, which will be recorded by the simulation run in `fhn.dat`.
140
+ We also inform OMV what columns of this file the information is to be extracted from, and if these columns need to be scaled before they are compared to the data provided in the MEP file.
141
+ Finally, while simulations can save spike times directly and OMV will compare these to the MEP file, if the simulation is recording membrane potentials, OMV can also be asked to detect spikes from this data using the _spike detection_ section.
142
+ The _tolerance_ key tells OMV what the acceptable difference between the expected and observed data values is.
143
+
144
+ This is the OMT file to validate the same model using the `jNeuroML_NEURON` engine: [.test.fhn.jnmlnrn.omt](https://github.com/OpenSourceBrain/FitzHugh-Nagumo/blob/master/NeuroML2/.test.fhn.jnmlnrn.omt).
145
+ It uses the same MEP file, and observes the same recorded information.
146
+ It only tells OMV to use a different simulation engine:
147
+
148
+ ``` yaml
149
+ # Script for running automated tests on OSB, see https://github.com/OpenSourceBrain/osb-model-validation
150
+
151
+ target: LEMS_FitzHughNagumo.xml
152
+ engine: jNeuroML_NEURON
153
+ mep: ../fhn.mep
154
+ experiments:
155
+ experiment 1, free run:
156
+ observables:
157
+ spike times:
158
+ file:
159
+ path: ./fhn.dat
160
+ columns: [0,1]
161
+ scaling: [1000, 1]
162
+ spike detection:
163
+ method: derivative
164
+ tolerance: 0
165
+ ```
166
+ ### Running validation tests locally
167
+
168
+ If you have installed OMV successfully, you can now run all the OMV tests locally, by running this command:
169
+
170
+ omv all
171
+
172
+ Adding the `-V` flag prints more details on successful/failed runs. Learn more about the options that `omv` can take by running `omv --help`.
173
+
174
+ To see what [engines](https://github.com/OpenSourceBrain/osb-model-validation/tree/master/omv/engines) are currently installed (and what their versions are) type:
175
+
176
+ omv list -V
177
+
178
+ Running validation tests locally ensures that you can quickly check if any changes you have made to the model cause changes to its specific outcomes.
179
+ Since you can run the validation with different [engines](https://github.com/OpenSourceBrain/osb-model-validation/tree/master/omv/engines) to use different simulators, this also allows you to quickly verify that your model gives similar results using these different tools.
180
+
181
+
182
+ ### Running tests automatically on GitHub Actions
183
+
184
+ To use OMV with GHA, copy an existing configuration file, e.g. https://github.com/OpenSourceBrain/ACnet2/blob/master/.github/workflows/omv-ci.yml and place it in the required repository.
@@ -0,0 +1,124 @@
1
+ MANIFEST.in
2
+ README.md
3
+ pyproject.toml
4
+ setup.cfg
5
+ OSBModelValidation.egg-info/PKG-INFO
6
+ OSBModelValidation.egg-info/SOURCES.txt
7
+ OSBModelValidation.egg-info/dependency_links.txt
8
+ OSBModelValidation.egg-info/entry_points.txt
9
+ OSBModelValidation.egg-info/requires.txt
10
+ OSBModelValidation.egg-info/top_level.txt
11
+ omv/__init__.py
12
+ omv/autogen.py
13
+ omv/experiment.py
14
+ omv/find_tests.py
15
+ omv/omt_mep_parser.py
16
+ omv/omv_util.py
17
+ omv/parse_omt.py
18
+ omv/tally.py
19
+ omv/analyzers/__init__.py
20
+ omv/analyzers/activation.py
21
+ omv/analyzers/analyzer.py
22
+ omv/analyzers/dryrun.py
23
+ omv/analyzers/input_resistance.py
24
+ omv/analyzers/morphology.py
25
+ omv/analyzers/rates.py
26
+ omv/analyzers/resting.py
27
+ omv/analyzers/spikes.py
28
+ omv/analyzers/temperature.py
29
+ omv/analyzers/timeseries.py
30
+ omv/analyzers/utils/__init__.py
31
+ omv/analyzers/utils/filenode.py
32
+ omv/analyzers/utils/timeseries.py
33
+ omv/common/__init__.py
34
+ omv/common/inout.py
35
+ omv/engines/__init__.py
36
+ omv/engines/arbor_.py
37
+ omv/engines/brian1.py
38
+ omv/engines/brian2_.py
39
+ omv/engines/eden_.py
40
+ omv/engines/engine.py
41
+ omv/engines/genesis.py
42
+ omv/engines/getarbor.py
43
+ omv/engines/getbrian1.py
44
+ omv/engines/getbrian2.py
45
+ omv/engines/geteden.py
46
+ omv/engines/getgenesis.py
47
+ omv/engines/getjlems.py
48
+ omv/engines/getjnml.py
49
+ omv/engines/getlibsbml.py
50
+ omv/engines/getmoose.py
51
+ omv/engines/getnest.py
52
+ omv/engines/getnetpyne.py
53
+ omv/engines/getneuroconstruct.py
54
+ omv/engines/getnml2.py
55
+ omv/engines/getnrn.py
56
+ omv/engines/getoctave.py
57
+ omv/engines/getpylems.py
58
+ omv/engines/getpyneuroml.py
59
+ omv/engines/getpynn.py
60
+ omv/engines/jlems.py
61
+ omv/engines/jneuroml.py
62
+ omv/engines/jneuromlbrian.py
63
+ omv/engines/jneuromlbrian2.py
64
+ omv/engines/jneuromleden.py
65
+ omv/engines/jneuromlmoose.py
66
+ omv/engines/jneuromlnetpyne.py
67
+ omv/engines/jneuromlnetpyne_np2.py
68
+ omv/engines/jneuromlnetpyne_np4.py
69
+ omv/engines/jneuromlnrn.py
70
+ omv/engines/jneuromlpynnnrn.py
71
+ omv/engines/jneuromlvalidate.py
72
+ omv/engines/jneuromlvalidatev1.py
73
+ omv/engines/moose_.py
74
+ omv/engines/nestsli.py
75
+ omv/engines/netpyne_.py
76
+ omv/engines/netpyne__np2.py
77
+ omv/engines/netpyne__np4.py
78
+ omv/engines/neuron_.py
79
+ omv/engines/octave.py
80
+ omv/engines/pylems.py
81
+ omv/engines/pylemsnml2.py
82
+ omv/engines/pynest.py
83
+ omv/engines/pyneuroconstruct.py
84
+ omv/engines/pyneuroml_.py
85
+ omv/engines/pyneuromlvalidatesbml.py
86
+ omv/engines/pyneuron.py
87
+ omv/engines/pynn.py
88
+ omv/engines/pynnbrian1.py
89
+ omv/engines/pynnbrian2.py
90
+ omv/engines/pynnnest.py
91
+ omv/engines/pynnneuroml.py
92
+ omv/engines/pynnneuron.py
93
+ omv/engines/utils/__init__.py
94
+ omv/engines/utils/genesis_utils.g
95
+ omv/engines/utils/wdir.py
96
+ omv/schemata/mep.yaml
97
+ omv/schemata/types/expected.yaml
98
+ omv/schemata/types/experiment.yaml
99
+ omv/schemata/types/observable.yaml
100
+ omv/schemata/types/protocol.yaml
101
+ omv/schemata/types/protocol_properties.yaml
102
+ omv/schemata/types/base/observable_datafile.yaml
103
+ omv/schemata/types/base/observable_literal.yaml
104
+ omv/schemata/types/base/observables.yaml
105
+ omv/schemata/types/base/test/observable_datafile.yaml
106
+ omv/schemata/types/base/test/observable_literal.1.yaml
107
+ omv/schemata/types/base/test/observable_literal.3.yaml
108
+ omv/schemata/types/test/expected.1.yaml
109
+ omv/schemata/types/test/expected.2.yaml
110
+ omv/schemata/types/test/expected.3.yaml
111
+ omv/schemata/types/test/expected.4.yaml
112
+ omv/schemata/types/test/experiment.1.yaml
113
+ omv/schemata/types/test/experiment.2.yaml
114
+ omv/schemata/types/test/observable.yaml
115
+ omv/schemata/types/test/protocol.1.yaml
116
+ omv/schemata/types/test/protocol.2.yaml
117
+ omv/test/__init__.py
118
+ omv/test/test_rates.py
119
+ omv/test/test_types.py
120
+ omv/validation/__init__.py
121
+ omv/validation/rx_validator.py
122
+ omv/validation/utils.py
123
+ omv/validation/validate.py
124
+ omv/validation/validate_mep.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ omv = omv.omv_util:main
@@ -0,0 +1,10 @@
1
+ PyYAML
2
+ numpy
3
+ pyrx
4
+ docopt
5
+
6
+ [:python_version < "3.4"]
7
+ pathlib
8
+
9
+ [:python_version < "3.8"]
10
+ importlib-metadata
@@ -0,0 +1,184 @@
1
+ Metadata-Version: 2.1
2
+ Name: OSBModelValidation
3
+ Version: 0.2.18
4
+ Summary: Open Source Brain Model validation
5
+ Home-page: https://github.com/OpenSourceBrain/osb-model-validation
6
+ Author: Boris Marin, Padraig Gleeson
7
+ Author-email: borismarin@gmail.com
8
+ License: LGPL-3.0-only
9
+ Classifier: Intended Audience :: Science/Research
10
+ Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
11
+ Classifier: Natural Language :: English
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3.7
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Topic :: Scientific/Engineering
19
+ Description-Content-Type: text/markdown
20
+ Requires-Dist: PyYAML
21
+ Requires-Dist: numpy
22
+ Requires-Dist: pyrx
23
+ Requires-Dist: pathlib; python_version < "3.4"
24
+ Requires-Dist: docopt
25
+ Requires-Dist: importlib-metadata; python_version < "3.8"
26
+
27
+ [![Continuous builds](https://github.com/OpenSourceBrain/osb-model-validation/actions/workflows/ci.yml/badge.svg)](https://github.com/OpenSourceBrain/osb-model-validation/actions/workflows/ci.yml)
28
+ [![PyPI](https://img.shields.io/pypi/v/osb-model-validation)](https://pypi.org/project/osb-model-validation/)
29
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/osb-model-validation)](https://pypi.org/project/osb-model-validation/)
30
+ [![GitHub](https://img.shields.io/github/license/OpenSourceBrain/osb-model-validation)](https://github.com/OpenSourceBrain/osb-model-validation/blob/master/LICENSE.lesser)
31
+ [![GitHub pull requests](https://img.shields.io/github/issues-pr/OpenSourceBrain/osb-model-validation)](https://github.com/OpenSourceBrain/osb-model-validation/pulls)
32
+ [![GitHub issues](https://img.shields.io/github/issues/OpenSourceBrain/osb-model-validation)](https://github.com/OpenSourceBrain/osb-model-validation/issues)
33
+ [![Gitter](https://badges.gitter.im/NeuroML/community.svg)](https://gitter.im/NeuroML/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
34
+ ------------------------------------------
35
+
36
+ # OSB Model Validation
37
+
38
+ 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:
39
+
40
+ - on your local machine when developing models
41
+ - on [GitHub Actions](https://github.com/features/actions), to ensure tests pass on every commit.
42
+
43
+ To see this framework in action, click on some of the green buttons below:
44
+
45
+ | OSB project | Tests on GitHub Actions | Test workflow script |
46
+ |----------|:-------------:|:------:|
47
+ |[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) |
48
+ |[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) |
49
+ | [SBML Showcase](http://www.opensourcebrain.org/projects/sbmlshowcase)| [![Continuous build using OMV](https://github.com/OpenSourceBrain/sbmlshowcase/actions/workflows/omv-ci.yml/badge.svg)](https://github.com/OpenSourceBrain/sbmlshowcase/actions/workflows/omv-ci.yml) | [omv-ci.yml](https://github.com/OpenSourceBrain/sbmlshowcase/blob/master/.github/workflows/omv-ci.yml) |
50
+
51
+ This framework has been used to test the 30+ NeuroML and PyNN models described in the [Open Source Brain paper (Gleeson et al. 2019)](https://www.cell.com/neuron/fulltext/S0896-6273(19)30444-1), and [many more](https://github.com/OpenSourceBrain/.github/blob/main/testsheet/README.md).
52
+
53
+ ## Installation
54
+
55
+ Quick system-wide install:
56
+
57
+ ``` bash
58
+ pip install osb-model-validation
59
+ ```
60
+
61
+ Or you can install from cloned repository (preferably in a virtual environment):
62
+
63
+ ``` bash
64
+ git clone https://github.com/OpenSourceBrain/osb-model-validation.git
65
+ cd osb-model-validation
66
+ pip install .
67
+ ```
68
+
69
+ ## Instructions
70
+
71
+ Any _Open Source Brain_ project can have automated testing incorporated.
72
+ For an overview of the various Open Source Brain projects with OMV tests, see https://github.com/OpenSourceBrain/.github/blob/main/testsheet/README.md (note not all of these use OMV yet).
73
+
74
+ Setting up validation for a model and simulation written in NeuroML2/LEMS requires two additional steps:
75
+
76
+ - write a <b>M</b>odel <b>E</b>mergent <b>P</b>roperties (_mep_) file.
77
+ - write the corresponding <b>O</b>SB <b>M</b>odel <b>T</b>est (_omt_) file.
78
+
79
+
80
+ ### Write MEP files
81
+
82
+ 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.
83
+ 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).
84
+
85
+ ``` yaml
86
+ # Script for running automated tests on OSBrain, see https://github.com/OpenSourceBrain/osb-model-validation
87
+
88
+ system: The Fitzhugh-Nagumo model, classical parameters
89
+
90
+ experiments:
91
+ experiment 1, free run:
92
+ expected:
93
+ spike times: [2.24, 39.82, 76.53, 113.24, 149.94, 186.65, 223.36, 260.07, 296.78, 333.49, 370.2]
94
+ ```
95
+
96
+ MEP files include information on what is expected from the simulation run.
97
+ OMV will run the simulation based on the OMT files (which we'll see below), and compare the output to the information provided in MEP files.
98
+ Multiple _experiments_ can be mentioned in the MEP file, and each project can have multiple MEP files.
99
+
100
+ The MEP file for the FitzHugh-Nagumo model is [here](https://github.com/OpenSourceBrain/FitzHugh-Nagumo/blob/master/fhn.mep).
101
+ It includes a single experiment, with the expected spike times that the simulation run should generate.
102
+
103
+ ### Writing OMT files
104
+
105
+ OMT files include information on simulating the model for validation.
106
+ The FitzHugh-Nagumo model on Open Source Brain includes multiple OMT files that can be seen [here](https://github.com/OpenSourceBrain/FitzHugh-Nagumo/tree/master/NeuroML2).
107
+
108
+ - Each OMT file specifies a _target_ file, which is the LEMS simulation file to be run.
109
+
110
+ - Each OMT file specifies an _engine_ that OMV supports.
111
+ Engines are simulators that OMV should use to run the model. See [here](https://github.com/OpenSourceBrain/osb-model-validation/tree/master/omv/engines) for the current list.
112
+ For example, the [.test.fhn.jnml.omt](https://github.com/OpenSourceBrain/FitzHugh-Nagumo/blob/master/NeuroML2/.test.fhn.jnml.omt) file uses the `jNeuroML` engine, which implies that the model should be run using plain jNeuroML (and not any of the simulators that jNeuroML supports, like NEURON).
113
+
114
+ ``` yaml
115
+ # Script for running automated tests on OSB, see https://github.com/OpenSourceBrain/osb-model-validation
116
+
117
+ target: LEMS_FitzHughNagumo.xml
118
+ engine: jNeuroML
119
+ mep: ../fhn.mep
120
+ experiments:
121
+ experiment 1, free run:
122
+ observables:
123
+ spike times:
124
+ file:
125
+ path: ./fhn.dat
126
+ columns: [0,1]
127
+ scaling: [1000, 1]
128
+ spike detection:
129
+ method: derivative
130
+ tolerance: 2.185696883946938e-16
131
+ ```
132
+
133
+ - Each OMT file specifies the MEP file that the output of its simulation run should be compared to.
134
+ In this case, we use the same MEP file for all OMT files.
135
+
136
+ - Finally, like MEP files, OMT files also include _experiments_.
137
+ The names of the experiments in the OMT files must correspond to those used in the MEP files, so that OMV knows what section of the OMT and MEP files are related to each other.
138
+ In each experiment, we specify our _observables_, which are to be compared to the information provided in the MEP file.
139
+ Here, we inform OMV that we are observing _spike times_, which will be recorded by the simulation run in `fhn.dat`.
140
+ We also inform OMV what columns of this file the information is to be extracted from, and if these columns need to be scaled before they are compared to the data provided in the MEP file.
141
+ Finally, while simulations can save spike times directly and OMV will compare these to the MEP file, if the simulation is recording membrane potentials, OMV can also be asked to detect spikes from this data using the _spike detection_ section.
142
+ The _tolerance_ key tells OMV what the acceptable difference between the expected and observed data values is.
143
+
144
+ This is the OMT file to validate the same model using the `jNeuroML_NEURON` engine: [.test.fhn.jnmlnrn.omt](https://github.com/OpenSourceBrain/FitzHugh-Nagumo/blob/master/NeuroML2/.test.fhn.jnmlnrn.omt).
145
+ It uses the same MEP file, and observes the same recorded information.
146
+ It only tells OMV to use a different simulation engine:
147
+
148
+ ``` yaml
149
+ # Script for running automated tests on OSB, see https://github.com/OpenSourceBrain/osb-model-validation
150
+
151
+ target: LEMS_FitzHughNagumo.xml
152
+ engine: jNeuroML_NEURON
153
+ mep: ../fhn.mep
154
+ experiments:
155
+ experiment 1, free run:
156
+ observables:
157
+ spike times:
158
+ file:
159
+ path: ./fhn.dat
160
+ columns: [0,1]
161
+ scaling: [1000, 1]
162
+ spike detection:
163
+ method: derivative
164
+ tolerance: 0
165
+ ```
166
+ ### Running validation tests locally
167
+
168
+ If you have installed OMV successfully, you can now run all the OMV tests locally, by running this command:
169
+
170
+ omv all
171
+
172
+ Adding the `-V` flag prints more details on successful/failed runs. Learn more about the options that `omv` can take by running `omv --help`.
173
+
174
+ To see what [engines](https://github.com/OpenSourceBrain/osb-model-validation/tree/master/omv/engines) are currently installed (and what their versions are) type:
175
+
176
+ omv list -V
177
+
178
+ Running validation tests locally ensures that you can quickly check if any changes you have made to the model cause changes to its specific outcomes.
179
+ Since you can run the validation with different [engines](https://github.com/OpenSourceBrain/osb-model-validation/tree/master/omv/engines) to use different simulators, this also allows you to quickly verify that your model gives similar results using these different tools.
180
+
181
+
182
+ ### Running tests automatically on GitHub Actions
183
+
184
+ To use OMV with GHA, copy an existing configuration file, e.g. https://github.com/OpenSourceBrain/ACnet2/blob/master/.github/workflows/omv-ci.yml and place it in the required repository.