Skip to content

Commit

Permalink
Modify jupyter notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pnbabu committed Mar 27, 2024
1 parent e637704 commit a729cf3
Show file tree
Hide file tree
Showing 9 changed files with 2,797 additions and 6,439 deletions.
222 changes: 46 additions & 176 deletions doc/tutorials/active_dendrite/nestml_active_dendrite_tutorial.ipynb

Large diffs are not rendered by default.

112 changes: 83 additions & 29 deletions doc/tutorials/izhikevich/nestml_izhikevich_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
" Copyright (C) 2004 The NEST Initiative\n",
"\n",
" Version: 3.6.0-post0.dev0\n",
" Built: Mar 21 2024 13:58:01\n",
" Built: Mar 26 2024 10:08:21\n",
"\n",
" This program is provided AS IS and comes with\n",
" NO WARRANTY. See the file LICENSE for details.\n",
Expand All @@ -48,7 +48,7 @@
}
],
"source": [
"%matplotlib inline\n",
"# %matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"import nest\n",
"import numpy as np\n",
Expand Down Expand Up @@ -117,17 +117,9 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING:root:PyGSL is not available. The stiffness test will be skipped.\n",
"WARNING:root:Error when importing: No module named 'pygsl'\n"
]
},
{
"name": "stdout",
"output_type": "stream",
Expand All @@ -137,7 +129,7 @@
" Copyright (C) 2004 The NEST Initiative\n",
"\n",
" Version: 3.6.0-post0.dev0\n",
" Built: Mar 21 2024 13:58:01\n",
" Built: Mar 26 2024 10:08:21\n",
"\n",
" This program is provided AS IS and comes with\n",
" NO WARRANTY. See the file LICENSE for details.\n",
Expand Down Expand Up @@ -167,7 +159,7 @@
"-- Detecting CXX compile features - done\n",
"\u001b[0m\u001b[0m\n",
"\u001b[0m-------------------------------------------------------\u001b[0m\n",
"\u001b[0mnestml__module Configuration Summary\u001b[0m\n",
"\u001b[0mizhikevich_module Configuration Summary\u001b[0m\n",
"\u001b[0m-------------------------------------------------------\u001b[0m\n",
"\u001b[0m\u001b[0m\n",
"\u001b[0mC++ compiler : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++\u001b[0m\n",
Expand All @@ -179,15 +171,15 @@
"\u001b[0m\u001b[0m\n",
"\u001b[0m-------------------------------------------------------\u001b[0m\n",
"\u001b[0m\u001b[0m\n",
"\u001b[0mYou can now build and install 'nestml__module' using\u001b[0m\n",
"\u001b[0mYou can now build and install 'izhikevich_module' using\u001b[0m\n",
"\u001b[0m make\u001b[0m\n",
"\u001b[0m make install\u001b[0m\n",
"\u001b[0m\u001b[0m\n",
"\u001b[0mThe library file libnestml__module.so will be installed to\u001b[0m\n",
"\u001b[0m /var/folders/2j/fb047q1177v9f56f_jktrb4c0000gn/T/nestml_target_vy0vybop\u001b[0m\n",
"\u001b[0mThe library file libizhikevich_module.so will be installed to\u001b[0m\n",
"\u001b[0m /var/folders/2j/fb047q1177v9f56f_jktrb4c0000gn/T/nestml_target_c_3ls96l\u001b[0m\n",
"\u001b[0mThe module can be loaded into NEST using\u001b[0m\n",
"\u001b[0m (nestml__module) Install (in SLI)\u001b[0m\n",
"\u001b[0m nest.Install(nestml__module) (in PyNEST)\u001b[0m\n",
"\u001b[0m (izhikevich_module) Install (in SLI)\u001b[0m\n",
"\u001b[0m nest.Install(izhikevich_module) (in PyNEST)\u001b[0m\n",
"\u001b[0m\u001b[0m\n",
"\u001b[33mCMake Warning (dev) in CMakeLists.txt:\n",
" No cmake_minimum_required command is present. A line of code such as\n",
Expand All @@ -199,11 +191,11 @@
" information run \"cmake --help-policy CMP0000\".\n",
"This warning is for project developers. Use -Wno-dev to suppress it.\n",
"\u001b[0m\n",
"-- Configuring done (1.2s)\n",
"-- Configuring done (0.7s)\n",
"-- Generating done (0.0s)\n",
"-- Build files have been written to: /Users/pooja/nestml/master/doc/tutorials/izhikevich/target\n",
"[ 33%] \u001b[32mBuilding CXX object CMakeFiles/nestml__module_module.dir/izhikevich_tutorial_nestml.o\u001b[0m\n",
"[ 66%] \u001b[32mBuilding CXX object CMakeFiles/nestml__module_module.dir/nestml__module.o\u001b[0m\n",
"[ 33%] \u001b[32mBuilding CXX object CMakeFiles/izhikevich_module_module.dir/izhikevich_module.o\u001b[0m\n",
"[ 66%] \u001b[32mBuilding CXX object CMakeFiles/izhikevich_module_module.dir/izhikevich_tutorial_nestml.o\u001b[0m\n",
"/Users/pooja/nestml/master/doc/tutorials/izhikevich/target/izhikevich_tutorial_nestml.cpp:179:16: warning: unused variable '__resolution' [-Wunused-variable]\n",
" const double __resolution = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the resolution() function\n",
" ^\n",
Expand All @@ -214,20 +206,21 @@
" const double __resolution = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the resolution() function\n",
" ^\n",
"3 warnings generated.\n",
"[100%] \u001b[32m\u001b[1mLinking CXX shared module nestml__module.so\u001b[0m\n",
"[100%] \u001b[32m\u001b[1mLinking CXX shared module izhikevich_module.so\u001b[0m\n",
"ld: warning: install name of a reexported library '@rpath/libtinfo.6.dylib' found at '/Users/pooja/conda/nestml_dev/lib/libtinfo.6.dylib' is different from install name '/Users/pooja/conda/nestml_dev/lib/libtinfo.6.dylib' found in its parent library '/Users/pooja/conda/nestml_dev/lib/libncurses.6.dylib'\n",
"[100%] Built target nestml__module_module\n",
"[100%] Built target nestml__module_module\n",
"[100%] Built target izhikevich_module_module\n",
"[100%] Built target izhikevich_module_module\n",
"\u001b[36mInstall the project...\u001b[0m\n",
"-- Install configuration: \"\"\n",
"-- Installing: /var/folders/2j/fb047q1177v9f56f_jktrb4c0000gn/T/nestml_target_vy0vybop/nestml__module.so\n"
"-- Installing: /var/folders/2j/fb047q1177v9f56f_jktrb4c0000gn/T/nestml_target_c_3ls96l/izhikevich_module.so\n"
]
}
],
"source": [
"# generate and build code\n",
"module_name, neuron_model_name = \\\n",
" NESTCodeGeneratorUtils.generate_code_for(\"izhikevich_solution.nestml\")"
" NESTCodeGeneratorUtils.generate_code_for(\"izhikevich_solution.nestml\",\n",
" module_name=\"izhikevich_module\")"
]
},
{
Expand All @@ -249,14 +242,35 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Mar 26 14:32:10 Install [Info]: \n",
" loaded module izhikevich_module\n",
"\n",
"Mar 26 14:32:10 NodeManager::prepare_nodes [Info]: \n",
" Preparing 4 nodes for simulation.\n",
"\n",
"Mar 26 14:32:10 SimulationManager::start_updating_ [Info]: \n",
" Number of local nodes: 4\n",
" Simulation time (ms): 250\n",
" Number of OpenMP threads: 1\n",
" Not using MPI\n",
"\n",
"Mar 26 14:32:10 SimulationManager::run [Info]: \n",
" Simulation finished.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/var/folders/2j/fb047q1177v9f56f_jktrb4c0000gn/T/ipykernel_86106/1353168583.py:33: UserWarning:FigureCanvasAgg is non-interactive, and thus cannot be shown\n"
"/var/folders/2j/fb047q1177v9f56f_jktrb4c0000gn/T/ipykernel_60089/1245292433.py:33: UserWarning:FigureCanvasAgg is non-interactive, and thus cannot be shown\n"
]
},
{
Expand All @@ -271,7 +285,7 @@
}
],
"source": [
"nest.set_verbosity(\"M_WARNING\")\n",
"nest.set_verbosity(\"M_ALL\")\n",
"nest.ResetKernel()\n",
"\n",
"# load dynamic library (NEST extension module) into NEST kernel\n",
Expand Down Expand Up @@ -306,6 +320,39 @@
"fig.show()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Mar 26 14:32:18 Install [Info]: \n",
" loaded module izhikevich_module\n"
]
},
{
"data": {
"text/plain": [
"('izhikevich_module',)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"nest.ResetKernel()\n",
"nest.Install(module_name)\n",
"# nest.Models()\n",
"os.environ[\"DYLD_LIBRARY_PATH\"]\n",
"nest.get(\"modules\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -336,6 +383,13 @@
"\n",
"You should have received a copy of the GNU General Public License along with NEST. If not, see <http://www.gnu.org/licenses/>.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Loading

0 comments on commit a729cf3

Please sign in to comment.