From dd21cc87bff236763aca60f5cbf67db879ea7d5a Mon Sep 17 00:00:00 2001 From: Octave Perrin <operrin@lrtechnologies.fr> Date: Thu, 5 Dec 2024 09:21:10 +0100 Subject: [PATCH] clean of todos --- include/aidge/graph/GraphView.hpp | 19 ++++++++----------- src/graph/GraphView.cpp | 4 ++-- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/include/aidge/graph/GraphView.hpp b/include/aidge/graph/GraphView.hpp index cc9e8d1ab..b9b82dc82 100644 --- a/include/aidge/graph/GraphView.hpp +++ b/include/aidge/graph/GraphView.hpp @@ -269,7 +269,6 @@ public: std::vector<std::pair<NodePtr, IOIndex_t>> inputs() const; /** - * @TODO @warning what if the node isn't found? where is the try catch of the .at? * @brief List all input connections (within and outside) of the specified GraphView node named "name". * @param string name: name of the graphView's node * @return std::vector<std::pair<NodePtr, IOIndex_t>> @@ -389,7 +388,7 @@ public: * @param NodePtr otherNode: The Node * @return std::vector<std::vector<NodePtr>> */ - std::set<NodePtr> getChildren(const NodePtr otherNode) const; // TODO change it for a vector<vector> ? + std::set<NodePtr> getChildren(const NodePtr otherNode) const; /** * @brief Get the Nodes in the GraphView. @@ -467,7 +466,7 @@ public: */ bool add(std::set<NodePtr> otherNodes, bool includeLearnableParam = true); - /** TODO: this seem broken + /** * @brief Include a set of Nodes to the current GraphView object. * if the graphView has no rootNode, the first element of the otherNodes pair is the new RootNode of the * GraphView and the second is the remaining nodes to add. @@ -524,7 +523,6 @@ public: /** //todo only updates registery with pair (newName, node) but does not ensure node's name is indeed newName in its args - // todo this shouldn't be public but a friend * @brief (from my comprehension) This function is made only to be used in Node's setName. * This method update the registry with the new Node's Name * @param std::shared_ptr<Node>& node: The Node that is updated @@ -564,7 +562,7 @@ public: std::pair<NodePtr, IOIndex_t>(nullptr, gk_IODefaultIndex)); /** - //@todo not implemented + * @warning not implemented * @brief Swap two Node instances if possible. * @param Node node: The Node to be swapped * @param Node otherNode: the other Node to be swapped with @@ -572,11 +570,12 @@ public: */ bool swap(Node &node, Node &otherNode); - //@todo not implemented + /** + * @warning not implemented + */ void link(const std::string& name1_inID, const std::string& name2_outID); /** - //@todo why some functions have separate inputs for Node and TensorID (such as here) while other put them in a pair (consistency would be nice) * @brief Insert a node (newParentNode) as a parent of the passed node (childNode) * and as a child of the current parent of the Node. * @@ -593,7 +592,6 @@ public: IOIndex_t newParentOutputTensorIdx); /** - //@todo seems messed up, imma skip it for now * @brief Replace a set of Nodes in every available GraphView with a new set of Nodes if possible. * Both sets should include all the necessary Producers. * @details There are 3 cases of replacement: @@ -644,7 +642,7 @@ public: return cloneCallback(&Node::clone); } - /** TODO: understand and reformulate (and see above clones) + /** * @brief Clone the current GraphView using a callback function for the Node cloning, allowing to specify how each * Node should be cloned or replaced by another Node type, or removed (i.e. replaced by identity). * When a Node is removed, the clone() method automatically finds the next valid parent in line, going backward in @@ -694,13 +692,12 @@ private: * inputs/outputs after adding this node. * @param nodePtr newNode: recently added Node that needs updating */ - //@todo see in code comment void updateInputsOutputsNew(NodePtr newNode); /** * @brief Automatically updates GraphView inputs/outputs with a Node removed, checking if this Node was an * input/output for the graph and if this node's children and parents become new inputs/outputs for the graph. - * @param nodePtr deletedNode: the deleted Node //todo has the node already been delettesd or not yet? if it has been, does it keep its information? if it hasn't, one must ensure to properly delete it afterward to aavoid discrepencies + * @param nodePtr deletedNode: the deleted Node */ void updateInputsOutputsDelete(NodePtr deletedNode); diff --git a/src/graph/GraphView.cpp b/src/graph/GraphView.cpp index 58949141a..072f6e13e 100644 --- a/src/graph/GraphView.cpp +++ b/src/graph/GraphView.cpp @@ -767,7 +767,7 @@ std::map<Aidge::NodePtr, std::string> Aidge::GraphView::getRankedNodesName(const std::map<std::string, size_t>::iterator it; std::tie(it, std::ignore) = typeRank.insert(std::make_pair(rankedNode->type(), 0)); - const auto name = (markNonUnicity && rank < rankedNodes.second) //if todo logic doesn't match description, to be checked, i'd say > and swap ? and : + const auto name = (markNonUnicity && rank < rankedNodes.second) //if todo logic doesn't match description, to be checked,but i'd say > and swap ? and : ? fmt::format(format, rankedNode->name(), rankedNode->type(), rank, it->second) //then : fmt::format(format, rankedNode->name(), rankedNode->type(), fmt::format("?{}", rank), fmt::format("?{}", it->second)); //else rankedNodesName.insert(std::make_pair(rankedNode, name)); @@ -1285,7 +1285,7 @@ void Aidge::GraphView::updateInputsOutputsNew(std::shared_ptr<Node> newNode) { // Check that it was not already the case (if node UPDATE) if (iter != mInputNodes.cend()) { // newNode is linked to an actual inputNode to an input connection // The first old (removed) input becomes the insertion point for newNode GraphView inputs - if (std::distance(newInputsInsertionPoint, iter) <= 0) { //todo ask for dis part + if (std::distance(newInputsInsertionPoint, iter) <= 0) { newInputsInsertionPoint = mInputNodes.erase(iter); } else { -- GitLab