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

back to graphview

parent 65650935
No related branches found
No related tags found
No related merge requests found
......@@ -30,17 +30,80 @@ void init_GraphView(py::module& m) {
:param path: save location
:type path: str
)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("in_view", (bool (GraphView::*)(const NodePtr&) const) &GraphView::inView)
.def("in_view", (bool (GraphView::*)(const std::string&) const) &GraphView::inView)
.def("root_node", &GraphView::rootNode)
.def("set_root_node", &GraphView::setRootNode, py::arg("node"))
.def("__repr__", &GraphView::repr)
.def("__len__", [](const GraphView& g){ return g.getNodes().size(); })
.def("log_outputs", &GraphView::logOutputs, py::arg("path"))
.def("get_ordered_inputs", &GraphView::getOrderedInputs)
.def("get_ordered_outputs", &GraphView::getOrderedOutputs)
.def("inputs", (std::vector<std::pair<NodePtr, IOIndex_t>> (GraphView::*)() const) &GraphView::inputs,
R"mydelimiter(
List outside input connections of the GraphView.
The vector size is guaranteed to match the number of outside inputs of the GraphView.
If there is no external connection to a given input, a pair of nullptr and gk_IODefaultIndex is returned.
:return: A list containing the pairs Node, input indexes.
:rtype: List[Node, int]
)mydelimiter")
.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,
R"mydelimiter(
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