Ejemplo n.º 1
0
 def test_create_ephys_flags(self):
     extract = self.local_session_path_3A.joinpath("extract_ephys.flag")
     qc = self.local_session_path_3A.joinpath("raw_ephys_qc.flag")
     spike_sorting0 = self.local_session_path_3A / "raw_ephys_data" / "probe00"
     spike_sorting1 = self.local_session_path_3A / "raw_ephys_data" / "probe01"
     spike_sorting0 = spike_sorting0.joinpath("spike_sorting.flag")
     spike_sorting1 = spike_sorting1.joinpath("spike_sorting.flag")
     misc.create_ephys_flags(self.local_session_path_3A)
     self.assertTrue(extract.exists())
     self.assertTrue(qc.exists())
     self.assertTrue(spike_sorting0.exists())
     self.assertTrue(spike_sorting1.exists())
     # Test recreate
     misc.create_ephys_flags(self.local_session_path_3A)
     self.assertTrue(extract.exists())
     self.assertTrue(qc.exists())
     self.assertTrue(spike_sorting0.exists())
     self.assertTrue(spike_sorting1.exists())
     # Remove flags after test
     extract.unlink()
     qc.unlink()
     spike_sorting0.unlink()
     spike_sorting1.unlink()
     # test removal
     self.assertFalse(extract.exists())
     self.assertFalse(qc.exists())
     self.assertFalse(spike_sorting0.exists())
     self.assertFalse(spike_sorting1.exists())
Ejemplo n.º 2
0
 def test_create_ephys_flags(self):
     extract = self.session_path_3B.joinpath('extract_ephys.flag')
     qc = self.session_path_3B.joinpath('raw_ephys_qc.flag')
     # Create some probe folders for test
     raw_ephys = self.session_path_3B.joinpath('raw_ephys_data')
     probe_dirs = [raw_ephys.joinpath(f'probe{i:02}') for i in range(3)]
     [x.mkdir(exist_ok=True) for x in probe_dirs]
     misc.create_ephys_flags(self.session_path_3B)
     self.assertTrue(extract.exists())
     self.assertTrue(qc.exists())
     self.assertTrue(
         all(x.joinpath('spike_sorting.flag').exists() for x in probe_dirs))
     # Test recreate
     misc.create_ephys_flags(self.session_path_3B)
     self.assertTrue(extract.exists())
     self.assertTrue(qc.exists())
     self.assertTrue(
         all(x.joinpath('spike_sorting.flag').exists() for x in probe_dirs))