Skip to content

Commit

Permalink
CU-8693wtx4: Fix typing issue [#2]
Browse files Browse the repository at this point in the history
  • Loading branch information
mart-r committed Feb 22, 2024
1 parent 69155af commit 8caa8ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions medcat/compare_models/compare_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ def determine(cls, d1: Optional[dict], d2: Optional[dict]) -> 'AnnotationCompari
return cls.OVERLAPP_2ND_LARGER_SAME_CONCEPT
return cls.OVERLAPP_2ND_LARGER_DIFF_CONCEPT
# condition shouldn't be necessary
if len1 == len2:
# same length, but not identical span
if cui1 == cui2:
return cls.PARTIAL_OVERLAP_SAME_CONCEPT
return cls.PARTIAL_OVERLAP_DIFF_CONCEPT
# if len1 == len2:
# same length, but not identical span
if cui1 == cui2:
return cls.PARTIAL_OVERLAP_SAME_CONCEPT
return cls.PARTIAL_OVERLAP_DIFF_CONCEPT


class PerDocAnnotationDifferences(BaseModel):
Expand Down
6 changes: 3 additions & 3 deletions medcat/compare_models/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def show_dict_deep(d: dict, path: str = '',
if isinstance(value, dict):
show_dict_deep(value, path=total_path)
continue
print(output_formatter(total_path,value))
print(output_formatter(total_path, value, None))
# for paired keys
for key1, key2 in key_pairs:
common_key = key1[:-1]
Expand Down Expand Up @@ -146,8 +146,8 @@ def compare_dicts(d1: dict, d2: dict,
printval1 = f"{nr_of_keys1} keys (mean {total1/nr_of_keys1} values per key)"
printval2 = f"{nr_of_keys2} keys (mean {total2/nr_of_keys2} values per key)"
else:
printval1 = len(v1)
printval2 = len(v2)
printval1 = str(len(v1))
printval2 = str(len(v2))
else:
printval1 = str(v1)
printval2 = str(v2)
Expand Down

0 comments on commit 8caa8ac

Please sign in to comment.