Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to v0.4.11, fix tests related to numpy2 & add Newton's law of cooling example #539

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
dd92a43
Update to v0.4.11
pgleeson May 1, 2024
fba5c46
Merge pull request #532 from ModECI/nml_examples
pgleeson May 15, 2024
5287b12
Regenerated
pgleeson May 23, 2024
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
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
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
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
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
2 changes: 1 addition & 1 deletion examples/ACT-R/addition.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"addition": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.10",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"addition_graph": {
"nodes": {
Expand Down
2 changes: 1 addition & 1 deletion examples/ACT-R/addition.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
addition:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.10
generating_application: Python modeci-mdf v0.4.11
graphs:
addition_graph:
nodes:
Expand Down
2 changes: 1 addition & 1 deletion examples/ACT-R/count.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"count": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.10",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"count_graph": {
"nodes": {
Expand Down
2 changes: 1 addition & 1 deletion examples/ACT-R/count.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
count:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.10
generating_application: Python modeci-mdf v0.4.11
graphs:
count_graph:
nodes:
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/ABCD.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ABCD": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.10",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"abcd_example": {
"nodes": {
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/ABCD.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ABCD:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.10
generating_application: Python modeci-mdf v0.4.11
graphs:
abcd_example:
nodes:
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/Arrays.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Arrays": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.10",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"array_example": {
"nodes": {
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/Arrays.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Arrays:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.10
generating_application: Python modeci-mdf v0.4.11
graphs:
array_example:
nodes:
Expand Down
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
2 changes: 1 addition & 1 deletion examples/MDF/ParametersFunctions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ParametersFunctions": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.10",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"params_funcs_example": {
"nodes": {
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/ParametersFunctions.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ParametersFunctions:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.10
generating_application: Python modeci-mdf v0.4.11
graphs:
params_funcs_example:
nodes:
Expand Down
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
2 changes: 1 addition & 1 deletion examples/MDF/RNN/IAF_net.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"IAF_net": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.10",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"iaf_example": {
"nodes": {
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/RNN/IAF_net.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
IAF_net:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.10
generating_application: Python modeci-mdf v0.4.11
graphs:
iaf_example:
nodes:
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/RNN/IAF_net2.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"IAF_net2": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.10",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"iaf_example": {
"nodes": {
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/RNN/IAF_net2.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
IAF_net2:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.10
generating_application: Python modeci-mdf v0.4.11
graphs:
iaf_example:
nodes:
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/RNN/IAFs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"IAFs": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.10",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"iaf_example": {
"nodes": {
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/RNN/IAFs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
IAFs:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.10
generating_application: Python modeci-mdf v0.4.11
graphs:
iaf_example:
nodes:
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/RNN/RNNs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"RNNs": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.10",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"rnn_example": {
"nodes": {
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/RNN/RNNs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RNNs:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.10
generating_application: Python modeci-mdf v0.4.11
graphs:
rnn_example:
nodes:
Expand Down
Binary file modified examples/MDF/Simple.bson
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/MDF/Simple.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Simple": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.10",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"simple_example": {
"nodes": {
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/Simple.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Simple:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.10
generating_application: Python modeci-mdf v0.4.11
graphs:
simple_example:
nodes:
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/States.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"States": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.10",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"state_example": {
"nodes": {
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/States.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
States:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.10
generating_application: Python modeci-mdf v0.4.11
graphs:
state_example:
nodes:
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/abc_conditions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"abc_conditions": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.10",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"abc_conditions_example": {
"nodes": {
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/abc_conditions.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
abc_conditions:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.10
generating_application: Python modeci-mdf v0.4.11
graphs:
abc_conditions_example:
nodes:
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/conditions/Composite_mdf_condition.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Composite_mdf_condition": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.10",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"Composite_mdf_condition_example": {
"nodes": {
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/conditions/Composite_mdf_condition.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Composite_mdf_condition:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.10
generating_application: Python modeci-mdf v0.4.11
graphs:
Composite_mdf_condition_example:
nodes:
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/conditions/everyncalls_condition.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"everyncalls_condition": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.10",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"everyncalls_example": {
"nodes": {
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/conditions/everyncalls_condition.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
everyncalls_condition:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.10
generating_application: Python modeci-mdf v0.4.11
graphs:
everyncalls_example:
nodes:
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/conditions/threshold_condition.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"threshold_condition": {
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.10",
"generating_application": "Python modeci-mdf v0.4.11",
"graphs": {
"threshold_example": {
"nodes": {
Expand Down
2 changes: 1 addition & 1 deletion examples/MDF/conditions/threshold_condition.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
threshold_condition:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.10
generating_application: Python modeci-mdf v0.4.11
graphs:
threshold_example:
nodes:
Expand Down
Loading
Loading