src/DSGRN/SaveDatabaseJSON.py
def dsgrn_cell_to_cc_cell_map(network):
    """Return a mapping from the top dimensional cells
    in the DSGRN complex to the top dimensional
    cells in the pychomp cubical complex.
    """

    # Construct a cubical complex using pychomp. A cubical complex in pychomp
    # does not contain the rightmost boundary, so make one extra layer of
    # cubes and ignore the last layer (called rightfringe in pychomp).
    cubical_complex = pychomp.CubicalComplex([x + 1 for x in network.domains()])
    dimension = network.size()
    # Mapping from DSGRN top cells to cc top cells
    cell2cc_cell = {}
    # DSGRN only uses the top dimensional cells to
    # construct the state transiton graph and the
    # corresponding morse sets and these cells are
    # indexed from 0 to n-1, where n is the number
    # of top dimensional cells. Hence we can get a
    # mapping by counting the cells in the cc.
    dsgrn_index = 0
    for cell_index in cubical_complex(dimension):
        # Ignore fringe cells
        if cubical_complex.rightfringe(cell_index):
            continue
        cell2cc_cell[dsgrn_index] = cell_index
        dsgrn_index += 1
    return cell2cc_cell
Return a mapping from the top dimensional cells
    in the DSGRN complex to the top dimensional
    cells in the pychomp cubical complex.
    
Return a mapping from the top dimensional cells
in the DSGRN complex to the top dimensional
cells in the pychomp cubical complex.
Return a mapping from the top dimensional cells in the DSGRN complex to the top dimensional cells in the pychomp cubical complex .
def dsgrn_cell_to_cc_cell_map(network):
    cubical_complex = pychomp.CubicalComplex([x + 1 for x in network.domains()])
    dimension = network.size()
    cell2cc_cell = {}
    dsgrn_index = 0
    for cell_index in cubical_complex(dimension):
        if cubical_complex.rightfringe(cell_index):
            continue
        cell2cc_cell[dsgrn_index] = cell_index
        dsgrn_index += 1
    return cell2cc_cell
def dsgrn_cell_to_cc_cell_map ( network ) : cubical_complex = pychomp . CubicalComplex ( [ x + 1 for x in network . domains ( ) ] ) dimension = network . size ( ) cell2cc_cell = { } dsgrn_index = 0 for cell_index in cubical_complex ( dimension ) : if cubical_complex . rightfringe ( cell_index ) : continue cell2cc_cell [ dsgrn_index ] = cell_index dsgrn_index += 1 return cell2cc_cell
Return a mapping from the top dimensional cells
in the DSGRN complex to the top dimensional
cells in the pychomp cubical complex.
Return a mapping from the top dimensional cells in the DSGRN complex to the top dimensional cells in the pychomp cubical complex .
"""Return a mapping from the top dimensional cells
    in the DSGRN complex to the top dimensional
    cells in the pychomp cubical complex.
    """ # Construct a cubical complex using pychomp. A cubical complex in pychomp # does not contain the rightmost boundary, so make one extra layer of # cubes and ignore the last layer (called rightfringe in pychomp). # Mapping from DSGRN top cells to cc top cells # DSGRN only uses the top dimensional cells to # construct the state transiton graph and the # corresponding morse sets and these cells are # indexed from 0 to n-1, where n is the number # of top dimensional cells. Hence we can get a # mapping by counting the cells in the cc. # Ignore fringe cells
network