We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e34237 commit 3416c66Copy full SHA for 3416c66
brainx/modularity.py
@@ -663,12 +663,14 @@ def store_best(self):
663
self.bestindex = copy.deepcopy(self.index)
664
665
def check_integrity(self, partition):
666
- """ Raises error if partition structure is invalid """
+ """ Raises error if partition structure contains
667
+ empty partitions or Nan values"""
668
669
# Raise error if any partition is empty
670
if [partition[key] == set([]) for key in partition.keys()]:
671
raise ValueError("Partition index %s is empty" % (key))
672
673
+ # Raise error if any partition contains NaN value(s)
674
if [np.isnan(value) for sets in partition.values() for value in sets]:
675
raise ValueError("Partition contains NaN(s)")
676
0 commit comments