Skip to content
Snippets Groups Projects
Commit 1d2c9378 authored by Coda Phillips's avatar Coda Phillips
Browse files

Handle the case where all records get marked

parent 73ab2554
No related branches found
No related tags found
No related merge requests found
......@@ -36,8 +36,9 @@ def update_variable_qc(frame, variable_qcs):
return frame.drop('qc_notes', axis=1).combine(variable_qcs, proba_update, fill_value=0).combine_first(frame[['qc_notes']])
def annotate_all(frame, mask, annotation):
for loc in frame.index[mask]:
annotate(frame, loc, annotation)
if len(mask) > 0:
for loc in frame.index[mask]:
annotate(frame, loc, annotation)
def invalidate_records(frame, check_name):
for index,percent in frame.ix[frame[check_name] > 0, check_name].iteritems():
......@@ -122,6 +123,10 @@ class BaseCheckList:
filtered_frame = frame.ix[frame.qc_percent < 1].copy()
for check, metadata in self.checks.items():
original_shape = filtered_frame.shape
filtered_frame = check(filtered_frame, self.parameters)
if len(filtered_frame) > 0:
filtered_frame = check(filtered_frame, self.parameters)
else:
for v in metadata['updates']:
filtered_frame[v] = []
assert np.in1d(list(metadata['updates']), filtered_frame.columns).all()
return self.update_qc_percent(filtered_frame.combine_first(frame))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment