[pyAgrum] doc improvements (following guidelines)

parent af5df83a
Pipeline #20438984 passed with stages
in 63 minutes and 59 seconds
......@@ -151,7 +151,7 @@ namespace gum {
* @param card The cardinality of the variable
* @return The \c NodeId of the variable in the network
*/
NodeId addNode(const std::string& name, const Size& card);
NodeId addVariable(const std::string& name, const Size& card);
/**
* @brief Adds an arc between two nodes.
......
......@@ -37,8 +37,8 @@ namespace gum {
}
template < typename GUM_SCALAR >
NodeId CredalNet< GUM_SCALAR >::addNode(const std::string& name,
const Size& card) {
NodeId CredalNet< GUM_SCALAR >::addVariable(const std::string& name,
const Size& card) {
LabelizedVariable var(name, "node " + name, card);
NodeId a = __src_bn.add(var);
......@@ -46,11 +46,11 @@ namespace gum {
NodeId c = __src_bn_max.add(var);
if (a != b || a != c /*|| b != c*/)
GUM_ERROR(
OperationNotAllowed,
"addNodeWithId : not the same id over all networks : " << a << ", " << b
<< ", "
<< c);
GUM_ERROR(OperationNotAllowed,
"addVariable : not the same id over all networks : " << a << ", "
<< b
<< ", "
<< c);
return a;
}
......
......@@ -271,7 +271,7 @@ namespace gum_tests {
TS_ASSERT_EQUALS(v[i], i)
for (int i = 0; i < 5; i++)
nodeset.eraseNode(2+i*19);
nodeset.eraseNode(2 + i * 19);
nodeset.addNodes(5);
......
......@@ -343,7 +343,7 @@ namespace gum_tests {
gum::Instantiation j;
TS_ASSERT_DIFFERS(i1, j);
j.inc(); // j is in overflow
j.inc(); // j is in overflow
TS_ASSERT_EQUALS(i1, j); // both are in overflow => equals
}
......
......@@ -109,9 +109,9 @@ namespace gum_tests {
initCNet();
std::vector< gum::NodeId > ids;
ids.push_back(cn->addNode("A", 3)); // id 0
ids.push_back(cn->addNode("B", 3)); // id 1
ids.push_back(cn->addNode("C", 3)); // id 2
ids.push_back(cn->addVariable("A", 3)); // id 0
ids.push_back(cn->addVariable("B", 3)); // id 1
ids.push_back(cn->addVariable("C", 3)); // id 2
TS_ASSERT_EQUALS(ids[0], 0U);
TS_ASSERT_EQUALS(ids[1], 1U);
......
......@@ -9,3 +9,4 @@ For Windows
How to document
===============
http://www.sphinx-doc.org/en/stable/ext/example_numpy.html#example-numpy
https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
......@@ -425,6 +425,27 @@ gum.NotFound
If no variable matches id.
"
%feature("docstring") gum::BayesNet::changeVariableLabel
"
change the label of the variable associated to nodeId to the new value.
Parameters
----------
id : int
the id of the node
name : str
the name of the variable
old_label : str
the new label
new_label : str
the new label
Raises
------
gum.NotFound
if id/name is not a variable or if old_label does not exist.
"
%feature("docstring") gum::BayesNet::endTopologyTransformation
"
Terminates a sequence of insertions/deletions of arcs by adjusting all CPTs dimensions.
......
......@@ -325,6 +325,21 @@ Use this method when using a single BayesNet storing counts of events. Lagrange
Doest not performs computations of the parameters but keeps normalized counts of events only. Call idmLearning to compute the probabilities (with any parameter value).
"
%feature("docstring") gum::credal::CredalNet::addVariable
"
Parameters
----------
name : str
the name of the new variable
card: int
the domainSize of the new variable
Returns
-------
int
the id of the new node
"
%feature("docstring") gum::credal::CredalNet::nodeType
"
Parameters
......
......@@ -4,6 +4,7 @@
%ignore gum::DAG::eraseParents;
%ignore gum::DAG::existsArc;
%ignore gum::DAG::ids;
%ignore gum::DAG::nodes;
%ignore gum::DAG::sizeArcs;
%feature("docstring") gum::DAG
......@@ -38,4 +39,4 @@ gum.InvalidDirectedCircle
If any (directed) cycle is created by this arc
gum.InvalidNode
If head or tail does not belong to the graph nodes
"
\ No newline at end of file
"
......@@ -183,6 +183,14 @@ gum.IndexError
If the graph does not contain the variable
"
%feature("docstring") gum::DAGmodel::nodes
"
Returns
-------
set
the set of ids
"
%feature("docstring") gum::DAGmodel::variable
"
Parameters
......
......@@ -31,7 +31,7 @@ gum.InvalidNode
If head or tail does not belong to the graph nodes.
"
%feature("docstring") gum::DiGraph::addNodeWithId
%feature("docstring") gum::DiGraph::addNode
"
Returns
-------
......@@ -39,6 +39,21 @@ int
the new NodeId
"
%feature("docstring") gum::DiGraph::addNodes
"
Add n nodes.
Parameters
----------
n : int
the number of nodes to add.
Returns
-------
Set of int
the new ids
"
%feature("docstring") gum::DiGraph::addNodeWithId
"
Add a node by choosing a new NodeId.
......@@ -175,10 +190,16 @@ bool
%feature("docstring") gum::DiGraph::ids
"
.. note:: Deprecated in pyAgrum>0.13.0
Please use nodes() instead
"
%feature("docstring") gum::DiGraph::nodes
"
Returns
-------
List
the list of ids
set
the set of ids
"
%feature("docstring") gum::DiGraph::parents
......
......@@ -153,10 +153,16 @@ Set
%feature("docstring") gum::IBayesNet::ids
"
.. note:: Deprecated in pyAgrum>0.13.0
Please use nodes() instead
"
%feature("docstring") gum::IBayesNet::nodes
"
Returns
-------
list :
The list variables ids.
set
the set of ids
"
%feature("docstring") gum::IBayesNet::names
......@@ -184,4 +190,4 @@ Returns
-------
Set
The minimal set of variables
"
\ No newline at end of file
"
......@@ -309,10 +309,16 @@ gum.NotFound
%feature("docstring") gum::InfluenceDiagram::ids
"
.. note:: Deprecated in pyAgrum>0.13.0
Please use nodes() instead
"
%feature("docstring") gum::InfluenceDiagram::nodes
"
Returns
-------
list
The list variables ids.
set
the set of ids
"
%feature("docstring") gum::InfluenceDiagram::isChanceNode
......
......@@ -75,6 +75,14 @@ List
the list of the arcs
"
%feature("docstring") gum::MarkovBlanket::nodes
"
Returns
-------
set
the set of ids
"
%feature("docstring") gum::MarkovBlanket::size
"
Returns
......@@ -102,4 +110,4 @@ Returns
-------
bool
True if all the named node are the same and all the named arcs are the same
"
\ No newline at end of file
"
%ignore gum::MixedGraph::addArc;
%ignore gum::MixedGraph::addEdge;
%ignore gum::MixedGraph::addNodeWithId;
%ignore gum::MixedGraph::addNode;
%ignore gum::MixedGraph::addNodes;
%ignore gum::MixedGraph::addNodeWithId;
%ignore gum::MixedGraph::empty;
%ignore gum::MixedGraph::emptyArcs;
......
......@@ -31,7 +31,7 @@ gum.InvalidNode
If n1 or n2 does not belong to the graph nodes.
"
%feature("docstring") gum::UndiGraph::addNodeWithId
%feature("docstring") gum::UndiGraph::addNode
"
Returns
-------
......@@ -39,6 +39,21 @@ int
the new NodeId
"
%feature("docstring") gum::UndiGraph::addNodes
"
Add n nodes.
Parameters
----------
n : int
the number of nodes to add.
Returns
-------
Set of int
the new ids
"
%feature("docstring") gum::UndiGraph::addNodeWithId
"
Add a node by choosing a new NodeId.
......@@ -163,12 +178,19 @@ bool
%feature("docstring") gum::UndiGraph::ids
"
.. note:: Deprecated in pyAgrum>0.13.0
Please use nodes() instead
"
%feature("docstring") gum::UndiGraph::nodes
"
Returns
-------
List
the list of ids
set
the set of ids
"
%feature("docstring") gum::UndiGraph::neighbours
"
Parameters
......
......@@ -75,7 +75,7 @@ master_doc = 'index'
# General information about the project.
project = 'pyAgrum'
copyright = '2017, aGrUM/pyAgrum Team'
copyright = '2018, aGrUM/pyAgrum Team'
author = 'Pierre-henri Wuillemin'
# The version info for the project you're documenting, acts as replacement for
......@@ -154,13 +154,16 @@ todo_include_todos = True
# a list of builtin themes.
#
# html_theme = 'alabaster'
html_theme = 'classic'
html_theme_options = {
"rightsidebar": "true",
"rightsidebar": "false",
"stickysidebar" :"true",
"relbarbgcolor": "black"
}
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
......@@ -575,4 +578,4 @@ def setup(app):
app.add_config_value('googleanalytics_id', '', 'html')
app.add_config_value('googleanalytics_enabled', True, 'html')
app.connect('html-page-context', add_ga_javascript)
app.connect('builder-inited', check_config)
\ No newline at end of file
app.connect('builder-inited', check_config)
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
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