def test_load_save(): ndx1 = create_ndx() file_h5 = output_dir + '/test.h5' ndx1.save(file_h5) ndx3 = TrialNdx.load(file_h5) assert (ndx1 == ndx3) file_txt = output_dir + '/test.txt' ndx3.trial_mask[0, :] = True ndx3.trial_mask[:, 0] = True ndx3.save(file_txt) ndx2 = TrialNdx.load(file_txt) assert (ndx3 == ndx2)
def create_ndx(ndx_file='./tests/data_in/core-core_det5_ndx.h5'): ndx = TrialNdx.load(ndx_file) ndx.sort() return ndx