def test_bounded_detector_eval_metric_univariate(self, config):
        """Verifying the performance of the bounded detectors on an univariate example"""
        detector_cls, detector_kwargs, expected_values, fitted_params = config
        detector = detector_cls(**detector_kwargs)
        if isinstance(detector, FittableDetector):
            detector.fit(self.train)
        binary_detection = detector.detect(self.test)

        # Return of .detect() must be binary
        np.testing.assert_array_equal(
            binary_detection.values(copy=False),
            binary_detection.values(copy=False).astype(bool),
        )

        # Return of .detect() must be same len as input
        assert len(binary_detection) == len(self.test)

        assert (
            binary_detection.sum(axis=0).all_values().flatten()[0]
            == expected_values["anomalies"]
        )

        for m_func in metric_func:
            assert (
                np.abs(
                    expected_values[m_func]
                    - detector.eval_metric(self.anomalies, self.test, metric=m_func),
                )
                < delta
            )

        # check the fitted parameters
        if isinstance(detector, QuantileDetector):
            assert np.abs(fitted_params[0] - detector.low_threshold[0]) < delta
            assert np.abs(fitted_params[1] - detector.high_threshold[0]) < delta
Verifying the performance of the bounded detectors on an univariate example
darts/tests/ad/test_detectors.py