diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e602ae01..35ebd692 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: | diff --git a/.gitignore b/.gitignore index 6cfc7c16..d0a1ba4e 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/docs/sphinx/source/api/export_format/MDF/MDF.md b/docs/sphinx/source/api/export_format/MDF/MDF.md index 27211f24..f63b8518 100644 --- a/docs/sphinx/source/api/export_format/MDF/MDF.md +++ b/docs/sphinx/source/api/export_format/MDF/MDF.md @@ -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. - Simple | ABCD | Arrays | States | Conditions | Parameters and Functions + Simple | ABCD | Arrays | States | Conditions | Parameters and Functions | Newton's Law of Cooling

@@ -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). +

+ +## 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. + + + ## More examples diff --git a/examples/MDF/README.md b/examples/MDF/README.md index 16f4e57f..f63b8518 100644 --- a/examples/MDF/README.md +++ b/examples/MDF/README.md @@ -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. - Simple | ABCD | Arrays | States | Conditions | Parameters and Functions | Newton'a Law of Cooling + Simple | ABCD | Arrays | States | Conditions | Parameters and Functions | Newton's Law of Cooling

diff --git a/examples/MDF/newton.py b/examples/MDF/newton.py index 4787c4a5..62130e4b 100644 --- a/examples/MDF/newton.py +++ b/examples/MDF/newton.py @@ -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( diff --git a/examples/NeuroML/LEMS_SimABCD.xml b/examples/NeuroML/LEMS_SimABCD.xml index 9236e0a1..60f9f168 100644 --- a/examples/NeuroML/LEMS_SimABCD.xml +++ b/examples/NeuroML/LEMS_SimABCD.xml @@ -2,7 +2,7 @@ diff --git a/examples/NeuroML/LEMS_SimFN.xml b/examples/NeuroML/LEMS_SimFN.xml index 20334f61..46cc5f1b 100644 --- a/examples/NeuroML/LEMS_SimFN.xml +++ b/examples/NeuroML/LEMS_SimFN.xml @@ -2,7 +2,7 @@ diff --git a/examples/NeuroML/LEMS_SimIzhikevichTest.xml b/examples/NeuroML/LEMS_SimIzhikevichTest.xml index d5d1bc62..c943d4a5 100644 --- a/examples/NeuroML/LEMS_SimIzhikevichTest.xml +++ b/examples/NeuroML/LEMS_SimIzhikevichTest.xml @@ -2,7 +2,7 @@