def test_featurize_time_series_custom_functions():
    n_channels = 3
    t, m, e = sample_time_series(channels=n_channels)
    features_to_use = ['amplitude', 'std_err', 'test_f']
    target = 'class1'
    meta_features = {'meta1': 0.5}
    custom_functions = {'test_f': lambda t, m, e: np.mean(m)}
    fset = featurize.featurize_time_series(t, m, e, features_to_use, target,
                                           meta_features,
                                           custom_functions=custom_functions,
                                           use_celery=False)
    npt.assert_array_equal(sorted(fset.data_vars),
                           ['amplitude', 'meta1', 'std_err', 'test_f'])
    npt.assert_array_equal(fset.channel, np.arange(n_channels))
    npt.assert_array_equal(sorted(fset.amplitude.coords),
                           ['channel', 'name', 'target'])
    npt.assert_array_equal(fset.target.values, ['class1'])
Tests the GetDataStream function.
dataset/ETHPy150Open cesium-ml/cesium/cesium/tests/test_featurize.py/test_featurize_time_series_custom_functions--crossover with--dataset/ETHPy150Open log2timeline/dfvfs/tests/vfs/tsk_partition_file_entry.py/TSKPartitionFileEntryTest.testGetDataStream