File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -602,14 +602,13 @@ def store_best(self):
602
602
def check_integrity (self , partition ):
603
603
""" Raises error if partition structure contains
604
604
empty partitions or Nan values"""
605
-
606
- # Raise error if any partition is empty
607
- if [partition [key ] == set ([]) for key in partition .keys ()]:
608
- raise ValueError ("Partition index %s is empty" % (key ))
609
-
610
- # Raise error if any partition contains NaN value(s)
611
- if [np .isnan (value ) for sets in partition .values () for value in sets ]:
612
- raise ValueError ("Partition contains NaN value(s)" )
605
+
606
+ for tmpset in partition .values ():
607
+ if tmpset == set ([]):
608
+ raise ValueError ("Partition has empty key : %s" % partition )
609
+ if any ([np .isnan (x ) for x in tmpset ]):
610
+ raise ValueError ("Partition contains NaN value(s)" )
611
+
613
612
614
613
#-----------------------------------------------------------------------------
615
614
# Functions
You can’t perform that action at this time.
0 commit comments