aestrivex/bctpy

community_louvain error with negative weights

Closed this issue · 1 comments

The community_louvain function in modularity.py throws an error if the input matrix contains negative weights, even if 'negative_sym' or 'negative_asym' specified via the modularity parameter.

Looks as though lines 110-111 should be made conditional on the user choosing one of the other modularity parameters?

if np.min(W) < -1e-10:
        raise BCTParamError('adjmat must not contain negative weights')

Fixed in PR #65