From d2368727a174387599768cf0b99947a1cf0d3def Mon Sep 17 00:00:00 2001
From: idealbuq <iryna.dealbuquerquesilva@cea.fr>
Date: Fri, 27 Sep 2024 15:50:37 +0000
Subject: [PATCH] Added minor corrections required in MR 211 review

---
 aidge_core/show_graphview.py | 26 ++++++++------------------
 1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/aidge_core/show_graphview.py b/aidge_core/show_graphview.py
index f63586439..9fcde5573 100644
--- a/aidge_core/show_graphview.py
+++ b/aidge_core/show_graphview.py
@@ -96,9 +96,9 @@ def create_dict(sorted_nodes : list[aidge_core.Node], write_trainable_params_ext
     :type write_trainable_params_ext: bool
     :param write_trainable_params_embed: Whether or not to write the eventual trainable parameters of the Nodes in the same file as the dict (embed). 
     :type write_trainable_params_embed: bool
-    :param params_file_format: Format of the external file used to store the Nodes' trainable parameters. Options: 'npz' or 'json'.
+    :param params_file_format: Format of the external file used to store the Nodes' trainable parameters. Options: ``npz`` or ``json``.
     :type params_file_format: str
-    :param path_trainable_params: Path of the external file used to store the Nodes' trainable parameters. Options: 'npz' or 'json'.
+    :param path_trainable_params: Path of the external file used to store the Nodes' trainable parameters.
     :type path_trainable_params: str
     
     :return: A dictionary with the GraphView description.
@@ -165,7 +165,7 @@ def create_dict(sorted_nodes : list[aidge_core.Node], write_trainable_params_ext
         
             # Check if my node is a metaop
             attributes_dict = {}
-            if hasattr(node.get_operator(), 'get_micro_graph'):
+            if isinstance(node.get_operator(), aidge_core.MetaOperator_Op):
                     attributes_dict['micro_graph'] = []
                     for micro_node in node.get_operator().get_micro_graph().get_nodes():
                         micro_node_dict = {'name' : micro_node.name(), 
@@ -239,13 +239,11 @@ def gview_to_json(gview : aidge_core.GraphView, json_path : str, write_trainable
     :param json_path: Path to write JSON file.
     :type json_path: str
     :param write_trainable_params_ext: Whether or not to write the eventual trainable parameters of the Nodes in an external file. 
-    :type write_trainable_params_ext: bool
+    :type write_trainable_params_ext: bool, optional
     :param write_trainable_params_embed: Whether or not to write the eventual trainable parameters of the Nodes in the same file as the dict (embed). 
-    :type write_trainable_params_embed: bool
-    :param params_file_format: Format of the external file used to store the Nodes' trainable parameters. Options: 'npz' or 'json'.
-    :type params_file_format: str
-    :param path_trainable_params: Path of the external file used to store the Nodes' trainable parameters. Options: 'npz' or 'json'.
-    :type path_trainable_params: str
+    :type write_trainable_params_embed: bool, optional
+    :param params_file_format: Format of the external file used to store the Nodes' trainable parameters. Options: ``npz`` or ``json``. Default = ``json``. Requires ``write_trainable_params_ext``.
+    :type params_file_format: str, optional
     """
 
 
@@ -266,12 +264,4 @@ def gview_to_json(gview : aidge_core.GraphView, json_path : str, write_trainable
     # Write dict to json
     write_dict_json(graphview_dict, json_path)
         
-    return None
-
-
-   
-        
-
-
-
-
+    return None
\ No newline at end of file
-- 
GitLab