Skip to content

Commit

Permalink
fix: mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Szymon Palucha committed Oct 3, 2024
1 parent 5ed9b54 commit 06103e9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion kazu/ontology_preprocessing/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
32 changes: 16 additions & 16 deletions kazu/ontology_preprocessing/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1296,7 +1296,7 @@ def __init__(
"Social circumstances",
"Investigations",
),
):
) -> None:
super().__init__(
in_path=in_path,
entity_class=entity_class,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1547,7 +1547,7 @@ def __init__(
global_actions: Optional[GlobalParserActions] = None,
ontology_downloader: Optional[OntologyDownloader] = None,
**kwargs: Any,
):
) -> None:
"""
:param in_path:
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 06103e9

Please sign in to comment.