def test_process_column_multiple_thresholds(self):
        thresholds = [-1, 0.68, 4.67, 5]
        counter = ThresholdCounter(thresholds)
        counter.initialise(1, self.dm.shape[0], self.dm.shape[1])

        for column in range(0, self.dm.shape[1]):
            counter.process_column(column, np.atleast_2d(self.dm[:, column]))

        npt.assert_equal(counter.counts,
                         self.bruteforce_count(self.dm, thresholds))
    def test_process_column_single_threshold(self):
        threshold = 5.09
        counter = ThresholdCounter(threshold)
        counter.initialise(1, self.dm.shape[0], self.dm.shape[1])

        for column in range(0, self.dm.shape[1]):
            counter.process_column(column, np.atleast_2d(self.dm[:, column]))

        npt.assert_equal(counter.counts,
                         self.bruteforce_count(self.dm, [threshold]))
    def test_process_diagonal_multiple_thresholds(self):
        thresholds = [-1, 2.12, 2.83, 6]
        counter = ThresholdCounter(thresholds)
        counter.initialise(1, self.dm.shape[0], self.dm.shape[1])

        for diag in range(-self.dm.shape[0] + 1, self.dm.shape[1]):
            diag_ind = diag_indices_of(self.dm, diag)
            counter.process_diagonal(diag, np.atleast_2d(self.dm[diag_ind]))

        npt.assert_equal(counter.counts,
                         self.bruteforce_count(self.dm, thresholds))
    def test_process_diagonal_single_threshold(self):
        threshold = 2.83
        counter = ThresholdCounter(threshold)
        counter.initialise(1, self.dm.shape[0], self.dm.shape[1])

        for diag in range(-self.dm.shape[0] + 1, self.dm.shape[1]):
            diag_ind = diag_indices_of(self.dm, diag)
            counter.process_diagonal(diag, np.atleast_2d(self.dm[diag_ind]))

        npt.assert_equal(counter.counts,
                         self.bruteforce_count(self.dm, [threshold]))