Skip to content

Commit

Permalink
Merge pull request #60 from NeuroML/experimental
Browse files Browse the repository at this point in the history
Update to v0.5.7
  • Loading branch information
pgleeson committed Sep 15, 2023
2 parents 5c9eb7c + d192a5a commit ac205ae
Show file tree
Hide file tree
Showing 42 changed files with 61 additions and 52 deletions.
2 changes: 1 addition & 1 deletion docs/NeuroMLlite_specification.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"specification": {
"Network": {
"definition": "A Network containing multiple Population's, connected by Projection's and receiving Input's",
Expand Down
2 changes: 1 addition & 1 deletion docs/NeuroMLlite_specification.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: NeuroMLlite v0.5.6
version: NeuroMLlite v0.5.7
specification:
Network:
definition: A Network containing multiple Population's, connected by Projection's
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Specification of NeuroMLlite v0.5.6
# Specification of NeuroMLlite v0.5.7
**Note: the NeuroMLlite specification is still in development! Subject to change...**

## Network
Expand Down
2 changes: 1 addition & 1 deletion examples/Example10_Lorenz.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Example10_Lorenz": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"notes": "Example 10: Lorenz",
"parameters": {
"N": 1,
Expand Down
2 changes: 1 addition & 1 deletion examples/Example11_Synapses.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Example11_Synapses": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"notes": "Example 11: synaptic properties",
"parameters": {
"input_amp": 0.23,
Expand Down
2 changes: 1 addition & 1 deletion examples/Example11_Synapses.net.nml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2.3.xsd" id="Example11_Synapses">
<notes>Generated by NeuroMLlite v0.5.6
<notes>Generated by NeuroMLlite v0.5.7
Generated network: Example11_Synapses
Generation seed: 1234
NeuroMLlite parameters:
Expand Down
2 changes: 1 addition & 1 deletion examples/Example12_MultiComp.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Example12_MultiComp": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"notes": "Example 12: Multicompartmental cells...",
"parameters": {
"N": 20,
Expand Down
2 changes: 1 addition & 1 deletion examples/Example1_TestNetwork.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"TestNetwork": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"notes": "A simple network with 2 populations & projection between them. No info yet on what the cells are so network can't be simulated.",
"populations": {
"pop0": {
Expand Down
2 changes: 1 addition & 1 deletion examples/Example2_TestNetwork.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Example2_TestNetwork": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"notes": "A simple network with 2 populations & projection between them. Cells are specified to be NeuroML 2 HH cell models & pre population is given a spiking input.",
"cells": {
"hhcell": {
Expand Down
2 changes: 1 addition & 1 deletion examples/Example2_TestNetwork.net.nml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2.3.xsd" id="Example2_TestNetwork">
<notes>Generated by NeuroMLlite v0.5.6
<notes>Generated by NeuroMLlite v0.5.7
Generated network: Example2_TestNetwork
Generation seed: 1234</notes>
<include href="test_files/inputs.nml"/>
Expand Down
2 changes: 1 addition & 1 deletion examples/Example3_Network.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Example3_Network": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"notes": "Example 3: simple network with 2 populations of NeuroML2 cells, a projection between them and spiking input.",
"cells": {
"hhcell": {
Expand Down
2 changes: 1 addition & 1 deletion examples/Example3_Network.net.nml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2.3.xsd" id="Example3_Network">
<notes>Generated by NeuroMLlite v0.5.6
<notes>Generated by NeuroMLlite v0.5.7
Generated network: Example3_Network
Generation seed: 1234</notes>
<include href="test_files/inputs.nml"/>
Expand Down
2 changes: 1 addition & 1 deletion examples/Example4_PyNN.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Example4_PyNN": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"notes": "Example 4: a network with PyNN cells & inputs",
"parameters": {
"input_amp": 0.99
Expand Down
2 changes: 1 addition & 1 deletion examples/Example4_PyNN.net.nml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2.3.xsd" id="Example4_PyNN">
<notes>Generated by NeuroMLlite v0.5.6
<notes>Generated by NeuroMLlite v0.5.7
Generated network: Example4_PyNN
Generation seed: 1234
NeuroMLlite parameters:
Expand Down
2 changes: 1 addition & 1 deletion examples/Example4_PyNN.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Example4_PyNN:
version: NeuroMLlite v0.5.6
version: NeuroMLlite v0.5.7
notes: 'Example 4: a network with PyNN cells & inputs'
parameters:
input_amp: 0.99
Expand Down
2 changes: 1 addition & 1 deletion examples/Example6_PyNN.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Example6_PyNN": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"notes": "Another network for PyNN - work in progress...",
"parameters": {
"N_scaling": 0.005,
Expand Down
2 changes: 1 addition & 1 deletion examples/Example6_PyNN.net.nml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2.3.xsd" id="Example6_PyNN">
<notes>Generated by NeuroMLlite v0.5.6
<notes>Generated by NeuroMLlite v0.5.7
Generated network: Example6_PyNN
Generation seed: 1234
NeuroMLlite parameters:
Expand Down
2 changes: 1 addition & 1 deletion examples/Example6_PyNN_noinputs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Example6_PyNN_noinputs": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"notes": "Another network for PyNN - work in progress...",
"parameters": {
"N_scaling": 0.005,
Expand Down
2 changes: 1 addition & 1 deletion examples/Example6_PyNN_noinputs.net.nml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2.3.xsd" id="Example6_PyNN_noinputs">
<notes>Generated by NeuroMLlite v0.5.6
<notes>Generated by NeuroMLlite v0.5.7
Generated network: Example6_PyNN_noinputs
Generation seed: 1234
NeuroMLlite parameters:
Expand Down
2 changes: 1 addition & 1 deletion examples/Example7_Brunel2000.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Example7_Brunel2000": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"notes": "Example 7: based on network of Brunel 2000",
"parameters": {
"g": 4,
Expand Down
2 changes: 1 addition & 1 deletion examples/Example7_Brunel2000.net.nml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2.3.xsd" id="Example7_Brunel2000">
<notes>Generated by NeuroMLlite v0.5.6
<notes>Generated by NeuroMLlite v0.5.7
Generated network: Example7_Brunel2000
Generation seed: 1234
NeuroMLlite parameters:
Expand Down
2 changes: 1 addition & 1 deletion examples/Example8_Extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Example8_Extension": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"notes": "Example 8: general testing...",
"parameters": {
"N": 10,
Expand Down
2 changes: 1 addition & 1 deletion examples/Example9_HindmarshRose.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Example9_HindmarshRose": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"notes": "Example 9: HindmarshRose",
"parameters": {
"N": 1,
Expand Down
2 changes: 1 addition & 1 deletion examples/SimExample10.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SimExample10": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"network": "Example10_Lorenz.json",
"duration": 10000.0,
"dt": 1.0,
Expand Down
2 changes: 1 addition & 1 deletion examples/SimExample11.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SimExample11": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"network": "Example11_Synapses.json",
"duration": 1000.0,
"dt": 0.01,
Expand Down
2 changes: 1 addition & 1 deletion examples/SimExample12_MultiComp.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SimExample12_MultiComp": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"network": "Example12_MultiComp.json",
"duration": 1000.0,
"dt": 0.025,
Expand Down
2 changes: 1 addition & 1 deletion examples/SimExample3.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SimExample3": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"network": "Example3_Network.json",
"duration": 1000.0,
"dt": 0.025,
Expand Down
2 changes: 1 addition & 1 deletion examples/SimExample4.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SimExample4": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"network": "Example4_PyNN.json",
"duration": 1000.0,
"dt": 0.01,
Expand Down
2 changes: 1 addition & 1 deletion examples/SimExample4.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SimExample4:
version: NeuroMLlite v0.5.6
version: NeuroMLlite v0.5.7
network: Example4_PyNN.yaml
duration: 1000.0
dt: 0.01
Expand Down
2 changes: 1 addition & 1 deletion examples/SimExample6_PyNN.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SimExample6_PyNN": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"network": "Example6_PyNN.json",
"duration": 100.0,
"dt": 0.025,
Expand Down
2 changes: 1 addition & 1 deletion examples/SimExample7.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SimExample7": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"network": "Example7_Brunel2000.json",
"duration": 1000.0,
"dt": 0.025,
Expand Down
2 changes: 1 addition & 1 deletion examples/SimExample8.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SimExample8": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"network": "Example8_Extension.json",
"duration": 1000.0,
"dt": 0.025,
Expand Down
2 changes: 1 addition & 1 deletion examples/SimExample9.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SimExample9": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"network": "Example9_HindmarshRose.json",
"duration": 1000000.0,
"dt": 25.0,
Expand Down
2 changes: 1 addition & 1 deletion examples/arbor/ArborExample.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ArborExample": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"notes": "Example for testing Arbor",
"parameters": {
"v_init": -50,
Expand Down
2 changes: 1 addition & 1 deletion examples/arbor/ArborExample.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ArborExample:
version: NeuroMLlite v0.5.6
version: NeuroMLlite v0.5.7
notes: Example for testing Arbor
parameters:
v_init: -50
Expand Down
2 changes: 1 addition & 1 deletion examples/arbor/SimArborExample.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SimArborExample": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"network": "ArborExample.json",
"duration": 100.0,
"dt": 0.01,
Expand Down
2 changes: 1 addition & 1 deletion examples/arbor/SimArborExample.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SimArborExample:
version: NeuroMLlite v0.5.6
version: NeuroMLlite v0.5.7
network: ArborExample.yaml
duration: 100.0
dt: 0.01
Expand Down
2 changes: 1 addition & 1 deletion examples/spikeratetest/SimSpikers.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SimSpikers": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"network": "Spikers.json",
"duration": 10000.0,
"dt": 0.025,
Expand Down
2 changes: 1 addition & 1 deletion examples/spikeratetest/Spikers.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Spikers": {
"version": "NeuroMLlite v0.5.6",
"version": "NeuroMLlite v0.5.7",
"notes": "Example with spiking entities..",
"parameters": {
"N": 10,
Expand Down
2 changes: 1 addition & 1 deletion examples/test_files/.test.validate.omt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Script for running automated tests on OSB using Travis-CI, see https://github.com/OpenSourceBrain/osb-model-validation

# This test will validate all of the NeuroML 2 files in the current directory using: jnml -validate *.nml
target: "*.nml"
target: "../Example2_TestNetwork.net.nml ../Example3_Network.net.nml ../Example4_PyNN.net.nml ../Example6_PyNN.net.nml ../Example7_Brunel2000.net.nml ../Example12_MultiComp.net.nml *.nml"
engine: jNeuroML_validate
31 changes: 20 additions & 11 deletions neuromllite/MDFHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,13 @@ def _comp_to_mdf_node(self, nmllite_comp, lems_comp_id, size=1, properties=None)

print_v(
"All LEMS Components in known LEMS model: %s"
% list(model.components.keys())
% sorted(list(model.components.keys()))
)
print_v("This comp: %s" % lems_comp)
print_v(
"All LEMS ComponentTypes in known LEMS model: %s"
% sorted(list(model.component_types.keys()))
)
print_v("This LEMS comp: %s" % lems_comp)
comp_type_name = lems_comp.type
lems_comp_type = model.component_types.get(comp_type_name)
print_v("lems_comp_type: %s" % lems_comp_type)
Expand Down Expand Up @@ -405,6 +409,7 @@ def _comp_to_mdf_node(self, nmllite_comp, lems_comp_id, size=1, properties=None)
# node["parameters"][sv.name]["value"] = [0]*size

node["output_ports"][sv.name] = {"value": sv.name}
print_v("Adding %s as an output port"%sv.name)
if sv.exposure:
node["output_ports"][sv.exposure] = {"value": sv.name}

Expand Down Expand Up @@ -515,21 +520,25 @@ def _replace_in_condition_test(self, test):
def _get_all_elements_in_lems(cls, component_type, model, child_type):
ee = []
if child_type == "exposure":
for e in component_type.exposures:
ee.append(e)
if hasattr(component_type, "exposures"):
for e in component_type.exposures:
ee.append(e)
elif child_type == "constant":
for c in component_type.constants:
ee.append(c)
if hasattr(component_type, "constants"):
for c in component_type.constants:
ee.append(c)
elif child_type == "event_port":
for e in component_type.event_ports:
ee.append(e)
if hasattr(component_type, "event_ports"):
for e in component_type.event_ports:
ee.append(e)
elif child_type == "properties":
for p in component_type.properties:
ee.append(p)
if hasattr(component_type, "properties"):
for p in component_type.properties:
ee.append(p)
else:
raise Exception("Cannot get child of type: %s in LEMS model" % child_type)

if component_type.extends:
if hasattr(component_type, "extends") and component_type.extends:
ect = model.component_types[component_type.extends]
ee.extend(cls._get_all_elements_in_lems(ect, model, child_type))

Expand Down
2 changes: 1 addition & 1 deletion neuromllite/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import collections

__version__ = "0.5.6"
__version__ = "0.5.7"

# import pyNN
# import nest
Expand Down

0 comments on commit ac205ae

Please sign in to comment.