Skip to content
Snippets Groups Projects
Commit 35daaed6 authored by Thibault Allenet's avatar Thibault Allenet
Browse files

Update pybind comments for graph matching

parent 70e06234
No related branches found
No related tags found
No related merge requests found
......@@ -20,22 +20,21 @@ void init_GRegex(py::module& m){
py::class_<GRegex, std::shared_ptr<GRegex>>(m, "GRegex", "GRegex class combines a Node Regex and a list of Graph Regex that together describes a graph pattern as a graph regular expression. GRegex find patterns in a given graph that matches the graph regular expression.")
.def(py::init<const std::map<std::string,NodeRegex*>&, std::vector<std::string>&>(), py::arg("nodesRegex"), py::arg("seqRegexps"), R"mydelimiter(
Constructor of GRegex
Parameters
----------
:param nodesRegex: Describe the conditions an operator has to fulfill. Dictionnary mapping a string (keys) to :py:class:`aidge_core.NodeRegex` (values).
:type nodesRegex: :py:class: `Dict`
:param nodesRegex: Describe the conditions an operator has to fulfill.
:type nodesRegex: Dict[str,:py:class:`aidge_core.NodeRegex`]
:param seqRegexps: Describe the graph topological pattern. List of Graph Regex as strings.
:type seqRegexps: :py:class: `list`
:type seqRegexps: List[str]
)mydelimiter")
.def("match", &GRegex::match, py::arg("graphToMatch"), R"mydelimiter(
Launch the graph matching algorithm on a given graph. Returns the matched graph patterns in a :py:class: `aidge_core.Match`.
Launch the graph matching algorithm on a given graph.
Parameters
----------
:param graphToMatch: The graph to perform the matching algorithm on.
:type graphToMatch: :py:class: `aidge_core.GraphView`
:type graphToMatch: :py:class:`aidge_core.GraphView`
:returns: Matched graph patterns.
:rtype: :py:class:`aidge_core.Match`
)mydelimiter")
;
......
......@@ -19,13 +19,16 @@ void init_Match(py::module& m){
py::class_<Match, std::shared_ptr<Match>>(m, "Match", "Match class stores the matched patterns resulting from a graph matching query. A matched pattern is the combinaison of the graph pattern start nodes and the set of all the nodes in the matched pattern (including the start nodes)")
.def(py::init<>())
.def("get_nb_match", &Match::getNbMatch, R"mydelimiter(
The number of graph patterns matched
:returns: The number of graph patterns matched
:rtype: int
)mydelimiter")
.def("get_start_nodes", &Match::getStartNodes, R"mydelimiter(
All matched graph patterns start nodes
:returns: All matched graph patterns start nodes
:rtype: List[List[:py:class:`aidge_core.Nodes`]]
)mydelimiter")
.def("get_match_nodes", &Match::getMatchNodes, R"mydelimiter(
All matched graph patterns sets of matched nodes
:returns: All matched graph patterns sets of matched nodes
:rtype: List[Set[:py:class:`aidge_core.Nodes`]]
)mydelimiter");
}
}
......@@ -15,14 +15,12 @@
namespace py = pybind11;
namespace Aidge {
void init_NodeRegex(py::module& m){
py::class_<NodeRegex, std::shared_ptr<NodeRegex>>(m, "NodeRegex", "NodeRegex class describes a condition to test on any operator. Current version only tests the type of the operator.")
py::class_<NodeRegex, std::shared_ptr<NodeRegex>>(m, "NodeRegex", "NodeRegex class describes a condition to test on any operator. Current version only supports testing the type of the operator.")
.def(py::init<const std::string>(), py::arg("condition"), R"mydelimiter(
Constructor of NodeRegex
Parameters
----------
:param condition: Condition to be fulfilled by an operator. Currently supported conditions are only the operator types.
:type condition: `string`
:param condition: Condition to be fulfilled by an operator.
:type condition: str
)mydelimiter")
;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment