Example #1
0
 def test_check_create_raw_session_flag(self):
     raw_session = Path(self.local_session_path_3A).joinpath("raw_session.flag")
     ephys = Path(self.local_session_path_3A).joinpath("ephys_data_transferred.flag")
     video = Path(self.local_session_path_3A).joinpath("video_data_transferred.flag")
     # Check not created
     misc.check_create_raw_session_flag(self.local_session_path_3A)
     self.assertFalse(raw_session.exists())
     # Create only ephys flag
     misc.create_ephys_transfer_done_flag(self.local_session_path_3A)
     # Check not created
     misc.check_create_raw_session_flag(self.local_session_path_3A)
     self.assertFalse(raw_session.exists())
     ephys.unlink()
     # Create only video flag
     misc.create_video_transfer_done_flag(self.local_session_path_3A)
     # Check not created
     misc.check_create_raw_session_flag(self.local_session_path_3A)
     self.assertFalse(raw_session.exists())
     video.unlink()
     # Create ephys and video flag file for completed transfer
     misc.create_ephys_transfer_done_flag(self.local_session_path_3A)
     misc.create_video_transfer_done_flag(self.local_session_path_3A)
     # Check it was created
     misc.check_create_raw_session_flag(self.local_session_path_3A)
     self.assertTrue(raw_session.exists())
     # Check other flags deleted
     self.assertFalse(ephys.exists())
     self.assertFalse(video.exists())
     raw_session.unlink()
Example #2
0
 def test_create_ephys_transfer_done_flag(self):
     # Create ephys flag file for completed transfer
     misc.create_ephys_transfer_done_flag(self.local_session_path_3A)
     # Check it was created
     ephys = Path(self.local_session_path_3A).joinpath("ephys_data_transferred.flag")
     self.assertTrue(ephys.exists())
     # Remove it
     ephys.unlink()
Example #3
0
    def test_check_create_raw_session_flag(self):
        from ibllib.tests.fixtures import utils as futils

        raw_session = Path(
            self.local_session_path_3A).joinpath("raw_session.flag")
        ephys = Path(
            self.local_session_path_3A).joinpath("ephys_data_transferred.flag")
        video = Path(
            self.local_session_path_3A).joinpath("video_data_transferred.flag")
        # Add settings file
        fpath = self.local_session_path_3A / "raw_behavior_data" / "_iblrig_taskSettings.raw.json"
        fpath.touch()
        futils.populate_task_settings(
            fpath, patch={"PYBPOD_PROTOCOL": "some_ephysChoiceWorld_task"})
        ""
        # Check not created
        misc.check_create_raw_session_flag(self.local_session_path_3A)
        self.assertFalse(raw_session.exists())
        # Create only ephys flag
        misc.create_ephys_transfer_done_flag(self.local_session_path_3A)
        # Check not created
        misc.check_create_raw_session_flag(self.local_session_path_3A)
        self.assertFalse(raw_session.exists())
        ephys.unlink()
        # Create only video flag
        misc.create_video_transfer_done_flag(self.local_session_path_3A)
        # Check not created
        misc.check_create_raw_session_flag(self.local_session_path_3A)
        self.assertFalse(raw_session.exists())
        video.unlink()
        # Create ephys and video flag file for completed transfer
        misc.create_ephys_transfer_done_flag(self.local_session_path_3A)
        misc.create_video_transfer_done_flag(self.local_session_path_3A)
        # Check it was created
        misc.check_create_raw_session_flag(self.local_session_path_3A)
        self.assertTrue(raw_session.exists())
        # Check other flags deleted
        self.assertFalse(ephys.exists())
        self.assertFalse(video.exists())
        raw_session.unlink()
        # Check if biased session
        futils.populate_task_settings(
            fpath, patch={"PYBPOD_PROTOCOL": "some_biasedChoiceWorld_task"})
        misc.create_video_transfer_done_flag(self.local_session_path_3A)
        misc.check_create_raw_session_flag(self.local_session_path_3A)
        self.assertTrue(raw_session.exists())
        self.assertFalse(video.exists())
        raw_session.unlink()
Example #4
0
    def test_check_create_raw_session_flag(self):

        raw_session = Path(self.session_path_3B).joinpath("raw_session.flag")
        ephys = Path(
            self.session_path_3B).joinpath("ephys_data_transferred.flag")
        video = Path(
            self.session_path_3B).joinpath("video_data_transferred.flag")
        # Add settings file
        fpath = self.session_path_3B / "raw_behavior_data" / "_iblrig_taskSettings.raw.json"
        fu.populate_task_settings(
            fpath, patch={"PYBPOD_PROTOCOL": "some_ephysChoiceWorld_task"})
        # Check not created
        misc.check_create_raw_session_flag(self.session_path_3B)
        self.assertFalse(raw_session.exists())
        # Create only ephys flag
        misc.create_ephys_transfer_done_flag(self.session_path_3B)
        # Check not created
        misc.check_create_raw_session_flag(self.session_path_3B)
        self.assertFalse(raw_session.exists())
        ephys.unlink()
        # Create only video flag
        misc.create_video_transfer_done_flag(self.session_path_3B)
        # Check not created
        misc.check_create_raw_session_flag(self.session_path_3B)
        self.assertFalse(raw_session.exists())
        video.unlink()
        # Create ephys and video flag file for completed transfer
        misc.create_ephys_transfer_done_flag(self.session_path_3B)
        misc.create_video_transfer_done_flag(self.session_path_3B)
        # Check it was created
        misc.check_create_raw_session_flag(self.session_path_3B)
        self.assertTrue(raw_session.exists())
        # Check other flags deleted
        self.assertFalse(ephys.exists())
        self.assertFalse(video.exists())
        raw_session.unlink()
        # Check if biased session
        fu.populate_task_settings(
            fpath, patch={"PYBPOD_PROTOCOL": "some_biasedChoiceWorld_task"})
        misc.create_video_transfer_done_flag(self.session_path_3B)
        misc.check_create_raw_session_flag(self.session_path_3B)
        self.assertTrue(raw_session.exists())
        self.assertFalse(video.exists())
        raw_session.unlink()
        # Check if training session
        fu.populate_task_settings(
            fpath, patch={"PYBPOD_PROTOCOL": "some_trainingChoiceWorld_task"})
        misc.create_video_transfer_done_flag(self.session_path_3B)
        misc.check_create_raw_session_flag(self.session_path_3B)
        self.assertTrue(raw_session.exists())
        self.assertFalse(video.exists())
        raw_session.unlink()
        # Check if habituation session
        fu.populate_task_settings(
            fpath,
            patch={"PYBPOD_PROTOCOL": "some_habituationChoiceWorld_task"})
        misc.create_video_transfer_done_flag(self.session_path_3B)
        misc.check_create_raw_session_flag(self.session_path_3B)
        self.assertTrue(raw_session.exists())
        self.assertFalse(video.exists())
        raw_session.unlink()