def _add_xye_dataset(self, file_path): try: dataset = XYEDataset.from_file(file_path) except IOError: return self.datasets.append(dataset) create_datasetui(dataset)
def xye_save_test(self): filename = join(self.basedir, 'si640c_low_temp_cal_p1_scan0.000000_adv0_0000.xye') dataset = XYEDataset.from_file(filename) f = StringIO() dataset.save(f) f.seek(0) data = XYEDataset._load_xye_data(f) eq_(data.shape, (20458, 3))
def xye_copy_test(self): filename = join(self.basedir, 'si640c_low_temp_cal_p1_scan0.000000_adv0_0000.xye') dataset = XYEDataset.from_file(filename) copied_dataset = dataset.copy() self.assertTrue(np.allclose(dataset.data, copied_dataset.data))