def testcase():
    ' test the stimulus transformation filter by incremental calling '
    M = np.array([0, 0, 0, 1, 0, 0, 1, 1, 0, 1])[:, np.newaxis]
    s2ef = stim2eventfilt(evtlabs=('re', 'fe'), histlen=3)
    print('single step')
    m0 = s2ef.transform(M)
    print('{} -> {}'.format(M, m0))
    print('Step size = 1')
    m1 = np.zeros(m0.shape, m0.dtype)
    for i in range(len(M)):
        idx = slice(i, (i + 1))
        mm = s2ef.transform(M[idx, :])
        m1[(idx, ...)] = mm
        print('{} {} -> {}'.format(i, M[(idx, ...)], mm))
    print('Step size=4')
    m4 = np.zeros(m0.shape, m0.dtype)
    for i in range(0, len(M), 4):
        idx = slice(i, (i + 4))
        mm = s2ef.transform(M[idx, :])
        m4[(idx, ...)] = mm
        print('{} {} -> {}'.format(i, M[(idx, ...)], mm))
    print('m0={}\nm1={}\n,m4={}\n'.format(m0, m1, m4))
test the stimulus transformation filter by incremental calling
def testcase():
    '  '
    M = np.array([0, 0, 0, 1, 0, 0, 1, 1, 0, 1])[:, np.newaxis]
    s2ef = stim2eventfilt(evtlabs=('re', 'fe'), histlen=3)
    print('single step')
    m0 = s2ef.transform(M)
    print('{} -> {}'.format(M, m0))
    print('Step size = 1')
    m1 = np.zeros(m0.shape, m0.dtype)
    for i in range(len(M)):
        idx = slice(i, (i + 1))
        mm = s2ef.transform(M[idx, :])
        m1[(idx, ...)] = mm
        print('{} {} -> {}'.format(i, M[(idx, ...)], mm))
    print('Step size=4')
    m4 = np.zeros(m0.shape, m0.dtype)
    for i in range(0, len(M), 4):
        idx = slice(i, (i + 4))
        mm = s2ef.transform(M[idx, :])
        m4[(idx, ...)] = mm
        print('{} {} -> {}'.format(i, M[(idx, ...)], mm))
    print('m0={}\nm1={}\n,m4={}\n'.format(m0, m1, m4))