Skip to content

Commit

Permalink
Test on py3.10; update to make neuroml export dimensionally consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
pgleeson committed Aug 20, 2024
1 parent 0f0d1e7 commit 351b507
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_test_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.11"]
python-version: [ "3.10"]
runs-on: [ubuntu-latest]

steps:
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/RNN/regenerate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ python generate_iaf.py -run -net -nogui
python generate_iaf.py -run -net2 -nogui
#Fix dimensions!
#python generate_iaf.py -neuroml
pynml LEMS_Simiaf_example.xml -lems-graph
#pynml LEMS_Simiaf_example.xml -lems-graph
13 changes: 11 additions & 2 deletions src/modeci_mdf/interfaces/neuroml/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ def mdf_to_neuroml(
node_comp = "%s__instance" % node.id

# Create the ComponentType which defines behaviour of the general class
ct = lems.ComponentType(node_comp_type, extends="baseCellMembPotDL")
ct = lems.ComponentType(
node_comp_type,
extends="baseCellMembPotDL",
description="LEMS ComponentType generated from MDF node definition",
)

for ip in node.input_ports:
ct.add(lems.Attachments("ip_%s" % ip.id, "basePointCurrentDL"))
Expand Down Expand Up @@ -133,7 +137,11 @@ def mdf_to_neuroml(
on_start.actions.append(sa)

if p.time_derivative:
td = lems.TimeDerivative(variable=p.id, value=p.time_derivative)

ct.add(lems.Constant("SEC", "1s", "time"))
td = lems.TimeDerivative(
variable=p.id, value="(%s)/SEC" % p.time_derivative
)
ct.dynamics.add(td)

if p.conditions:
Expand Down Expand Up @@ -279,6 +287,7 @@ def mdf_to_neuroml(
from modeci_mdf.utils import load_mdf, print_summary

example = "../../../../examples/MDF/Simple.json"
example = "../../../../examples/MDF/States.json"
verbose = True
run = False
if "-run" in sys.argv:
Expand Down

0 comments on commit 351b507

Please sign in to comment.