I couldn't get a raster image for tutorial 7

31 views
Skip to first unread message

gyumin park

unread,
Apr 18, 2024, 6:33:50 AM4/18/24
to NetPyNE Q&A forum
Hello, everyone!

I joined a lab few days ago and I have been learning NetPyne by myself.

I was trying to implement tutorial 7 (http://doc.netpyne.org/tutorial.html#tutorial-7-modifying-the-instantiated-network-interactively), after I ran the code, I only got 2D net and traces images except raster image that is shown on tutorial 7 manual.

Here is a error message from my terminal! 

####################################
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/netpyne/analysis/utils.py", line 87, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/netpyne/plotting/plotRaster.py", line 395, in plotRaster
    rasterPlotter.axis.vlines(spkTimes, 0, len(cellInds), 'red', linewidth=0.1)
                                               ^^^^^^^^
NameError: name 'cellInds' is not defined
####################################

I also tried to download the example file in the manual (tut7.py), so definitely not typo error. 

I don't know what should i try to do. Any help would be appreciated.

sincerely,
gyumin.

P.S I also checked the Ivan Shevchenko's question about tutorial 7, but unfortunately it didn't help :(


J C

unread,
Apr 18, 2024, 10:59:43 PM4/18/24
to NetPyNE Q&A forum
Hello,

The issue is `cellInds` which is not defined, and only referenced in if `syncLines` is true--there is a lack of code coverage here because this argument does not appear to have been tested with each revision to NetPyNE--
You can change the `syncLines` argument to `False` if you do not wish to wait for a change (or change) the NetPyNE source code. This will allow the script to execute without breaking, but will remove red vertical lines at each point.
`simConfig.analysis['plotRaster'] = {'syncLines': False, 'saveFig': True}`
If you want to change the source code to add vertical lines, it looks like the definition of `cellInds` was deleted 5 mo. ago as part of a bug fix, but the argument should provide the vertical line height. We can reference the parent of that particular commit [here](https://github.com/suny-downstate-medical-center/netpyne/blob/e10aa9187afca9be5d54c11c7ca21abaa8382de7/netpyne/plotting/plotRaster.py#L305) to find the definition:

`cellInds = list(set(spkInds))`

which should be placed prior to line 395.


Best

박규민

unread,
Apr 22, 2024, 12:17:36 AM4/22/24
to NetPyNE Q&A forum
Thank you for your help :)

2024년 4월 19일 금요일 오전 11시 59분 43초 UTC+9에 J C님이 작성:
Reply all
Reply to author
Forward
0 new messages