Hi Cristiano,

Thanks for writing in. Of course, in the ideal case, you would not have to modify the generated C++ code as everything should be already contained within the NESTML model itself. So if there's a particular way in which NESTML is incomplete or does not allow you to express something, please also get back to us about this, we'd be glad to help.

Of course in practice, it might very well occur during development that you want to modify the generated code just a little, for example to insert some printf() calls. The way to do this depends a little on how you are using NESTML. If you are using the API, with to_nest() and install_nest() and finally nest.Install(), the trick is to skip the install_nest() step, and run the compilation by hand. In the directory where the C++ code is generated, run "cmake -Dwith-nest=/path/to/your/nest-sim/install/bin/nest-config" and then "make install". The module can then be loaded again using nest.Install() in your Python script.

To prevent from continuously having to modify generated code, you could also potentially insert your changes into the templates. These you can find in pynestml/codegeneration/resources_nest/{NeuronHeader.jinja2, NeuronClass.jinja2}.

As for how the code works, I'm not sure if there's an extended description anywhere. The gist of it is that incoming events (like spikes) are handled in the handle() method, and time stepping is handled in update(). Hopefully the rest should speak mostly for itself, please do not hesitate to get in touch if you have any specific questions or run into any issues.

Cheers, kind regards,

On Thu, Dec 10, 2020, at 18:44, Cristiano Alessandro wrote:
Dear all,

I am new to developing NEST neuron models. I am aware I should use NEST-ML and I started that way, but I now need to modify the (successfully) generated C++ code. To do so, I would like to understand the details of the C++ implementation, including the overall logic of the class NEST-ML created (what is the functionality of the methods and attributes). Where can I find documentation about this? I would also like to take a look at the description of the NEST C++ developers library. I could not find these aspects in the Nest Developer Space. Thank you in advance.


NEST Users mailing list -- users@nest-simulator.org
To unsubscribe send an email to users-leave@nest-simulator.org