Skip to content

Resolve "load graph: more flexible submodel discovery"

Closes #25 (closed)

Suppose you have a graph and a sub graph:

/path/to/graphs/mygraphfilename.json
/path/to/graphs/mysubmodelfilename.json

Before this MR

The subgraph needs to be specified in the super graph like this:

{"id": "node2", "task_type": "graph", "task_identifier": "mysubmodelfilename.json"}

Then the graph can be loaded like this

load_graph(source="mygraphfilename.json", root_dir="/path/to/graphs")

After this MR

The subgraph can be specified without extension:

{"id": "node1", "task_type": "graph", "task_identifier": "mysubmodelfilename"}

Loading can also be done without extension

load_graph(source="mygraphfilename", root_dir="/path/to/graphs")

Non-json file format

If you have another file format

/path/to/graphs/mygraphfilename.yaml
/path/to/graphs/mysubmodelfilename.yaml

you can do this

load_graph(source="mygraphfilename", representation="yaml", root_dir="/path/to/graphs")

without changing "task_identifier": "mysubmodelfilename"

Edited by Wout De Nolf

Merge request reports

Loading