INM-6 / python-neo

Neo is a package for representing electrophysiology data in Python, together with support for reading a wide range of neurophysiology file formats
http://packages.python.org/neo/
BSD 3-Clause "New" or "Revised" License
3 stars 10 forks source link

Annotation filter with empty targdict #10

Open mdenker opened 9 years ago

mdenker commented 9 years ago

If filtering a neo objects with an empty targdict, then nothing is returned. Desirable would be to return everything.

block.filter(targdict={},objects=["SpikeTrain"])

--> []
lphan commented 9 years ago

Some first results for function filter: Following code worked, return list of all AnalogSignal found in Block:

print "targdict={} and objects='AnalogSignal' ", blk.filter(targdict={}, objects='ANALOGSignal')
print "targdict={} and objects=AnalogSignal ", blk.filter(targdict={}, objects=AnalogSignal)
lphan commented 9 years ago
print "targdict={} and objects=['AnalogSignal'] ", blk.filter(targdict={}, objects=['AnalogSignal']) 
print "targdict={} and objects=['AnalogSignal'] ", blk.filter(targdict={}, objects=['AnalogSiGNal']) 

also worked. I will try next step with objects is a list ex. objects=['AnalogSignal', 'SpikeTrains']

lphan commented 9 years ago

Some new results like following also worked now:

print "targdict={} and objects=['SPikETRAin', 'AnalogSIGNAl', 'BLOCK'] ", blk.filter(targdict={}, objects=["SPikETRAin", "AnalogSIGNAL", "BLOCK"])

return a list of all targeted (searched) objects