diff --git a/kazu/ontology_preprocessing/base.py b/kazu/ontology_preprocessing/base.py index b30062ce..15277182 100644 --- a/kazu/ontology_preprocessing/base.py +++ b/kazu/ontology_preprocessing/base.py @@ -100,7 +100,7 @@ def __init__( curations_path: Optional[PathLike] = None, global_actions: Optional[GlobalParserActions] = None, ontology_downloader: Optional[OntologyDownloader] = None, - ): + ) -> None: """ :param in_path: Path to some resource that should be processed (e.g. owl file, db config, tsv etc) diff --git a/kazu/ontology_preprocessing/parsers.py b/kazu/ontology_preprocessing/parsers.py index 501ae21b..e3468017 100644 --- a/kazu/ontology_preprocessing/parsers.py +++ b/kazu/ontology_preprocessing/parsers.py @@ -480,7 +480,7 @@ def __init__( in_path: PathLike, entity_class: str, name: str, - uri_regex: Union[str, re.Pattern], + uri_regex: Union[str, re.Pattern[str]], synonym_predicates: Iterable[RdfRef], string_scorer: Optional[StringSimilarityScorer] = None, synonym_merge_threshold: float = 0.7, @@ -493,7 +493,7 @@ def __init__( global_actions: Optional[GlobalParserActions] = None, ontology_downloader: Optional[OntologyDownloader] = None, label_predicate: RdfRef = rdflib.RDFS.label, - ): + ) -> None: super().__init__( in_path=in_path, entity_class=entity_class, @@ -641,7 +641,7 @@ def __init__( in_path: PathLike, entity_class: str, name: str, - uri_regex: Union[str, re.Pattern], + uri_regex: Union[str, re.Pattern[str]], synonym_predicates: Iterable[RdfRef] = (SKOS_XL_ALT_LABEL_PATH,), string_scorer: Optional[StringSimilarityScorer] = None, synonym_merge_threshold: float = 0.7, @@ -654,7 +654,7 @@ def __init__( global_actions: Optional[GlobalParserActions] = None, ontology_downloader: Optional[OntologyDownloader] = None, label_predicate: RdfRef = SKOS_XL_PREF_LABEL_PATH, - ): + ) -> None: super().__init__( in_path=in_path, entity_class=entity_class, @@ -710,7 +710,7 @@ def __init__( curations_path: Optional[PathLike] = None, global_actions: Optional[GlobalParserActions] = None, ontology_downloader: Optional[OntologyDownloader] = None, - ): + ) -> None: super().__init__( in_path=in_path, entity_class=entity_class, @@ -793,7 +793,7 @@ def __init__( curations_path: Optional[PathLike] = None, global_actions: Optional[GlobalParserActions] = None, ontology_downloader: Optional[OntologyDownloader] = None, - ): + ) -> None: super().__init__( in_path=in_path, entity_class=entity_class, @@ -833,7 +833,7 @@ def __init__( curations_path: Optional[PathLike] = None, global_actions: Optional[GlobalParserActions] = None, ontology_downloader: Optional[OntologyDownloader] = None, - ): + ) -> None: super().__init__( in_path=in_path, entity_class=entity_class, @@ -873,7 +873,7 @@ def __init__( curations_path: Optional[PathLike] = None, global_actions: Optional[GlobalParserActions] = None, ontology_downloader: Optional[OntologyDownloader] = None, - ): + ) -> None: super().__init__( in_path=in_path, entity_class=entity_class, @@ -913,7 +913,7 @@ def __init__( curations_path: Optional[PathLike] = None, global_actions: Optional[GlobalParserActions] = None, ontology_downloader: Optional[OntologyDownloader] = None, - ): + ) -> None: super().__init__( in_path=in_path, @@ -1013,7 +1013,7 @@ def __init__( curations_path: Optional[PathLike] = None, global_actions: Optional[GlobalParserActions] = None, ontology_downloader: Optional[OntologyDownloader] = None, - ): + ) -> None: super().__init__( in_path=in_path, entity_class=entity_class, @@ -1160,7 +1160,7 @@ def __init__( curations_path: Optional[PathLike] = None, global_actions: Optional[GlobalParserActions] = None, ontology_downloader: Optional[OntologyDownloader] = None, - ): + ) -> None: super().__init__( in_path=in_path, entity_class=entity_class, @@ -1296,7 +1296,7 @@ def __init__( "Social circumstances", "Investigations", ), - ): + ) -> None: super().__init__( in_path=in_path, entity_class=entity_class, @@ -1448,7 +1448,7 @@ def __init__( curations_path: Optional[PathLike] = None, global_actions: Optional[GlobalParserActions] = None, ontology_downloader: Optional[OntologyDownloader] = None, - ): + ) -> None: super().__init__( in_path=in_path, @@ -1547,7 +1547,7 @@ def __init__( global_actions: Optional[GlobalParserActions] = None, ontology_downloader: Optional[OntologyDownloader] = None, **kwargs: Any, - ): + ) -> None: """ :param in_path: @@ -1612,7 +1612,7 @@ def __init__( curations_path: Optional[PathLike] = None, global_actions: Optional[GlobalParserActions] = None, ontology_downloader: Optional[OntologyDownloader] = None, - ): + ) -> None: super().__init__( in_path=in_path, entity_class=entity_class, @@ -1682,7 +1682,7 @@ def __init__( curations_path: Optional[PathLike] = None, global_actions: Optional[GlobalParserActions] = None, ontology_downloader: Optional[OntologyDownloader] = None, - ): + ) -> None: super().__init__( in_path=in_path, diff --git a/pyproject.toml b/pyproject.toml index 416554be..d475f59c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -241,13 +241,11 @@ module = [ "kazu.utils.build_and_test_model_packs", # 2 "kazu.steps.ner.hf_token_classification", # 2 "kazu.steps.linking.post_processing.disambiguation.strategies", # 2 - "kazu.ontology_preprocessing.parsers", # 2 "kazu.annotation.acceptance_test", # 2 "kazu.utils.string_normalizer", # 1 "kazu.steps.linking.post_processing.disambiguation.context_scoring", # 1 "kazu.steps.linking.entity_class_disambiguation", # 1 "kazu.pipeline", # 1 - "kazu.ontology_preprocessing.base", # 1 "kazu.ontology_matching.ontology_matcher", # 1 ] # as above, we want this to be true for files it can be, especially new files.