Commit 5831cba2 authored by Tomas Krizek's avatar Tomas Krizek

dataformat: add counter for field mismatches

parent 39a9077b
# Cusom data structures and JSON utility functions
import collections
from collections import Counter
import collections.abc
import json
import logging
......@@ -345,6 +346,15 @@ class Summary(Disagreements):
report.total_answers - summary.upstream_unstable - summary.not_reproducible)
return summary
def get_field_counters(self) -> Mapping[FieldLabel, Counter]:
field_counters = {}
for field in self.field_labels:
counter = Counter() # type: Counter
for mismatch, qids in self.get_field_mismatches(field):
counter[mismatch] = len(qids)
field_counters[field] = counter
return field_counters
class ReproCounter(JSONDataObject):
_ATTRIBUTES = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment