From a6e4a6cca4e9583031333247200f3c105f02b1f0 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Mon, 21 Dec 2020 20:02:54 +0100 Subject: matching: fix import --- fuzzycat/matching.py | 1 + fuzzycat/verify.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fuzzycat/matching.py b/fuzzycat/matching.py index 0a096d6..13634e0 100644 --- a/fuzzycat/matching.py +++ b/fuzzycat/matching.py @@ -8,6 +8,7 @@ import elasticsearch_dsl import fatcat_openapi_client import requests from fatcat_openapi_client import ContainerEntity, DefaultApi, ReleaseEntity +from fatcat_openapi_client.rest import ApiException from fuzzycat.entities import entity_from_dict, entity_from_json diff --git a/fuzzycat/verify.py b/fuzzycat/verify.py index f6c96f3..99b507a 100644 --- a/fuzzycat/verify.py +++ b/fuzzycat/verify.py @@ -83,15 +83,15 @@ import re import sys from typing import Counter, Dict, Tuple, Type +from fatcat_openapi_client import ReleaseEntity from glom import PathAccessError, glom from fuzzycat.common import Reason, Status from fuzzycat.data import (CONTAINER_NAME_BLACKLIST, PUBLISHER_BLACKLIST, TITLE_BLACKLIST, TITLE_FRAGMENT_BLACKLIST) +from fuzzycat.entities import entity_to_dict from fuzzycat.utils import (author_similarity_score, contains_chemical_formula, dict_key_exists, has_doi_prefix, jaccard, num_project, parse_page_string, slugify_string) -from fuzzycat.entities import entity_to_dict -from fatcat_openapi_client import ReleaseEntity Verify = collections.namedtuple("Verify", "status reason") @@ -149,6 +149,7 @@ class GroupVerifier: def verify_release_entities(a: ReleaseEntity, b: ReleaseEntity, min_title_length=5) -> Type[Verify]: return verify(entity_to_dict(a), entity_to_dict(b), min_title_length=min_title_length) + def verify(a: Dict, b: Dict, min_title_length=5) -> Tuple[str, str]: """ Compare two entities (dicts), return tuple of match status and reason. -- cgit v1.2.3