Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pnbabu committed Jul 25, 2024
1 parent 2efab75 commit aaf0450
Show file tree
Hide file tree
Showing 5 changed files with 206 additions and 3 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/nestml-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,66 @@ jobs:
done;
exit $rc
build_and_test_nest_desktop:
needs: [static_checks]
runs-on: ubuntu-latest
steps:
# Checkout the repository contents
- name: Checkout NESTML code
uses: actions/checkout@v4

# Setup Python version
- name: Setup Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8

# Install dependencies
- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get install libgsl0-dev libncurses5-dev pkg-config
sudo apt-get install python3-all-dev python3-matplotlib python3-numpy python3-scipy ipython3
# Install Python dependencies
- name: Python dependencies
run: |
python -m pip install --upgrade pip pytest jupyterlab matplotlib pycodestyle scipy
python -m pip install -r requirements.txt
- name: NEST simulator
run: |
python -m pip install cython
echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE"
NEST_SIMULATOR=$(pwd)/nest-simulator
NEST_INSTALL=$(pwd)/nest_install
echo "NEST_SIMULATOR = $NEST_SIMULATOR"
echo "NEST_INSTALL = $NEST_INSTALL"
git clone --depth=1 https://github.com/nest/nest-simulator --branch ${{ matrix.nest_branch }}
mkdir nest_install
echo "NEST_INSTALL=$NEST_INSTALL" >> $GITHUB_ENV
cd nest_install
cmake -DCMAKE_INSTALL_PREFIX=$NEST_INSTALL $NEST_SIMULATOR
make && make install
cd ..
# Install NESTML
- name: Install NESTML
run: |
export PYTHONPATH=${{ env.PYTHONPATH }}:${{ env.NEST_INSTALL }}/lib/python3.8/site-packages
#echo PYTHONPATH=`pwd` >> $GITHUB_ENV
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
python setup.py install
# Run integration tests
- name: Run integration tests
run: |
rc=0
for fn in $GITHUB_WORKSPACE/tests/nest_desktop_tests/*.py; do
pytest -s -o log_cli=true -o log_cli_level="DEBUG" ${fn} || rc=1
done;
exit $rc
build_and_test_nest:
needs: [static_checks]
runs-on: ubuntu-latest
Expand Down
118 changes: 118 additions & 0 deletions doc/fig/nest-desktop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion doc/running/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ Currently, the following target platforms are supported for code generation. Cli

|spinnaker_logo|

.. grid:: 1

.. grid-item-card::
:text-align: center
:class-title: sd-d-flex-row sd-align-minor-center

:doc:`NEST Desktop </running/running_python_standalone>`

|nest_desktop_logo|

.. |nest_logo| image:: https://raw.githubusercontent.com/nest/nestml/master/doc/fig/nest-simulator-logo.png
:width: 95px
Expand All @@ -65,6 +74,11 @@ Currently, the following target platforms are supported for code generation. Cli
:height: 40px
:target: running_spinnaker.html

.. |nest_desktop_logo| image:: https://raw.githubusercontent.com/nest/nestml/master/doc/fig/nest-desktop.svg
:width: 40px
:height: 40px
:target: running_nest_desktop.html

.. warning::

To ensure correct and reproducible results, always inspect the generated code by hand. Run comprehensive numerical testing of the model(s).
Expand Down Expand Up @@ -101,7 +115,7 @@ The following default values are used, corresponding to the command line default
- *no default*
* - target_platform
- str
- "NEST", "NEST_DESKTOP"
- "NEST"
* - target_path
- str
- None
Expand Down
12 changes: 12 additions & 0 deletions doc/running/running_nest_desktop.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Python-standalone target
------------------------

*NESTML features supported:* :doc:`neurons </nestml_language/neurons_in_nestml>`

The aim of the NEST Desktop target is to generate ``json`` files with parameters for models. This data will be used for rendering the parameter values in the NEST Desktop UI when a NESTML model is loaded.


Code generation options
~~~~~~~~~~~~~~~~~~~~~~~

Several code generator options are available; for an overview see :class:`pynestml.codegeneration.nest_desktop_code_generator.NESTDesktopCodeGenerator`.
3 changes: 1 addition & 2 deletions pynestml/codegeneration/nest_desktop_code_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
# You should have received a copy of the GNU General Public License
# along with NEST. If not, see <http://www.gnu.org/licenses/>.
import os
from typing import Sequence, Union, Optional, Mapping, Any, Dict
from typing import Sequence, Optional, Mapping, Any, Dict

from pynestml.codegeneration.code_generator import CodeGenerator
from pynestml.codegeneration.code_generator_utils import CodeGeneratorUtils
from pynestml.frontend.frontend_configuration import FrontendConfiguration
from pynestml.meta_model.ast_model import ASTModel


Expand Down

0 comments on commit aaf0450

Please sign in to comment.