Beispiel #1
0
    def test_null_predict(self):
        """Make sure that a prediction of no motion does not interfere
        with normal tracking.
        """
        # link_df_iter
        pred = predict.NullPredict()
        ll = get_linked_lengths((mkframe(0), mkframe(25)),
                                self.get_linker_iter(pred), 45)
        assert all(ll.values == 2)

        # link_df
        pred = predict.NullPredict()
        ll_df = self.get_linker(pred)(pandas.concat((mkframe(0),
                                                     mkframe(25))), 45)
        # print(ll_df)
        assert all(ll_df.groupby('particle').x.count().values == 2)

        # Make sure that keyword options are handled correctly
        # (This checks both link_df and link_df_iter)
        # The conditional is so we won't test find_link in this way,
        # due to the way column names are baked into the
        # artificial image code.
        if not getattr(self, 'coords_via_images', False):
            features = pandas.concat((mkframe(0), mkframe(25)))
            features.rename(columns=lambda n: n + '_', inplace=True)
            pred = predict.NullPredict()
            ll_df = self.get_linker(pred)(features, 45, t_column='frame_',
                                          pos_columns=['x_', 'y_'])
            assert all(ll_df.groupby('particle').x_.count().values == 2)
Beispiel #2
0
 def test_null_predict(self):
     """Make sure that a prediction of no motion does not interfere
     with normal tracking.
     """
     pred = predict.NullPredict()
     ll = get_linked_lengths((mkframe(0), mkframe(0.25)), pred.link_df_iter,
                             0.45)
     assert all(ll.values == 2)
Beispiel #3
0
    def test_null_predict(self):
        """Make sure that a prediction of no motion does not interfere
        with normal tracking.
        """
        # link_df_iter
        pred = predict.NullPredict()
        ll = get_linked_lengths((mkframe(0), mkframe(0.25)),
                                pred.link_df_iter, 0.45)
        assert all(ll.values == 2)

        # link_df
        pred = predict.NullPredict()
        ll_df = pred.link_df(pandas.concat((mkframe(0), mkframe(0.25))), 0.45)
        assert all(ll_df.groupby('particle').x.count().values == 2)

        # Make sure that keyword options are handled correctly
        # (This checks both link_df and link_df_iter)
        features = pandas.concat((mkframe(0), mkframe(0.25)))
        features.rename(columns=lambda n: n + '_', inplace=True)
        pred = predict.NullPredict()
        ll_df = pred.link_df(features, 0.45, t_column='frame_', pos_columns=['x_', 'y_'])
        assert all(ll_df.groupby('particle').x_.count().values == 2)