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

Filtering does not recognize quantities #7

Open mdenker opened 9 years ago

mdenker commented 9 years ago

In this example, t_start is filtered to be 0, but the t_start is actually 0 seconds. Thus, the unit is ignored. Is this behavior desireable (i.e., if not unit is passed when filtering a quantity, assume the unit of the property/annotation?

h=bl.filter({'t_start':0})
print len(h)
print h[0]
# This is 0 seconds, not 0
print h[0].t_start
lphan commented 9 years ago

This is what I get from running of above code:

print len(h)  # 30
print h[0]     # [ 0.01  3.3   9.3 ] uV
print h[0].t_start   # 0.0 s

The quantities is also included in output. What went wrong here, I'm not sure that I got it.