forked from Desbordante/desbordante-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Python bindings for INDs (Spider and Faida)
Add Python bindings for Spider and Faida include dependency detection algorithms
- Loading branch information
1 parent
9c85c8a
commit 1fafc37
Showing
6 changed files
with
65 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "ind/bind_ind.h" | ||
|
||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
|
||
#include "algorithms/ind/ind.h" | ||
#include "algorithms/ind/ind_algorithm.h" | ||
#include "algorithms/ind/mining_algorithms.h" | ||
#include "py_util/bind_primitive.h" | ||
|
||
namespace py = pybind11; | ||
|
||
namespace python_bindings { | ||
void BindInd(py::module_& main_module) { | ||
using namespace model; | ||
|
||
auto ind_module = main_module.def_submodule("ind"); | ||
py::class_<IND>(ind_module, "IND") | ||
.def("__str__", &IND::ToString) | ||
.def("get_lhs", &IND::GetLhs) | ||
.def("get_rhs", &IND::GetRhs); | ||
|
||
using namespace algos; | ||
auto ind_algos_module = BindPrimitive<Spider, Faida>( | ||
ind_module, &INDAlgorithm::INDList, "IndAlgorithm", "get_inds", {"Spider", "Faida"}); | ||
} | ||
} // namespace python_bindings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace python_bindings { | ||
void BindInd(pybind11::module_& main_module); | ||
} // namespace python_bindings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters