Skip to content
Snippets Groups Projects
Commit cf6aff09 authored by Octave Perrin's avatar Octave Perrin
Browse files

back to graphview

parent 2c94e087
No related branches found
No related tags found
1 merge request!245aidge_core#194: Add documentation for GraphView
...@@ -30,17 +30,80 @@ void init_GraphView(py::module& m) { ...@@ -30,17 +30,80 @@ void init_GraphView(py::module& m) {
:param path: save location :param path: save location
:type path: str :type path: str
)mydelimiter") )mydelimiter")
.def("inputs", (std::vector<std::pair<NodePtr, IOIndex_t>> (GraphView::*)() const) &GraphView::inputs)
.def("outputs", (std::vector<std::vector<std::pair<NodePtr, IOIndex_t>>> (GraphView::*)() const) &GraphView::outputs) .def("inputs", (std::vector<std::pair<NodePtr, IOIndex_t>> (GraphView::*)() const) &GraphView::inputs,
.def("in_view", (bool (GraphView::*)(const NodePtr&) const) &GraphView::inView) R"mydelimiter(
.def("in_view", (bool (GraphView::*)(const std::string&) const) &GraphView::inView) List outside input connections of the GraphView.
.def("root_node", &GraphView::rootNode) The vector size is guaranteed to match the number of outside inputs of the GraphView.
.def("set_root_node", &GraphView::setRootNode, py::arg("node")) If there is no external connection to a given input, a pair of nullptr and gk_IODefaultIndex is returned.
.def("__repr__", &GraphView::repr) :return: A list containing the pairs Node, input indexes.
.def("__len__", [](const GraphView& g){ return g.getNodes().size(); }) :rtype: List[Node, int]
.def("log_outputs", &GraphView::logOutputs, py::arg("path")) )mydelimiter")
.def("get_ordered_inputs", &GraphView::getOrderedInputs)
.def("get_ordered_outputs", &GraphView::getOrderedOutputs) .def("outputs", (std::vector<std::vector<std::pair<NodePtr, IOIndex_t>>> (GraphView::*)() const) &GraphView::outputs,
R"mydelimiter(
List outside output connections of the GraphView.
The vector size is guaranteed to match the number of outputs of the GraphView.
If there is no connection to a given output, the corresponding sub-vector will be empty.
:return: A list containing the pairs Node, output indexes.
:rtype: List[Node, int]
)mydelimiter")
.def("in_view", (bool (GraphView::*)(const NodePtr&) const) &GraphView::inView,
R"mydelimiter(
Check that a node is in the current GraphView.
:param NodePtr: The Node that is checked
:type Node: Node that is checked
:return: True if the Node is in the GraphView, False otherwise
:rtype: bool
)mydelimiter")
.def("in_view", (bool (GraphView::*)(const std::string&) const) &GraphView::inView,
R"mydelimiter(
Check that a node is in the current GraphView based on its name.
:param nodeName: The name of the Node that is checked
:type nodeName: Node
:return: True if the Node is in the GraphView, False otherwise
:rtype: bool
)mydelimiter")
.def("root_node", &GraphView::rootNode,
R"mydelimiter(
Returns the rootNode of the GraphView
:return: The root Node of the GraphView
:rtype: Node
)mydelimiter")
.def("set_root_node", &GraphView::setRootNode, py::arg("node"),
R"mydelimiter(
TODO
)mydelimiter")
.def("__repr__", &GraphView::repr,
R"mydelimiter(
TODO
)mydelimiter")
.def("__len__", [](const GraphView& g){ return g.getNodes().size(); },
R"mydelimiter(
TODO
)mydelimiter")
.def("log_outputs", &GraphView::logOutputs, py::arg("path"),
R"mydelimiter(
TODO
)mydelimiter")
.def("get_ordered_inputs", &GraphView::getOrderedInputs,
R"mydelimiter(
TODO
)mydelimiter")
.def("get_ordered_outputs", &GraphView::getOrderedOutputs,
R"mydelimiter(
TODO
)mydelimiter")
.def("get_output_nodes", &GraphView::outputNodes, .def("get_output_nodes", &GraphView::outputNodes,
R"mydelimiter( R"mydelimiter(
Get set of output Nodes. Get set of output Nodes.
......
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