From f54ee3187b4c0ff0d429116352bba5c59a1bb8ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20KUBLER?= <gregoire.kubler@proton.me>
Date: Tue, 9 Apr 2024 17:27:08 +0200
Subject: [PATCH] fix : inverted conditions on onnx2aidge_name

---
 aidge_onnx/utils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/aidge_onnx/utils.py b/aidge_onnx/utils.py
index 642488f..7a5029b 100644
--- a/aidge_onnx/utils.py
+++ b/aidge_onnx/utils.py
@@ -18,6 +18,7 @@ _MAP_NP_ONNX_TYPE = {
     }
 _MAP_ONNX_NP_TYPE = {v: k for k, v in _MAP_NP_ONNX_TYPE.items()}
 
+
 def onnx_to_aidge_model_names(model: onnx.ModelProto):
     """
     Change the name of each node of the model from onnx convention to aidge's one
@@ -63,6 +64,5 @@ def onnx_to_aidge_name(name: str) -> str:
     Translates onnx node naming convention to aidge naming convention
     """
     name = name.replace("/", "_").replace(".", "_")
-    name = name if len(name) > 0 and name[0].isdigit() else "data_" + name
+    name = name if (len(name) == 0 or not name[0].isdigit()) else "data_" + name
     return name
-
-- 
GitLab