Пример #1
0
    def test_drone_optical_flow_non_lazy_loading(self):
        """Test loading the drone optical flow example with lazy=False"""
        dataset = 'Drone optical flow'
        metadata = neurotic.MetadataSelector(file=self.temp_file,
                                             initial_selection=dataset)
        metadata.download_all_data_files()

        blk = neurotic.load_dataset(metadata=metadata, lazy=False)
        assert (blk)
Пример #2
0
    def test_aplysia_feeding_non_lazy_loading(self):
        """Test loading the Aplysia feeding example with lazy=False"""
        dataset = 'Aplysia feeding'
        metadata = neurotic.MetadataSelector(file=self.temp_file,
                                             initial_selection=dataset)
        metadata.download_all_data_files()

        blk = neurotic.load_dataset(metadata=metadata, lazy=False)
        assert (blk)
Пример #3
0
    def test_human_balance_beam_non_lazy_loading(self):
        """Test loading the human balance beam example with lazy=False"""
        dataset = 'Human balance beam'
        metadata = neurotic.MetadataSelector(file=self.temp_file,
                                             initial_selection=dataset)
        metadata.download_all_data_files()

        blk = neurotic.load_dataset(metadata=metadata, lazy=False)
        assert (blk)
Пример #4
0
    def test_plain_text_axograph(self):
        """Test reading a plain text AXGT file using io_class and io_args"""
        dataset = 'plain-text-axograph'
        metadata = neurotic.MetadataSelector(file=self.temp_file,
                                             initial_selection=dataset)
        metadata.download('data_file')

        blk = neurotic.load_dataset(metadata=metadata, lazy=False)
        assert (blk)
Пример #5
0
    def test_matlab(self):
        """Test reading a MATLAB file"""
        dataset = 'matlab example'
        metadata = neurotic.MetadataSelector(file=self.temp_file,
                                             initial_selection=dataset)
        metadata.download('data_file')

        blk = neurotic.load_dataset(metadata=metadata, lazy=False)
        assert (blk)
Пример #6
0
    def test_missing_extension_io_class(self):
        """Test io_class works for data file with missing extension"""
        dataset = 'missing-extension-with-io_class'
        metadata = neurotic.MetadataSelector(file=self.temp_file,
                                             initial_selection=dataset)
        metadata.download('data_file')

        blk = neurotic.load_dataset(metadata=metadata, lazy=True)
        assert (blk)
Пример #7
0
    def test_missing_data_file(self):
        """Test error is raised when data file is not found locally"""
        dataset = 'video-jumps-unset'
        metadata = neurotic.MetadataSelector(file=self.temp_file,
                                             initial_selection=dataset)
        # intentionally skipping downloading data file

        with self.assertRaises(FileNotFoundError):
            blk = neurotic.load_dataset(metadata=metadata, lazy=True)
Пример #8
0
    def test_missing_extension_error(self):
        """Test error is raised when file extension and io_class are missing"""
        dataset = 'missing-extension-without-io_class'
        metadata = neurotic.MetadataSelector(file=self.temp_file,
                                             initial_selection=dataset)
        metadata.download('data_file')

        with self.assertRaisesRegex(
                IOError, 'Could not find an appropriate neo.io class .*'):
            blk = neurotic.load_dataset(metadata=metadata, lazy=True)
Пример #9
0
    def test_video_jumps(self):
        """Test video jump estimation for AxoGraph file with pauses"""
        dataset = 'video-jumps-unset'
        metadata = neurotic.MetadataSelector(file=self.temp_file,
                                             initial_selection=dataset)
        metadata.download('data_file')

        blk = neurotic.load_dataset(metadata=metadata, lazy=True)
        video_jumps = neurotic.gui.config._estimate_video_jump_times(blk)
        del blk

        assert_array_almost_equal(
            np.array(video_jumps),
            np.array([[1.1998, 3], [4.6998, 3], [5.2998, 3]]),
            decimal=12,
            err_msg='_estimate_video_jump_times gave unexpected result')
Пример #10
0
    def test_empty_plots(self):
        """Test ephyviewer window with empty plot list"""
        file = self.temp_test_file
        dataset = 'empty-plots'
        metadata = neurotic.MetadataSelector(file=file,
                                             initial_selection=dataset)
        metadata.download_all_data_files()

        lazy = False  # TODO: get lazy=True case to work
        # (tearDown fails due to file lock)
        blk = neurotic.load_dataset(metadata=metadata, lazy=lazy)
        ephyviewer_config = neurotic.EphyviewerConfigurator(metadata,
                                                            blk,
                                                            lazy=lazy)
        ephyviewer_config.show_all()

        app = mkQApp()
        win = ephyviewer_config.create_ephyviewer_window()
        self.assertIsInstance(win, MainViewer)

        # close thread properly
        win.close()