Skip to content
Snippets Groups Projects

Correct logic for Node's parents/children association with inputs/outputs in aidge_core/show_graphview.py.

Merged Iryna de Albuquerque Silva requested to merge idealbuq/aidge_core:dev into dev
1 file
+ 11
7
Compare changes
  • Side-by-side
  • Inline
@@ -195,17 +195,21 @@ def gview_to_json(gview : aidge_core.GraphView, json_path : Path, write_trainabl
:type params_file_format: str, optional
"""
if json_path.is_dir():
json_path = (json_path.parent).joinpath('model.json')
if not json_path.suffix:
if not json_path.is_dir():
json_path.mkdir(parents=True, exist_ok=True)
json_path = json_path.joinpath('model.json')
elif not json_path.is_dir():
if json_path.suffix == '.json':
pass
else:
raise Exception('If ``json_path`` contains a filename it must be of JSON format.')
else:
if json_path.suffix != '.json':
raise Exception('If ``json_path`` contains a filename, it must be of JSON format.')
if not json_path.parent.is_dir():
json_path.parent.mkdir(parents=True, exist_ok=True)
if write_trainable_params_ext:
path_trainable_params = (json_path.parent).joinpath(json_path.stem + '_trainable_params/')
path_trainable_params.mkdir(parents=True, exist_ok=True)
else:
path_trainable_params = Path()
Loading