def prepare(self):
     directory = os.path.join(path, 'video', 'image_sequence')
     self.v = tp.ImageSequence(directory)
     self.PARAMS = (11, 3000)
     self.expected = tp.batch(self.v[[0, 1]],
                              *self.PARAMS,
                              engine='python',
                              meta=False)
Beispiel #2
0
    def test_pims_deprecation(self):
        """Using a pims class should work, but generate a warning.

        The inclusion of these classes (and therefore this test) in
        trackpy is deprecated as of v0.3 and will be removed in a future
        version."""
        with warnings.catch_warnings(record=True) as w:
            warnings.simplefilter('ignore')
            warnings.simplefilter('always', UserWarning)
            imseq = trackpy.ImageSequence(os.path.join(path, 'video/image_sequence/*.png'))
            assert isinstance(imseq, pims.ImageSequence)
            if len(w) != 1:
                print('Caught warnings:')
                for wrn in w:
                    print(wrn, wrn.message)
            assert len(w) == 1