WIP : doc for pyAgrum in progress + remove 'using' in wrappers/swig/*

parent e66d4a79
%feature("docstring") gum::DiGraph
"
DiGraph represents a Directed Graph.
Available constructors:
`DiGraph() -> DiGraph`
`DiGraph(src) -> DiGraph`
Parameters
----------
src : :class: DiGraph
the digraph to copy
"
%feature("docstring") gum::DiGraph::ids
%feature("docstring") gum::DiGraph::addNode
"
FOO BAR
Add a node by choosing a new NodeId
Returns
-------
int
the new NodeId
"
%feature("docstring") gum::DiGraph::addNode
%feature("docstring") gum::DiGraph::existsNode
"
FOO BAR
Check if a node with a certain id exists in the graph.
Parameters
----------
id : int
the checked id
Returns
-------
bool
True if the node exists
"
%feature("docstring") gum::DiGraph::ids
"
Returns
-------
List
the list of ids
"
......@@ -458,8 +458,8 @@ epub_exclude_files = ['search.html']
# epub_use_index = True
autodoc_member_order = 'bysource'
autoclass_content = 'both'
autodoc_member_order = 'alphabetically'
autoclass_content = 'class'
autodoc_default_flags = ['members',
#'private-members',
......
......@@ -6,6 +6,7 @@ interface generator."
%enddef
%module(docstring=DOCSTRING, directors="1") pyAgrum
%feature("autodoc", "0");
%include "docs.i"
#pragma SWIG nowarn=341,342 // The 'using' keyword in type aliasing is not fully supported yet.
#pragma SWIG nowarn=320 // Explicit template instantiation ignored.
......@@ -26,7 +27,6 @@ interface generator."
%pythoncode %{
import numpy
%}
%include "docs.i"
//////////////////////////////////////////////////////////////////
/* declaration of code modifiers for 'pythonification' of aGrUM */
......
......@@ -139,48 +139,6 @@ namespace std {
}
}
%define ADD_NODEGRAPHPART_API(classname)
%extend classname {
using gum::NodeGraphPart::addNode;
using gum::NodeGraphPart::existsNode;
using gum::NodeGraphPart::size;
using gum::NodeGraphPart::empty;
}
%enddef
ADD_NODEGRAPHPART_API(gum::DiGraph)
ADD_NODEGRAPHPART_API(gum::UndiGraph)
ADD_NODEGRAPHPART_API(gum::MixedGraph)
%define ADD_EDGEGRAPHPART_API(classname)
%extend classname {
using gum::EdgeGraphPart::addEdge;
using gum::EdgeGraphPart::eraseEdge;
using gum::EdgeGraphPart::existsEdge;
using gum::EdgeGraphPart::eraseParents;
using gum::EdgeGraphPart::eraseChildren;
using gum::EdgeGraphPart::sizeEdges;
using gum::EdgeGraphPart::emptyEdges;
using gum::EdgeGraphPart::eraseNeighbours;
}
%enddef
ADD_EDGEGRAPHPART_API(gum::UndiGraph)
ADD_EDGEGRAPHPART_API(gum::MixedGraph)
%define ADD_ARCGRAPHPART_API(classname)
%extend classname {
using gum::ArcGraphPart::addArc;
using gum::ArcGraphPart::eraseArc;
using gum::ArcGraphPart::existsArc;
using gum::ArcGraphPart::eraseParents;
using gum::ArcGraphPart::eraseChildren;
using gum::ArcGraphPart::sizeArcs;
using gum::ArcGraphPart::emptyArcs;
}
%enddef
ADD_ARCGRAPHPART_API(gum::DiGraph);
ADD_ARCGRAPHPART_API(gum::MixedGraph);
%define ADD_APPROXIMATIONSCHEME_API(parent,classname)
%extend classname {
......
// this file is for giving access to methods defined in template ancestror.
// SWIG does not allow to use "using" for this kind of methods.
// this file is for giving access to methods defined in ancestor.
#####################################
%define ADD_NODEGRAPHPART_API(classname)
%extend classname {
gum::NodeId addNode() {
return self->gum::NodeGraphPart::addNode();
}
void addNodeWithId(const gum::NodeId id) {
self->gum::NodeGraphPart::addNode(id);
}
bool existsNode(const gum::NodeId id) const {
return self->gum::NodeGraphPart::existsNode(id);
}
gum::Size size() const {
return self->gum::NodeGraphPart::size();
}
bool empty() const {
return self->gum::NodeGraphPart::empty();
}
}
%enddef
ADD_NODEGRAPHPART_API(gum::DiGraph)
ADD_ARCGRAPHPART_API(gum::DAG);
ADD_NODEGRAPHPART_API(gum::UndiGraph)
ADD_NODEGRAPHPART_API(gum::MixedGraph)
%define ADD_EDGEGRAPHPART_API(classname)
%extend classname {
void addEdge(const NodeId n1,const NodeId n2) {
self->gum::EdgeGraphPart::addEdge(n1,n2);
}
void eraseEdge(const NodeId n1,const NodeId n2) {
self->gum::EdgeGraphPart::eraseEdge(gum::Edge(n1,n2));
}
bool existsEdge(const NodeId n1, const NodeId n2) const {
return self->gum::EdgeGraphPart::existsEdge(n1,n2);
}
gum::Size sizeEdges() const {
return self->gum::EdgeGraphPart::sizeEdges();
}
bool emptyEdges() const {
return self->gum::EdgeGraphPart::emptyEdges();
}
void eraseNeighbours(const gum::NodeId n) {
self->gum::EdgeGraphPart::eraseNeighbours(n);
}
}
%enddef
ADD_EDGEGRAPHPART_API(gum::UndiGraph)
ADD_EDGEGRAPHPART_API(gum::MixedGraph)
%define ADD_ARCGRAPHPART_API(classname)
%extend classname {
void addArc(const gum::NodeId n1,const gum::NodeId n2) {
self->gum::ArcGraphPart::addArc(n1,n2);
}
void eraseArc(const gum::NodeId n1,const gum::NodeId n2) {
self->gum::ArcGraphPart::eraseArc(gum::Arc(n1,n2));
}
bool existsArc(const gum::NodeId n1,const gum::NodeId n2) const {
return self->gum::ArcGraphPart::existsArc(n1,n2);
}
void eraseParents(const gum::NodeId n) {
self->gum::ArcGraphPart::eraseParents(n);
}
void eraseChildren(const gum::NodeId n) {
self->gum::ArcGraphPart::eraseChildren(n);
}
gum::Size sizeArcs() const {
return self->gum::ArcGraphPart::sizeArcs();
}
bool emptyArcs() const {
return self->gum::ArcGraphPart::emptyArcs();
}
}
%enddef
ADD_ARCGRAPHPART_API(gum::DiGraph);
ADD_ARCGRAPHPART_API(gum::DAG);
ADD_ARCGRAPHPART_API(gum::MixedGraph);
#####################################
%define ADD_MULTIDIMDECORATOR_API(classname)
%extend classname {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment