示例#1
0
def test_reduce_shape():
    dyna_corrs_reduced_1 = timecorr(sim_1,
                                    rfun='PCA',
                                    weights_function=laplace['weights'],
                                    weights_params=laplace['params'])

    dyna_corrs_reduced_3 = timecorr(sim_3,
                                    rfun='PCA',
                                    weights_function=laplace['weights'],
                                    weights_params=laplace['params'])
    assert np.shape(dyna_corrs_reduced_1) == np.shape(sim_1)
    assert np.shape(dyna_corrs_reduced_3) == np.shape(sim_3)
示例#2
0
def test_exclude_timepoints_neg():
    dyna_corrs_reduced_3 = timecorr(sim_3,
                                    rfun='PCA',
                                    weights_function=laplace['weights'],
                                    weights_params=laplace['params'],
                                    exclude_timepoints=-3)

    assert np.shape(dyna_corrs_reduced_3) == np.shape(sim_3)
示例#3
0
def test_nans():
    sim_3[0][0] = np.nan
    dyna_corrs_reduced_3 = timecorr(sim_3,
                                    rfun='PCA',
                                    weights_function=laplace['weights'],
                                    weights_params=laplace['params'])

    assert np.shape(dyna_corrs_reduced_3) == np.shape(sim_3)
示例#4
0
    assert isinstance(data_dl, list)

    Test_dl = data_dl[0].shape[0]
    Test_pdf = data_pdf[0].shape[0]
    Test_npa = data_npa[0].shape[0]
    #Test returns the shape of the weights_function
    #   Test_npl=  data_npl[0].shape[0]
    #   Test_rand=  data_rn[0].shape[0]

    assert isinstance(Test_pdf, int)

    dl_tester = gaussian_weights(Test_dl, params=gaussian_params)
    pdf_tester = gaussian_weights(Test_pdf, params=gaussian_params)
    npa_tester = gaussian_weights(Test_npa, params=gaussian_params)
    #   thrid_tester = gaussian_weights(T3, params=gaussian_params)
    #   fourth_tester = gaussian_weights(T4, params=gaussian_params)

    assert isinstance(npa_tester, np.ndarray)
# assert npa_tester.shape == data_npa.shape
# assert dl_tester.shape > data_dl.shape


#unsure how to test 'across' mode

corrs = timecorr(numpy_array,
                 weights_function=gaussian_weights,
                 weights_params=gaussian_params,
                 cfun=isfc)
#assert()
#assert len(corrs.get_time_data()[0]) == len(numpy_array)