Closed a-t-0 closed 2 years ago
In Output.py, the following lines create a list of simulated graphs for stage 2:
Output.py
elif stage_index == 2: graphs_per_type = [] if isinstance(graph_container, (nx.DiGraph, nx.Graph)): graphs_per_type.append(digraph_to_json(graph_container)) elif isinstance(graph_container, List): for graph in graph_container: graphs_per_type.append(digraph_to_json(graph)) else: raise Exception( f"Error, unsupported type:{type(graph_container)}"
This then yields an error, in case the json file is read back because that expects a graph instead of a list of graphs.
Quick fix:
def sim_graphs( stage_1_graphs: dict, run_config: dict, ) -> dict:
function, to not output a list of graph, instead, output 1 graph with all the simulations over time. https://github.com/a-t-0/Networkx-To-Lava-NC/issues/60
The current code overwrites the graphs dict for everystage, yielding empty graphs for stage 1 at stage 2. So make them load the previous stages every time, in: load_pre_existing_graph_dict
load_pre_existing_graph_dict
In
Output.py
, the following lines create a list of simulated graphs for stage 2:This then yields an error, in case the json file is read back because that expects a graph instead of a list of graphs.
Quick fix:
function, to not output a list of graph, instead, output 1 graph with all the simulations over time. https://github.com/a-t-0/Networkx-To-Lava-NC/issues/60