Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
dc9448e
Newton's Law of Cooling Example
rimjhimittal May 30, 2024
9d6dde9
fixing some indentation issue
rimjhimittal May 30, 2024
b6b7bf3
black formatted
rimjhimittal May 30, 2024
1b181c6
Update README.md
rimjhimittal Jun 3, 2024
d82719d
Update README.md
rimjhimittal Jun 3, 2024
7cc4341
Uploading the notebook
rimjhimittal Jun 3, 2024
c53c9dc
fix end-of-file
rimjhimittal Jun 3, 2024
0eac2be
Remove pin to grpcio-tools==1.42.0
pgleeson Jun 5, 2024
ed34981
Test psyneulink on py3.11
pgleeson Jun 6, 2024
f1bba2a
all changes made
rimjhimittal Jun 7, 2024
7819333
Merge pull request #533 from rimjhimittal/newton
pgleeson Jun 7, 2024
394496d
Merge branch 'development' into test_versions
pgleeson Jun 13, 2024
88f8353
Merge branch 'test_versions' into nml_examples
pgleeson Jun 13, 2024
f8f8635
Merge pull request #534 from ModECI/test_versions
pgleeson Jun 13, 2024
575403c
Fix typo & regenerate files
pgleeson Jun 14, 2024
7eb4ca8
Merge branch 'development' into nml_examples
pgleeson Jun 14, 2024
1e6e643
Switched RLC Circuit Example
rimjhimittal Jun 14, 2024
c29534f
changes
rimjhimittal Jun 18, 2024
98ecf2e
Ensure numpy<2.0.0 in tests, due to lingering issues with other modul…
pgleeson Jun 18, 2024
59aebdd
Merge pull request #537 from ModECI/nml_examples
pgleeson Jun 18, 2024
9d83492
Merge remote-tracking branch 'upstream/development' into rlc-circuit
rimjhimittal Jun 21, 2024
7089a76
graph issue
rimjhimittal Jul 4, 2024
fb6b15d
Regenerated neuroml files
pgleeson Aug 20, 2024
5eff07d
Add workflow for test_all.sh
pgleeson Aug 20, 2024
0f0d1e7
Test this branch too
pgleeson Aug 20, 2024
351b507
Test on py3.10; update to make neuroml export dimensionally consistent
pgleeson Aug 20, 2024
926b904
Regenerate
pgleeson Aug 20, 2024
9d45150
Restructure all to include dev dependencies
pgleeson Aug 20, 2024
9b0eabf
Fix to find neuron
pgleeson Aug 21, 2024
d8a6cf4
fixed plot error
rimjhimittal Aug 21, 2024
8414d16
Add pre-commit to dev
pgleeson Aug 21, 2024
4ff45cc
Merge branch 'rlc-circuit' of github.com:rimjhimittal/MDF into nml_ex…
pgleeson Aug 21, 2024
a175578
Regenerated image files & fix formatting
pgleeson Aug 21, 2024
9dc3dce
Move neuron...
pgleeson Aug 21, 2024
31b626a
Temp partial fix for parametercondition issue
pgleeson Aug 21, 2024
d7a7557
Catch exit code non 0 in pre-commit
pgleeson Aug 21, 2024
205ffe3
Don't show rlc plot in test
pgleeson Aug 27, 2024
9c6610e
Regenerated with latest neuroml packages
pgleeson Nov 13, 2024
251a59f
Update README.md
pgleeson Dec 11, 2024
e5e911d
Fix formatting
pgleeson Dec 11, 2024
4d75b4b
Test specific psyneulink version
pgleeson Dec 11, 2024
acc49ba
Merge pull request #540 from ModECI/benchmarking
pgleeson Dec 18, 2024
f93e6f3
Merge branch 'development' into nml_examples
pgleeson Dec 18, 2024
601690d
Remove upper pin on PNL, add lower pin.
davidt0x Jan 8, 2025
a21e314
Merge pull request #541 from ModECI/fix/pnl_pin
davidt0x Jan 9, 2025
b4f3ef1
Remove upper pin on pytorch.
davidt0x Jan 15, 2025
c650f5b
Fix for new pytorch.
davidt0x Jan 15, 2025
63ee3cf
Replace torch.onnx._export call with torch.onnx.export
davidt0x Jan 15, 2025
7c3129c
black
davidt0x Jan 15, 2025
cc9a796
Merge pull request #542 from ModECI/fix/pytorch_pin
davidt0x Jan 22, 2025
f3896b7
Merge branch 'development' into nml_examples
pgleeson Feb 4, 2025
6374fd4
Limit torchvision
pgleeson Feb 4, 2025
5f442aa
Merge pull request #538 from ModECI/nml_examples
pgleeson Feb 5, 2025
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
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ jobs:
brew install hdf5

- name: Install core package
run: python -m pip install .[dev]
run: |
pip install 'numpy<2.0.0' # due to lingering issues with other modules & numpy v2...
python -m pip install .[dev]

- name: Version info for installed packages
run: |
pip list
pip list

- name: Test core package
run: |
Expand Down Expand Up @@ -102,7 +104,6 @@ jobs:
python -m pytest -v -m "tensorflow" tests/

- name: Test interface PsyNeuLink
if: ${{ matrix.python-version != '3.11'}}
run: |
python -m pip install .[psyneulink]
python -m pytest -v -m "psyneulink" tests/
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/ci_test_all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI Test script

on:
push:
branches: [ main, development, experimental, test*, nml* ]
pull_request:
branches: [ main, development, experimental, test*, nml* ]

jobs:

checks:
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
python-version: [ "3.10"]
runs-on: [ubuntu-latest]

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install HDF5 for pytables on macos-14/latest
if: ${{ matrix.runs-on == 'macos-latest' }}
run: |
brew install hdf5

- name: Install graphviz
uses: ts-graphviz/setup-graphviz@v2
with:
# Skip to run brew update command on macOS.
macos-skip-brew-update: 'true' # default false

- name: Run test script
run: |
export NEURON_HOME=$pythonLocation
./test_all.sh

- name: Version info for installed packages
run: |
pip list




- name: Final version info for optional installed packages
run: |
pip list
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,5 @@ examples/TensorFlow/Keras/keras_to_MDF
/examples/TensorFlow/Keras/IRIS/keras_model_on_iris.keras
/examples/TensorFlow/Keras/MNIST/kr_N_model.keras
/checkoutpngs.sh
/docs/sphinx/source/api/export_format/MDF/images/newton.png
/docs/sphinx/source/api/export_format/MDF/images/newton_plot.png
12 changes: 11 additions & 1 deletion docs/sphinx/source/api/export_format/MDF/MDF.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Examples of [Python](https://python.org), [JSON](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON#:~:text=JavaScript%20Object%20Notation%20(JSON)%20is,page%2C%20or%20vice%20versa) and [YAML](https://circleci.com/blog/what-is-yaml-a-beginner-s-guide/) files to illustrate the structure and usage of MDF.

<a href="#simple"> Simple </a>| <a href="#abcd"> ABCD </a> | <a href="#arrays"> Arrays </a> | <a href="#st"> States </a> | <a href="#conditions"> Conditions </a> | <a href="#parameters-and-functions"> Parameters and Functions </a>
<a href="#simple"> Simple </a>| <a href="#abcd"> ABCD </a> | <a href="#arrays"> Arrays </a> | <a href="#st"> States </a> | <a href="#conditions"> Conditions </a> | <a href="#parameters-and-functions"> Parameters and Functions </a>| <a href="#newton"> Newton's Law of Cooling</a>

<p id="simple"></p>

Expand Down Expand Up @@ -73,6 +73,16 @@ A simple 3 [Nodes](https://mdf.readthedocs.io/en/latest/api/Specification.html#n
A simple [Node](https://mdf.readthedocs.io/en/latest/api/Specification.html#node) with a number of different types of [Parameters](https://mdf.readthedocs.io/en/latest/api/Specification.html#parameter) (in blue; fixed and **stateful**) and [Functions](https://mdf.readthedocs.io/en/latest/api/Specification.html#function) (in purple; can be built in or ONNX based).

<img src="https://raw.githubusercontent.com/ModECI/MDF/main/examples/MDF/images/params_funcs.png" width="250" height="198" />
<p id="newton"></p>

## Newton's Law of Cooling

[Python Source](https://github.com/ModECI/MDF/blob/main/examples/MDF/newton.py) | [JSON](https://github.com/ModECI/MDF/blob/main/examples/MDF/NewtonCoolingModel.json) | [YAML](https://github.com/ModECI/MDF/blob/main/examples/MDF/NewtonCoolingModel.yaml)

A simple [Newtonian cooling process](https://en.wikipedia.org/wiki/Newton%27s_law_of_cooling) model that demonstrates the use of time derivative simulating the cooling of an object to the ambient temperature over time.

<img src="https://raw.githubusercontent.com/ModECI/MDF/development/examples/MDF/images/newton.png" width="250"/>
<img src="https://raw.githubusercontent.com/ModECI/MDF/development/examples/MDF/images/newton_plot.png" width="250"/>


## More examples
Expand Down
Binary file modified docs/sphinx/source/api/export_format/MDF/images/abc_conditions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/sphinx/source/api/export_format/NeuroML/ABCD.mdf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/sphinx/source/api/export_format/NeuroML/LEMS_SimABCD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/sphinx/source/api/export_format/NeuroML/LEMS_SimFN.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/sphinx/source/api/export_format/PyTorch/inception.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions examples/MDF/NewtonCoolingModel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"NewtonCoolingModel": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"cooling_process": {
"nodes": {
"cool_node": {
"parameters": {
"cooling_coeff": {
"value": 0.1
},
"T_a": {
"value": 20
},
"T_curr": {
"default_initial_value": 90,
"time_derivative": "dT_dt"
},
"dT_dt": {
"value": "-cooling_coeff*(T_curr - T_a)",
"default_initial_value": 0
}
},
"output_ports": {
"out_port": {
"value": "T_curr"
},
"out_port2": {
"value": "dT_dt"
}
}
}
}
}
}
}
}
23 changes: 23 additions & 0 deletions examples/MDF/NewtonCoolingModel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
NewtonCoolingModel:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.11
graphs:
cooling_process:
nodes:
cool_node:
parameters:
cooling_coeff:
value: 0.1
T_a:
value: 20
T_curr:
default_initial_value: 90
time_derivative: dT_dt
dT_dt:
value: -cooling_coeff*(T_curr - T_a)
default_initial_value: 0
output_ports:
out_port:
value: T_curr
out_port2:
value: dT_dt
12 changes: 11 additions & 1 deletion examples/MDF/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Examples of [Python](https://python.org), [JSON](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON#:~:text=JavaScript%20Object%20Notation%20(JSON)%20is,page%2C%20or%20vice%20versa) and [YAML](https://circleci.com/blog/what-is-yaml-a-beginner-s-guide/) files to illustrate the structure and usage of MDF.

<a href="#simple"> Simple </a>| <a href="#abcd"> ABCD </a> | <a href="#arrays"> Arrays </a> | <a href="#st"> States </a> | <a href="#conditions"> Conditions </a> | <a href="#parameters-and-functions"> Parameters and Functions </a>
<a href="#simple"> Simple </a>| <a href="#abcd"> ABCD </a> | <a href="#arrays"> Arrays </a> | <a href="#st"> States </a> | <a href="#conditions"> Conditions </a> | <a href="#parameters-and-functions"> Parameters and Functions </a>| <a href="#newton"> Newton's Law of Cooling</a>

<p id="simple"></p>

Expand Down Expand Up @@ -73,6 +73,16 @@ A simple 3 [Nodes](https://mdf.readthedocs.io/en/latest/api/Specification.html#n
A simple [Node](https://mdf.readthedocs.io/en/latest/api/Specification.html#node) with a number of different types of [Parameters](https://mdf.readthedocs.io/en/latest/api/Specification.html#parameter) (in blue; fixed and **stateful**) and [Functions](https://mdf.readthedocs.io/en/latest/api/Specification.html#function) (in purple; can be built in or ONNX based).

<img src="https://raw.githubusercontent.com/ModECI/MDF/main/examples/MDF/images/params_funcs.png" width="250" height="198" />
<p id="newton"></p>

## Newton's Law of Cooling

[Python Source](https://github.com/ModECI/MDF/blob/main/examples/MDF/newton.py) | [JSON](https://github.com/ModECI/MDF/blob/main/examples/MDF/NewtonCoolingModel.json) | [YAML](https://github.com/ModECI/MDF/blob/main/examples/MDF/NewtonCoolingModel.yaml)

A simple [Newtonian cooling process](https://en.wikipedia.org/wiki/Newton%27s_law_of_cooling) model that demonstrates the use of time derivative simulating the cooling of an object to the ambient temperature over time.

<img src="https://raw.githubusercontent.com/ModECI/MDF/development/examples/MDF/images/newton.png" width="250"/>
<img src="https://raw.githubusercontent.com/ModECI/MDF/development/examples/MDF/images/newton_plot.png" width="250"/>


## More examples
Expand Down
37 changes: 31 additions & 6 deletions examples/MDF/RNN/IAFs.nmllite.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{
"iaf_example": {
"version": "NeuroMLlite v0.5.3",
"version": "NeuroMLlite v0.6.0",
"notes": "NeuroMLlite export of MDF graph: iaf_example",
"cells": {
"input_node__instance": {
"current_input_node__instance": {
"lems_source_file": "iaf_example_lems_definitions.xml"
},
"pre__instance": {
"lems_source_file": "iaf_example_lems_definitions.xml"
},
"post__instance": {
"lems_source_file": "iaf_example_lems_definitions.xml"
},
"syn_post__instance": {
"lems_source_file": "iaf_example_lems_definitions.xml"
}
},
"synapses": {
Expand All @@ -20,14 +23,17 @@
"silentSyn_proj_input_edge": {
"lems_source_file": "iaf_example_lems_definitions.xml"
},
"silentSyn_proj_post_internal_edge": {
"lems_source_file": "iaf_example_lems_definitions.xml"
},
"silentSyn_proj_syn_edge": {
"lems_source_file": "iaf_example_lems_definitions.xml"
}
},
"populations": {
"input_node": {
"current_input_node": {
"size": 1,
"component": "input_node__instance",
"component": "current_input_node__instance",
"properties": {
"color": "0.2 0.2 0.2",
"radius": 3
Expand All @@ -48,11 +54,19 @@
"color": "0.2 0.2 0.2",
"radius": 3
}
},
"syn_post": {
"size": 1,
"component": "syn_post__instance",
"properties": {
"color": "0.2 0.2 0.2",
"radius": 3
}
}
},
"projections": {
"proj_input_edge": {
"presynaptic": "input_node",
"presynaptic": "current_input_node",
"postsynaptic": "pre",
"synapse": "rsDL",
"pre_synapse": "silentSyn_proj_input_edge",
Expand All @@ -62,9 +76,20 @@
"probability": 1
}
},
"proj_post_internal_edge": {
"presynaptic": "syn_post",
"postsynaptic": "post",
"synapse": "rsDL",
"pre_synapse": "silentSyn_proj_post_internal_edge",
"type": "continuousProjection",
"weight": 1,
"random_connectivity": {
"probability": 1
}
},
"proj_syn_edge": {
"presynaptic": "pre",
"postsynaptic": "post",
"postsynaptic": "syn_post",
"synapse": "rsDL",
"pre_synapse": "silentSyn_proj_syn_edge",
"type": "continuousProjection",
Expand Down
27 changes: 13 additions & 14 deletions examples/MDF/RNN/Simiaf_example.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
{
"Simiaf_example": {
"version": "NeuroMLlite v0.5.3",
"version": "NeuroMLlite v0.6.0",
"network": "IAFs.nmllite.json",
"duration": 100000.0,
"dt": 10.0,
"seed": 123,
"record_variables": {
"time": {
"input_node": 0
"current_input_node": 0
},
"out_port": {
"input_node": 0
"current_output": {
"current_input_node": 0,
"syn_post": 0
},
"current_input": {
"pre": 0,
"post": 0
},
"spike_input": {
"pre": 0,
"post": 0
},
"syn_i": {
"pre": 0,
"post": 0
},
"spiking": {
"pre": 0,
"post": 0
Expand All @@ -32,13 +25,19 @@
"pre": 0,
"post": 0
},
"out_port_v": {
"v_output": {
"pre": 0,
"post": 0
},
"out_port_spiking": {
"spiking_output": {
"pre": 0,
"post": 0
},
"spike_input": {
"syn_post": 0
},
"syn_i": {
"syn_post": 0
}
}
}
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
Loading