Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/development' into rlc-circuit
Browse files Browse the repository at this point in the history
  • Loading branch information
rimjhimittal committed Jun 21, 2024
2 parents c29534f + 59aebdd commit 9d83492
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 23 deletions.
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/MDF/ABCD.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion examples/MDF/Arrays.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion examples/MDF/NewtonCoolingModel.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion examples/MDF/ParametersFunctions.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@
}
}
}
}
}
2 changes: 1 addition & 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="#newton"> Newton'a Law of Cooling</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
2 changes: 1 addition & 1 deletion examples/MDF/Simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion examples/MDF/States.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion examples/MDF/abc_conditions.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@
}
}
}
}
}
15 changes: 8 additions & 7 deletions examples/MDF/newton.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ def main():
s.append(eg.enodes["cool_node"].evaluable_outputs["out_port"].curr_value)
t += dt

# Plotting the results
plt.plot(times, s)
plt.xlabel("Time")
plt.ylabel("Temperature")
plt.title("Newton's Cooling Law Simulation")
plt.savefig("newton_plot.png")
plt.show()
if "-nogui" not in sys.argv:
# Plotting the results
plt.plot(times, s)
plt.xlabel("Time")
plt.ylabel("Temperature")
plt.title("Newton's Cooling Law Simulation")
plt.savefig("newton_plot.png")
plt.show()

if "-graph" in sys.argv:
mod.to_graph_image(
Expand Down
2 changes: 1 addition & 1 deletion examples/NeuroML/LEMS_SimABCD.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!--
This LEMS file has been automatically generated using PyNeuroML v1.2.12 (libNeuroML v0.5.8)
This LEMS file has been automatically generated using PyNeuroML v1.2.14 (libNeuroML v0.5.8)
-->

Expand Down
2 changes: 1 addition & 1 deletion examples/NeuroML/LEMS_SimFN.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!--
This LEMS file has been automatically generated using PyNeuroML v1.2.12 (libNeuroML v0.5.8)
This LEMS file has been automatically generated using PyNeuroML v1.2.14 (libNeuroML v0.5.8)
-->

Expand Down
2 changes: 1 addition & 1 deletion examples/NeuroML/LEMS_SimIzhikevichTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!--
This LEMS file has been automatically generated using PyNeuroML v1.2.12 (libNeuroML v0.5.8)
This LEMS file has been automatically generated using PyNeuroML v1.2.14 (libNeuroML v0.5.8)
-->

Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ package_dir =

[options.extras_require]
psyneulink =
grpcio-tools==1.42.0
psyneulink

neuroml =
Expand Down

0 comments on commit 9d83492

Please sign in to comment.