feature request neo segment block contextual ascii art.

22 views
Skip to first unread message

Russell Jarvis

unread,
Apr 23, 2018, 11:24:54 PM4/23/18
to Neural Ensemble
Greetings neo developers/users,

I have been using neo with PyNN for the last few months, to retrieve neuron spike trains and analog signals. I am not sure if I represent the average user, but during this time, I became a bit disorientated about whether I was accessing a neo block, segment or analogue signal. I would often use dir on neo derived data types to check what methods were available, in order to get a contextual understanding of where I was in the nesting, but what is returned from dir is not always helpful. It would be cool if dir(block), dir(segment), dir(spike_trains) and dir(analogue_signal) returned some ascii art version of the diagram below, with a pointer to the position you currently occupy in that space.
Message has been deleted

Andrew Davison

unread,
Apr 24, 2018, 3:28:19 AM4/24/18
to Neural Ensemble
Hi Russell,

I'm afraid I'm having difficulty in understanding your use case, and the circumstances in which you don't know which object you're currently accessing. Isn't `type(obj)` sufficient?

Cheers,

Andrew

Samuel Garcia

unread,
Apr 24, 2018, 3:30:43 AM4/24/18
to neurale...@googlegroups.com
Hi,
Julia already code some pretty repr so that in jupyter/ipython you can have usefull information.
It is not ascii art but it is already usefull to explore the tree.

Example
import neo
bl = neo.ExampleIO().read_block()
bl # <<< this is a pretty print in ipython

give

Block with 2 segments, 4 channel_indexes
name: 'Block #0'
annotations: {'block_extra_info': 'This is the block 0'}
# segments (N=2)
0: Segment with 1 analogsignals, 1 epochs, 1 events, 3 spiketrains
   name: 'Seg #0 Block #0'
   annotations: {'seg_extra_info': 'This is the seg 0 of block 0'}
   # analogsignals (N=1)
   0: AnalogSignal with 16 channels of length 100000; units uV; datatype float32
      name: 'Channel bundle (ch0,ch1,ch2,ch3,ch4,ch5,ch6,ch7,ch8,ch9,ch10,ch11,ch12,ch13,ch14,ch15) '
      annotations: {'channel_ids': array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16]),
        'channel_names': array(['ch0', 'ch1', 'ch2', 'ch3', 'ch4', 'ch5', 'ch6', 'ch7', 'ch8',
               'ch9', 'ch10', 'ch11', 'ch12', 'ch13', 'ch14', 'ch15'],
              dtype='<U64')}
      sampling rate: 10000.0 Hz
      time: 0.0 s to 10.0 s
1: Segment with 1 analogsignals, 1 epochs, 1 events, 3 spiketrains
   name: 'Seg #1 Block #0'
   annotations: {'seg_extra_info': 'This is the seg 1 of block 0'}
   # analogsignals (N=1)
   0: AnalogSignal with 16 channels of length 100000; units uV; datatype float32
      name: 'Channel bundle (ch0,ch1,ch2,ch3,ch4,ch5,ch6,ch7,ch8,ch9,ch10,ch11,ch12,ch13,ch14,ch15) '
      annotations: {'channel_ids': array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16]),
        'channel_names': array(['ch0', 'ch1', 'ch2', 'ch3', 'ch4', 'ch5', 'ch6', 'ch7', 'ch8',
               'ch9', 'ch10', 'ch11', 'ch12', 'ch13', 'ch14', 'ch15'],
              dtype='<U64')}
      sampling rate: 10000.0 Hz
      time: 15.0 s to 25.0 s






best


Samuel
--
You received this message because you are subscribed to the Google Groups "Neural Ensemble" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neuralensembl...@googlegroups.com.
To post to this group, send email to neurale...@googlegroups.com.
Visit this group at https://groups.google.com/group/neuralensemble.
For more options, visit https://groups.google.com/d/optout.

Russell Jarvis

unread,
Apr 24, 2018, 1:15:46 PM4/24/18
to neurale...@googlegroups.com
Hi Andrew and Samuel, 

Explaining it as not knowing what the type was wrong. I guess what I meant was a quick contextual information, and location that is in python and not online. Yes, The tree hierarchy representation like the one in Julia would be good. Also I was wrong to suggest in dir(), maybe in the help() string. 

Russell.

To unsubscribe from this group and stop receiving emails from it, send an email to neuralensemble+unsubscribe@googlegroups.com.
To post to this group, send email to neuralensemble@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Neural Ensemble" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neuralensemble+unsubscribe@googlegroups.com.
To post to this group, send email to neuralensemble@googlegroups.com.



--


Russell Jarvis
Grad Research Assistant
Sols Graduate Programs
Arizona State University
Mail Code: 4601
Tempe, AZ a
c: 623-428-1593
email: russell...@asu.edu

ASU #1 in the U.S. for innovation
#1 ASU   #2 Stanford   #3 MIT
—U.S. News & World Report
Reply all
Reply to author
Forward
0 new messages