def test_find_complement(self): am = self.net.create_adjacency_matrix(weights=self.net.Ts, fmt='coo') a = [0, 1, 2] b = topotools.find_complement(sites=a, am=am) assert set(a).isdisjoint(b) a = [0, 1, 2] b = topotools.find_complement(bonds=a, am=am) assert set(a).isdisjoint(b) with pytest.raises(Exception): topotools.find_complement(am=am) with pytest.raises(Exception): topotools.find_complement(am=am, sites=a, bonds=a)
def test_find_complement_asmask(self): am = self.net.create_adjacency_matrix(weights=self.net.Ts, fmt='coo') a = [0, 1, 2] b = topotools.find_complement(sites=a, am=am, asmask=True) assert len(b) == self.net.Np