OK, this is a new feature I want to add which is a bit complicated and will require shaking some things up. This issue is here to get feedback to see if this is something people want or would find useful.
I want to create a custom Filter class that subclasses from np.ndarray. Currently, we treat filters as numpy arrays which get passed around to the different functions in pyret (such as viz.plotsta, viz.decompose, etc.)
Having a custom Filter class would then wrap lots of the functions that require a filter-like object. We could pass other metadata when we instantiate the filter (such as time steps and spatial pixel sizes), which would simplify other function calls.
I'll make a quick version of this in a separate branch, but let me know if you have thoughts
Potential sample code:
from pyret.containers import Filter
import pyret.filtertools as ft
# build the Filter object
arr = ft.getsta(time, stim, spikes, filter_length)
sta = Filter(arr, dt=1e-3, dx=0.1, dy=0.1)
# plot the sta with appropriate time axes
sta.plot()
# animation
sta.play()
# convolve with a stimulus
sta.convolve(stim)
OK, this is a new feature I want to add which is a bit complicated and will require shaking some things up. This issue is here to get feedback to see if this is something people want or would find useful.
I want to create a custom
Filter
class that subclasses fromnp.ndarray
. Currently, we treat filters as numpy arrays which get passed around to the different functions inpyret
(such asviz.plotsta
,viz.decompose
, etc.)Having a custom
Filter
class would then wrap lots of the functions that require a filter-like object. We could pass other metadata when we instantiate the filter (such as time steps and spatial pixel sizes), which would simplify other function calls.I'll make a quick version of this in a separate branch, but let me know if you have thoughts
Potential sample code: