diff --git a/src/python_bindings/bindings.cpp b/src/python_bindings/bindings.cpp index 141d935447..428b3e424b 100644 --- a/src/python_bindings/bindings.cpp +++ b/src/python_bindings/bindings.cpp @@ -45,6 +45,7 @@ #include "py_fd_verifier.h" #include "py_metric_verifier.h" #include "py_ucc_algorithm.h" +#include "py_ucc_verifier.h" INITIALIZE_EASYLOGGINGPP @@ -160,6 +161,12 @@ PYBIND11_MODULE(desbordante, module) { .def("get_num_error_rows", &PyFDVerifier::GetNumErrorRows) .def("get_highlights", &PyFDVerifier::GetHighlights); + DEFINE_ALGORITHM(UCCVerifier, Algorithm) + .def("ucc_holds", &PyUCCVerifier::UCCHolds) + .def("get_num_clusters_not_ucc", &PyUCCVerifier::GetNumClustersNotUCC) + .def("get_num_rows_not_ucc", &PyUCCVerifier::GetNumRowsNotUCC) + .def("get_clusters_not_ucc", &PyUCCVerifier::GetClustersNotUCC); + DEFINE_ALGORITHM(DataStats, Algorithm).def("get_result_string", &PyDataStats::GetResultString); DEFINE_ALGORITHM(MetricVerifier, Algorithm).def("mfd_holds", &PyMetricVerifier::MfdHolds); diff --git a/src/python_bindings/py_ucc_verifier.h b/src/python_bindings/py_ucc_verifier.h new file mode 100644 index 0000000000..6d1aa12d40 --- /dev/null +++ b/src/python_bindings/py_ucc_verifier.h @@ -0,0 +1,30 @@ +#pragma once + +#include "algorithms/ucc/ucc_verifier/ucc_verifier.h" +#include "get_algorithm.h" +#include "py_algorithm.h" + +namespace python_bindings { + +class PyUCCVerifier : public PyAlgorithm { + using PyAlgorithmBase::algorithm_; + +public: + [[nodiscard]] bool UCCHolds() const { + return GetAlgorithm(algorithm_).UCCHolds(); + } + + [[nodiscard]] size_t GetNumClustersNotUCC() const { + return GetAlgorithm(algorithm_).GetNumClustersNotUCC(); + } + + [[nodiscard]] size_t GetNumRowsNotUCC() const { + return GetAlgorithm(algorithm_).GetNumRowsNotUCC(); + } + + [[nodiscard]] std::vector GetClustersNotUCC() const { + return GetAlgorithm(algorithm_).GetClustersNotUCC(); + } +}; + +} // namespace python_bindings