diff --git a/cli/cli.py b/cli/cli.py index 040e0231fd..ded7a6adb7 100644 --- a/cli/cli.py +++ b/cli/cli.py @@ -469,7 +469,8 @@ class Algorithm(StrEnum): Algorithm.naive_ucc_verifier), Task.aucc_verification: TaskInfo([Algorithm.naive_aucc_verifier], Algorithm.naive_aucc_verifier), - Task.gfd_verification: TaskInfo([Algorithm.naive_gfd_verifier, Algorithm.gfd_verifier, Algorithm.egfd_verifier], + Task.gfd_verification: TaskInfo([Algorithm.naive_gfd_verifier, Algorithm.gfd_verifier, + Algorithm.egfd_verifier], Algorithm.naive_gfd_verifier), } diff --git a/examples/comparison_pfd_vs_afd.py b/examples/comparison_pfd_vs_afd.py index 07cfb7657d..3fe026ed77 100644 --- a/examples/comparison_pfd_vs_afd.py +++ b/examples/comparison_pfd_vs_afd.py @@ -26,8 +26,8 @@ def get_pfds(): pfds = set(get_pfds()) afds = set(get_afds()) -print("pFDs \ AFDs =", stringify(pfds - afds)) -print("AFDs \ pFDs =", stringify(afds - pfds)) +print("pFDs \\ AFDs =", stringify(pfds - afds)) +print("AFDs \\ pFDs =", stringify(afds - pfds)) print("AFDs ∩ pFDs =", stringify(afds & pfds)) print("1 - PerValue([DeviceId] -> Data) =", 0.1714285714) diff --git a/src/python_bindings/ac/bind_ac.cpp b/src/python_bindings/ac/bind_ac.cpp index 9255b57eb1..a3b276c292 100644 --- a/src/python_bindings/ac/bind_ac.cpp +++ b/src/python_bindings/ac/bind_ac.cpp @@ -1,4 +1,9 @@ -#include "bind_ac.h" +#include "ac/bind_ac.h" + +#include +#include +#include +#include #include #include @@ -7,9 +12,7 @@ #include "algorithms/algebraic_constraints/mining_algorithms.h" #include "py_util/bind_primitive.h" -namespace { namespace py = pybind11; -} // namespace namespace python_bindings { void BindAc(py::module_& main_module) { @@ -27,7 +30,7 @@ void BindAc(py::module_& main_module) { std::vector> res; res.reserve(ranges.ranges.size() / 2); assert(ranges.ranges.size() % 2 == 0); - for (size_t i = 0; i < ranges.ranges.size(); i += 2) { + for (std::size_t i = 0; i < ranges.ranges.size(); i += 2) { // TODO: change this once a proper conversion mechanism from // `model::INumericType` is implemented std::string l_endpoint = @@ -42,12 +45,9 @@ void BindAc(py::module_& main_module) { BindPrimitiveNoBase(ac_module, "AcAlgorithm") .def("get_ac_ranges", &ACAlgorithm::GetRangesCollections, py::return_value_policy::reference_internal) - .def( - "get_ac_exceptions", - [](ACAlgorithm& algo) { - algo.CollectACExceptions(); - return algo.GetACExceptions(); - }, - py::return_value_policy::reference_internal); + .def("get_ac_exceptions", [](ACAlgorithm& algo) { + algo.CollectACExceptions(); + return algo.GetACExceptions(); + }); } } // namespace python_bindings diff --git a/src/python_bindings/ar/bind_ar.cpp b/src/python_bindings/ar/bind_ar.cpp index b87ef805fa..3448fe618e 100644 --- a/src/python_bindings/ar/bind_ar.cpp +++ b/src/python_bindings/ar/bind_ar.cpp @@ -1,4 +1,4 @@ -#include "bind_ar.h" +#include "ar/bind_ar.h" #include #include @@ -7,9 +7,7 @@ #include "algorithms/association_rules/mining_algorithms.h" #include "py_util/bind_primitive.h" -namespace { namespace py = pybind11; -} // namespace namespace python_bindings { void BindAr(py::module_& main_module) { diff --git a/src/python_bindings/bind_main_classes.cpp b/src/python_bindings/bind_main_classes.cpp index 2f3ea88a16..948bc8a3a6 100644 --- a/src/python_bindings/bind_main_classes.cpp +++ b/src/python_bindings/bind_main_classes.cpp @@ -14,8 +14,9 @@ #include "py_util/opt_to_py.h" #include "py_util/py_to_any.h" -namespace { namespace py = pybind11; + +namespace { using algos::Algorithm; auto const kVoidIndex = std::type_index{typeid(void)}; diff --git a/src/python_bindings/dd/bind_split.cpp b/src/python_bindings/dd/bind_split.cpp index e31846e1ce..2fe07a84ea 100644 --- a/src/python_bindings/dd/bind_split.cpp +++ b/src/python_bindings/dd/bind_split.cpp @@ -1,4 +1,4 @@ -#include "bind_split.h" +#include "dd/bind_split.h" #include #include @@ -7,9 +7,7 @@ #include "algorithms/dd/mining_algorithms.h" #include "py_util/bind_primitive.h" -namespace { namespace py = pybind11; -} // namespace namespace python_bindings { void BindSplit(py::module_& main_module) { diff --git a/src/python_bindings/fd/bind_fd.cpp b/src/python_bindings/fd/bind_fd.cpp index 726024c6a3..1f8e4740ca 100644 --- a/src/python_bindings/fd/bind_fd.cpp +++ b/src/python_bindings/fd/bind_fd.cpp @@ -1,4 +1,8 @@ -#include "bind_fd.h" +#include "fd/bind_fd.h" + +#include +#include +#include #include #include @@ -10,9 +14,9 @@ #include "py_util/bind_primitive.h" #include "util/bitset_utils.h" -namespace { namespace py = pybind11; +namespace { template py::tuple VectorToTuple(std::vector vec) { std::size_t const size = vec.size(); diff --git a/src/python_bindings/fd/bind_fd_verification.cpp b/src/python_bindings/fd/bind_fd_verification.cpp index ca65c64236..ad63e62ad2 100644 --- a/src/python_bindings/fd/bind_fd_verification.cpp +++ b/src/python_bindings/fd/bind_fd_verification.cpp @@ -1,4 +1,4 @@ -#include "bind_fd_verification.h" +#include "fd/bind_fd_verification.h" #include #include @@ -8,9 +8,7 @@ #include "algorithms/fd/verification_algorithms.h" #include "py_util/bind_primitive.h" -namespace { namespace py = pybind11; -} // namespace namespace python_bindings { void BindFdVerification(pybind11::module_& main_module) { @@ -30,6 +28,8 @@ void BindFdVerification(pybind11::module_& main_module) { .def("get_num_error_rows", &FDVerifier::GetNumErrorRows) .def("get_highlights", &FDVerifier::GetHighlights); + // Create AFD verification module alias. We currently consider FD verification and AFD + // verification to be the same. main_module.attr("afd_verification") = fd_verification_module; } } // namespace python_bindings diff --git a/src/python_bindings/gfd/bind_gfd_verification.cpp b/src/python_bindings/gfd/bind_gfd_verification.cpp index 94d91e7db8..f9deff7027 100644 --- a/src/python_bindings/gfd/bind_gfd_verification.cpp +++ b/src/python_bindings/gfd/bind_gfd_verification.cpp @@ -6,9 +6,7 @@ #include "algorithms/gfd/verification_algorithms.h" #include "py_util/bind_primitive.h" -namespace { namespace py = pybind11; -} // namespace namespace python_bindings { void BindGfdVerification(pybind11::module_& main_module) { diff --git a/src/python_bindings/mfd/bind_mfd_verification.cpp b/src/python_bindings/mfd/bind_mfd_verification.cpp index 6e7d3bfd71..007b1b7ffa 100644 --- a/src/python_bindings/mfd/bind_mfd_verification.cpp +++ b/src/python_bindings/mfd/bind_mfd_verification.cpp @@ -1,4 +1,4 @@ -#include "bind_mfd_verification.h" +#include "mfd/bind_mfd_verification.h" #include #include @@ -7,9 +7,7 @@ #include "algorithms/metric/verification_algorithms.h" #include "py_util/bind_primitive.h" -namespace { namespace py = pybind11; -} // namespace namespace python_bindings { void BindMfdVerification(py::module_& main_module) { diff --git a/src/python_bindings/od/bind_od.cpp b/src/python_bindings/od/bind_od.cpp index e72dae89cb..167e8e598c 100644 --- a/src/python_bindings/od/bind_od.cpp +++ b/src/python_bindings/od/bind_od.cpp @@ -1,4 +1,4 @@ -#include "bind_od.h" +#include "od/bind_od.h" #include #include diff --git a/src/python_bindings/py_util/bind_primitive.h b/src/python_bindings/py_util/bind_primitive.h index fb5a5f38a7..5d4625b39c 100644 --- a/src/python_bindings/py_util/bind_primitive.h +++ b/src/python_bindings/py_util/bind_primitive.h @@ -2,7 +2,11 @@ #include #include +#include +#include +#include #include +#include #include diff --git a/src/python_bindings/py_util/create_dataframe_reader.cpp b/src/python_bindings/py_util/create_dataframe_reader.cpp index ce9e4c8127..41e5c05595 100644 --- a/src/python_bindings/py_util/create_dataframe_reader.cpp +++ b/src/python_bindings/py_util/create_dataframe_reader.cpp @@ -1,4 +1,7 @@ -#include "create_dataframe_reader.h" +#include "py_util/create_dataframe_reader.h" + +#include +#include #include "config/exceptions.h" #include "py_util/dataframe_reader.h" diff --git a/src/python_bindings/py_util/create_dataframe_reader.h b/src/python_bindings/py_util/create_dataframe_reader.h index 705a57be0c..f9a7e6259a 100644 --- a/src/python_bindings/py_util/create_dataframe_reader.h +++ b/src/python_bindings/py_util/create_dataframe_reader.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include "config/tabular_data/input_table_type.h" diff --git a/src/python_bindings/py_util/dataframe_reader.cpp b/src/python_bindings/py_util/dataframe_reader.cpp index 3013df0b57..33aa892a11 100644 --- a/src/python_bindings/py_util/dataframe_reader.cpp +++ b/src/python_bindings/py_util/dataframe_reader.cpp @@ -1,5 +1,6 @@ -#include "dataframe_reader.h" +#include "py_util/dataframe_reader.h" +#include #include #include #include diff --git a/src/python_bindings/py_util/dataframe_reader.h b/src/python_bindings/py_util/dataframe_reader.h index 00526305ba..2567959fb4 100644 --- a/src/python_bindings/py_util/dataframe_reader.h +++ b/src/python_bindings/py_util/dataframe_reader.h @@ -1,5 +1,10 @@ #pragma once +#include +#include +#include +#include + #include #include "model/table/idataset_stream.h" diff --git a/src/python_bindings/py_util/get_py_type.cpp b/src/python_bindings/py_util/get_py_type.cpp index 5255d7e59d..1461a81bda 100644 --- a/src/python_bindings/py_util/get_py_type.cpp +++ b/src/python_bindings/py_util/get_py_type.cpp @@ -1,4 +1,4 @@ -#include "get_py_type.h" +#include "py_util/get_py_type.h" #include #include @@ -6,6 +6,7 @@ #include #include +#include #include #include "algorithms/cfd/enums.h" diff --git a/src/python_bindings/py_util/opt_to_py.cpp b/src/python_bindings/py_util/opt_to_py.cpp index 71ba870752..3c9b39593a 100644 --- a/src/python_bindings/py_util/opt_to_py.cpp +++ b/src/python_bindings/py_util/opt_to_py.cpp @@ -1,9 +1,13 @@ -#include "opt_to_py.h" +#include "py_util/opt_to_py.h" #include +#include #include #include +#include +#include +#include #include #include "algorithms/metric/enums.h" @@ -14,8 +18,9 @@ #include "config/max_lhs/type.h" #include "config/thread_number/type.h" -namespace { namespace py = pybind11; + +namespace { using ConvFunction = std::function; template diff --git a/src/python_bindings/py_util/py_to_any.cpp b/src/python_bindings/py_util/py_to_any.cpp index d8eb12e923..88cf249262 100644 --- a/src/python_bindings/py_util/py_to_any.cpp +++ b/src/python_bindings/py_util/py_to_any.cpp @@ -1,5 +1,12 @@ +#include "py_util/py_to_any.h" + #include +#include +#include +#include +#include #include +#include #include #include @@ -19,9 +26,9 @@ #include "py_util/create_dataframe_reader.h" #include "util/enum_to_available_values.h" -namespace { - namespace py = pybind11; + +namespace { using ConvFunc = std::function; template diff --git a/src/python_bindings/py_util/py_to_any.h b/src/python_bindings/py_util/py_to_any.h index 3eece098ec..579cb49a05 100644 --- a/src/python_bindings/py_util/py_to_any.h +++ b/src/python_bindings/py_util/py_to_any.h @@ -1,5 +1,8 @@ #pragma once +#include +#include + #include #include diff --git a/src/python_bindings/statistics/bind_statistics.cpp b/src/python_bindings/statistics/bind_statistics.cpp index 5a23403be0..62846dd6da 100644 --- a/src/python_bindings/statistics/bind_statistics.cpp +++ b/src/python_bindings/statistics/bind_statistics.cpp @@ -1,14 +1,19 @@ -#include "bind_statistics.h" +#include "statistics/bind_statistics.h" +#include +#include + +#include #include #include #include "algorithms/statistics/data_stats.h" +#include "algorithms/statistics/statistic.h" +#include "model/types/builtin.h" +#include "model/types/type.h" #include "py_util/bind_primitive.h" -namespace { namespace py = pybind11; -} // namespace namespace PYBIND11_NAMESPACE { namespace detail { diff --git a/src/python_bindings/ucc/bind_ucc.cpp b/src/python_bindings/ucc/bind_ucc.cpp index f565f24b52..50b2b90379 100644 --- a/src/python_bindings/ucc/bind_ucc.cpp +++ b/src/python_bindings/ucc/bind_ucc.cpp @@ -1,4 +1,4 @@ -#include "bind_ucc.h" +#include "ucc/bind_ucc.h" #include #include @@ -9,10 +9,8 @@ #include "py_util/bind_primitive.h" #include "util/bitset_utils.h" -namespace { namespace py = pybind11; using model::UCC; -} // namespace namespace python_bindings { void BindUcc(py::module_& main_module) { diff --git a/src/python_bindings/ucc/bind_ucc_verification.cpp b/src/python_bindings/ucc/bind_ucc_verification.cpp index e7e8646a7a..95013f2dbc 100644 --- a/src/python_bindings/ucc/bind_ucc_verification.cpp +++ b/src/python_bindings/ucc/bind_ucc_verification.cpp @@ -1,4 +1,4 @@ -#include "bind_ucc_verification.h" +#include "ucc/bind_ucc_verification.h" #include #include @@ -6,9 +6,7 @@ #include "algorithms/ucc/verification_algorithms.h" #include "py_util/bind_primitive.h" -namespace { namespace py = pybind11; -} // namespace namespace python_bindings { void BindUccVerification(pybind11::module_& main_module) { @@ -22,6 +20,8 @@ void BindUccVerification(pybind11::module_& main_module) { .def("get_num_rows_violating_ucc", &UCCVerifier::GetNumRowsViolatingUCC) .def("get_clusters_violating_ucc", &UCCVerifier::GetClustersViolatingUCC) .def("get_error", &UCCVerifier::GetError); + // Create AUCC verification module alias. We currently consider UCC verification and AUCC + // verification to be the same. main_module.attr("aucc_verification") = ucc_verification_module; } } // namespace python_bindings