Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ipet/evaluation/IPETEvalTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,7 @@ def evaluate(self, exp : Experiment):
filtergroupdata = self.applyFilterGroup(reduceddata, fg, self.getRowIndex())
if (len(filtergroupdata) == 0):
nonemptyactivefiltergroups.remove(fg)
logger.warning("Filtergroup {} is empty and has been deactived.".format(fg.getName()))
logger.warning("Filtergroup {} is empty and has been deactivated.".format(fg.getName()))
continue
logger.debug("Reduced data for filtergroup {} is:\n{}".format(fg.getName(), filtergroupdata))
self.filtered_instancewise[fg.name] = self.convertToHorizontalFormat(filtergroupdata)
Expand Down Expand Up @@ -2019,7 +2019,8 @@ def computeFilterResults(self, df : pd.DataFrame):
#
# store the result (either by applying the filter, or by copying)
#
f.storeResult(df, fcol)
if fcol is not None:
f.storeResult(df, fcol)


if __name__ == '__main__':
Expand Down
14 changes: 12 additions & 2 deletions ipet/evaluation/IPETFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ def compare(self, x, y):
try:
return method(x, y)
except TypeError as t:
logger.error("Got type error %s comparing elements x:%s and y:%s" % (t, x, y))
return 0
logger.warning("Got type error %s comparing elements x:%s and y:%s" % (t, str(x).split('\n')[0], str(y).split('\n')[0]))
return None

def method_le(self, x, y):
return x <= y
Expand Down Expand Up @@ -328,6 +328,8 @@ def applyListOperator(self, df, groupindex):
| one |equal |True, if at least one value occurs twice in a group |
| all |equal |True, if there is only a single value for this group |
"""
if self.datakey not in df.columns:
return None

#
# 1. chose the right list function
Expand Down Expand Up @@ -419,7 +421,11 @@ def applyFilter(self, df, groupindex = None):
"""
if self.operator in self.listoperators:
filtercol = self.applyListOperator(df, groupindex)
if filtercol is None:
return None
elif self.operator in self.valueoperators:
if self.datakey not in df.columns:
return None
filtercol = self.applyValueOperator(df[[self.datakey]])

else:
Expand All @@ -434,6 +440,8 @@ def applyFilter(self, df, groupindex = None):
except:
pass
filtercol = self.comparison.compare(x, y)
if filtercol is None:
return None

if groupindex is None:
return filtercol
Expand Down Expand Up @@ -661,6 +669,8 @@ def filterDataFrame(self, df, index):
else:
# apply the filter to the data frame rowwise and store the result in a temporary boolean column
fcol = f_.applyFilter(df, index)
if fcol is None:
return [False]*len(df.index)

if intersection_index is not None:
intersection_index = intersection_index & fcol
Expand Down
Loading