How to use the hypernetx.HyperNetXError function in hypernetx

To help you get started, we’ve selected a few hypernetx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pnnl / HyperNetX / hypernetx / algorithms / homology_mod2.py View on Github external
Ck : list
        a list of k-cells being referenced by arr
    arr : np.array
        a 0-1 array
    
    Returns
    ----
    : list
        list of k-cells referenced by data in Ck
    
    """

    output = list()
    for vec in arr:
        if len(Ck) != len(vec):
            raise HyperNetXError('elements of arr must have the same length as Ck')
        output.append([Ck[idx] for idx in range(len(vec)) if vec[idx] == 1])
    return output