Core of this library: DataChunk, RecordMaster, Data_Pipe, and import/export of reM
%load_ext autoreload
%autoreload 2
np.random.seed(1)
dc = DataChunk(np.random.rand(100), 0, "data", fill=0)
test_eq(len(dc), 100)
test_eq(dc.idx, 0)
test_eq(dc.group, "data")
test_eq(dc.fill, 0)
np.random.seed(1)
dc_tp = DataChunk(np.arange(0,10000,50), 0, "sync", fill=0)
dc_signals = DataChunk(np.random.rand(100), 10, "sync", fill=0)
dc = DataChunk(np.random.rand(100), 111, "cell", fill=0)
cr = ContiguousRecord(len(dc_tp), dc_signals, dc_tp)
test_eq(cr.dataset_intersect([dc_signals], dc_tp), True)
test_eq(cr.dataset_intersect([dc_signals], dc), False)
test_eq(cr.get_slice("signals"), [slice(10, 110, None)])
cr["test"] = dc
test_eq(cr.get_names_group("cell"), ['test'])
test_eq(cr.get_names_group("sync"), ['signals', 'main_tp'])
test_eq(len(cr["main_tp"]), 200)
cr.set_slice(slice(100,200,1))
test_eq(len(cr["main_tp"]), 100)
cr.set_slice(None)
test_eq(len(cr["main_tp"]), 200)
np.random.seed(1)
dc_tp = DataChunk(np.arange(0,10000,50), 0, "sync", fill=0)
dc_signals = DataChunk(np.random.rand(100), 10, "sync", fill=0)
dc = DataChunk(np.random.rand(100), 111, "cell", fill=0)
reM = RecordMaster([(dc_signals, dc_tp)])
reM.plot()