src/DSGRN/SaveDatabaseJSON.py
def state_transition_graph_json(network, domain_graph):
    """Return json data for state transiton graph."""
    # Get a mapping from DSGRN top cells to cc top cells
    cell2cc_cell = dsgrn_cell_to_cc_cell_map(network)
    # Get state transition graph vertices
    stg_vertices = range(domain_graph.digraph().size())
    stg = [] # State transition graph
    for v in stg_vertices:
        adjacencies = [cell2cc_cell[u] for u in domain_graph.digraph().adjacencies(v)]
        node_adjacency_data = {"node" : cell2cc_cell[v], "adjacencies" : adjacencies}
        stg.append(node_adjacency_data)
    stg_json_data = {"stg" : stg}
    return stg_json_data
Return json data for state transiton graph.
Return json data for state transiton graph.
Return json data for state transiton graph .
def state_transition_graph_json(network, domain_graph):
    cell2cc_cell = dsgrn_cell_to_cc_cell_map(network)
    stg_vertices = range(domain_graph.digraph().size())
    stg = [] 
    for v in stg_vertices:
        adjacencies = [cell2cc_cell[u] for u in domain_graph.digraph().adjacencies(v)]
        node_adjacency_data = {"node" : cell2cc_cell[v], "adjacencies" : adjacencies}
        stg.append(node_adjacency_data)
    stg_json_data = {"stg" : stg}
    return stg_json_data
def state_transition_graph_json ( network , domain_graph ) : cell2cc_cell = dsgrn_cell_to_cc_cell_map ( network ) stg_vertices = range ( domain_graph . digraph ( ) . size ( ) ) stg = [ ] for v in stg_vertices : adjacencies = [ cell2cc_cell [ u ] for u in domain_graph . digraph ( ) . adjacencies ( v ) ] node_adjacency_data = { "node" : cell2cc_cell [ v ] , "adjacencies" : adjacencies } stg . append ( node_adjacency_data ) stg_json_data = { "stg" : stg } return stg_json_data
Return json data for state transiton graph.
Return json data for state transiton graph .
"""Return json data for state transiton graph.""" # Get a mapping from DSGRN top cells to cc top cells # Get state transition graph vertices # State transition graph
network
domain_graph