Hi,I installed NEST using the following code.loading = Falsefrom google.colab import drivedrive.mount('/content/drive')!pip install -q condacolabimport condacolab
condacolab.install()
!conda install -c conda-forge nest-simulatorimport nest
nest.__version__!pip install nestml
import pynestml
pynestml.__version__Then, I manually imported the path to iaf_psc_delta_neuron.nestml. It gave me this error:---------------------------------------------------------------------------IndexError Traceback (most recent call last)<ipython-input-10-7981312f3233> in <cell line: 1>() ----> 1 module_name, neuron_model_name, synapse_model_name = NESTCodeGeneratorUtils.generate_code_for( 2 "/content/iaf_psc_delta_neuron.nestml", 3 nestml_stdp_model, 4 post_ports=["post_spikes"]) 5/usr/local/lib/python3.10/site-packages/pynestml/codegeneration/nest_code_generator_utils.py in generate_code_for(cls, nestml_neuron_model, nestml_synapse_model, module_name, target_path, post_ports, mod_ports, logging_level) 87 88 # update neuron model name inside the file ---> 89 neuron_model_name = re.findall(r"neuron [^:\s]*:", nestml_neuron_model)[0][7:-1] 90 neuron_fn = neuron_model_name + ".nestml" 91 with open(neuron_fn, "w") as f:IndexError: list index out of rangeThis is on NEST version 3.7.0 and NESTML version 7.0.2.Best,Ashraf
On Wed, May 8, 2024 at 4:59 AM Charl Linssen <nest-users@turingbirds.com> wrote:Hi,Thanks for your inquiry! I'm not sure from your description what the actual problem is, you are running the stdp_windows tutorial notebook, and there is an error? Could you post a full log?It would be great if you could use the latest NESTML version from GitHub (try running python3 -m pip install git+https://github.com/nest/nestml/).Note that the notebook (in cell 3) contains the path "../../../models/neurons/iaf_psc_delta_neuron.nestml", so you should first change directory (cd) to "doc/tutorials/stdp_windows" and run Jupyter Notebook or Python from that directory. There is no need to change any internal code inside the generate_code_for() function.For the error importing the "nest" module in Python, please make sure that the environment is set up correctly before starting the Jupyter Notebook server. Typically you can do this by sourcing nest_vars.sh (see bottom of this page), which sets up the correct PYTHONPATH environment variable. How did you install NEST?With kind regards,CharlOn Wed, May 8, 2024, at 00:54, Ashraf Ul Islam Shihab wrote:Hi,In nestml/doc/tutorials/stdp_windows notebook, in cell 3, I see an example of fetching model name, neuron name, and synapse name from nestml/models/neurons/iaf_psc_delta_neuron.nestml, which appears to have only model inside of it. It tries to extract the names from a format of
model <name>: neuron <name>: synapse <name>:But the iaf_psc_delta_neuron.nestml file from the latest build doesn't have any structure as neuron <name>: to my best knowledge. Please let me know if there is any fix for this problem.
I went ahead and tried to edit the generate_code_for function from NESTCodeGeneratorUtils class. It can be found here. But it gives an error as follows:[6,GLOBAL, ERROR]: An error occurred while importing the `nest` module in Python. Please check your NEST installation-related environment variables and paths, or specify ``nest_version`` manually in the code generator options.An exception has occurred, use %tb to see the full traceback.Best,Ashraf Ul Islam Shihab
Graduate Research Assistant
Department of Electrical and Computer Engineering
Boise State University (BSU)Boise, Idaho 83725
_______________________________________________NEST Users mailing list -- users@nest-simulator.orgTo unsubscribe send an email to users-leave@nest-simulator.org_______________________________________________NEST Users mailing list -- users@nest-simulator.orgTo unsubscribe send an email to users-leave@nest-simulator.org_______________________________________________NEST Users mailing list -- users@nest-simulator.orgTo unsubscribe send an email to users-leave@nest-simulator.org