uni-courses / snncompare

Runs networkx graphs representing spiking neural networks of LIF-neurons on lava-nc or networkx.
GNU Affero General Public License v3.0
2 stars 0 forks source link

A current issue is that the graph loader does not work because some graphs are in a list. #64

Closed a-t-0 closed 2 years ago

a-t-0 commented 2 years ago

In Output.py, the following lines create a list of simulated graphs for stage 2:

  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:

a-t-0 commented 2 years ago

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