From 8c286c745c8f6c8e81835c379a72cb107f3a2979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Perceval=20Wajsb=C3=BCrt?= Date: Mon, 4 Dec 2023 17:27:56 +0100 Subject: [PATCH] fix: add type of param default into type hint --- edsnlp/data/converters.py | 2 +- edsnlp/pipes/core/terminology/terminology.py | 2 +- edsnlp/pipes/misc/dates/dates.py | 2 +- edsnlp/pipes/qualifiers/family/family.py | 4 ++-- edsnlp/pipes/qualifiers/history/history.py | 4 ++-- edsnlp/pipes/qualifiers/hypothesis/hypothesis.py | 4 ++-- edsnlp/pipes/qualifiers/negation/negation.py | 4 ++-- edsnlp/pipes/qualifiers/reported_speech/reported_speech.py | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/edsnlp/data/converters.py b/edsnlp/data/converters.py index ae3db1f33..6d98f2b34 100644 --- a/edsnlp/data/converters.py +++ b/edsnlp/data/converters.py @@ -259,7 +259,7 @@ class StandoffDoc2DictConverter: def __init__( self, *, - span_getter: SpanGetterArg = None, + span_getter: Optional[SpanGetterArg] = None, span_attributes: AttributesMappingArg = {}, ): self.span_getter = span_getter diff --git a/edsnlp/pipes/core/terminology/terminology.py b/edsnlp/pipes/core/terminology/terminology.py index b1a28a31f..bc9cda7e2 100644 --- a/edsnlp/pipes/core/terminology/terminology.py +++ b/edsnlp/pipes/core/terminology/terminology.py @@ -114,7 +114,7 @@ def __init__( ignore_excluded: bool = False, ignore_space_tokens: bool = False, term_matcher: Literal["exact", "simstring"] = "exact", - term_matcher_config: Dict[str, Any] = None, + term_matcher_config: Optional[Dict[str, Any]] = None, label, span_setter: SpanSetterArg = {"ents": True}, ): diff --git a/edsnlp/pipes/misc/dates/dates.py b/edsnlp/pipes/misc/dates/dates.py index f9639a884..5ed7893ba 100644 --- a/edsnlp/pipes/misc/dates/dates.py +++ b/edsnlp/pipes/misc/dates/dates.py @@ -169,7 +169,7 @@ def __init__( relative: Optional[List[str]] = None, duration: Optional[List[str]] = None, false_positive: Optional[List[str]] = None, - on_ents_only: Union[bool, str, Iterable[str]] = None, + on_ents_only: Optional[Union[bool, str, Iterable[str]]] = None, span_getter: Optional[SpanGetterArg] = None, merge_mode: Literal["intersect", "align"] = "intersect", detect_periods: bool = False, diff --git a/edsnlp/pipes/qualifiers/family/family.py b/edsnlp/pipes/qualifiers/family/family.py index 5e18f0392..206c28c56 100644 --- a/edsnlp/pipes/qualifiers/family/family.py +++ b/edsnlp/pipes/qualifiers/family/family.py @@ -117,8 +117,8 @@ def __init__( family: Optional[List[str]] = None, termination: Optional[List[str]] = None, use_sections: bool = True, - span_getter: SpanGetterArg = None, - on_ents_only: Union[bool, str, List[str], Set[str]] = None, + span_getter: Optional[SpanGetterArg] = None, + on_ents_only: Optional[Union[bool, str, List[str], Set[str]]] = None, explain: bool = False, ): terms = dict( diff --git a/edsnlp/pipes/qualifiers/history/history.py b/edsnlp/pipes/qualifiers/history/history.py index d5aa71ba8..c06c0dd15 100644 --- a/edsnlp/pipes/qualifiers/history/history.py +++ b/edsnlp/pipes/qualifiers/history/history.py @@ -187,8 +187,8 @@ def __init__( history_limit: int = 14, closest_dates_only: bool = True, exclude_birthdate: bool = True, - span_getter: SpanGetterArg = None, - on_ents_only: Union[bool, str, List[str], Set[str]] = None, + span_getter: Optional[SpanGetterArg] = None, + on_ents_only: Optional[Union[bool, str, List[str], Set[str]]] = None, explain: bool = False, ): terms = dict( diff --git a/edsnlp/pipes/qualifiers/hypothesis/hypothesis.py b/edsnlp/pipes/qualifiers/hypothesis/hypothesis.py index 3f962ca42..bf4f9f9a6 100644 --- a/edsnlp/pipes/qualifiers/hypothesis/hypothesis.py +++ b/edsnlp/pipes/qualifiers/hypothesis/hypothesis.py @@ -157,8 +157,8 @@ def __init__( verbs_hyp: Optional[List[str]] = None, termination: Optional[List[str]] = None, attr: str = "NORM", - span_getter: SpanGetterArg = None, - on_ents_only: Union[bool, str, List[str], Set[str]] = None, + span_getter: Optional[SpanGetterArg] = None, + on_ents_only: Optional[Union[bool, str, List[str], Set[str]]] = None, within_ents: bool = False, explain: bool = False, ): diff --git a/edsnlp/pipes/qualifiers/negation/negation.py b/edsnlp/pipes/qualifiers/negation/negation.py index eb8fe1aca..99cead3cc 100644 --- a/edsnlp/pipes/qualifiers/negation/negation.py +++ b/edsnlp/pipes/qualifiers/negation/negation.py @@ -159,8 +159,8 @@ def __init__( verbs: Optional[List[str]] = None, termination: Optional[List[str]] = None, attr: str = "NORM", - span_getter: SpanGetterArg = None, - on_ents_only: Union[bool, str, List[str], Set[str]] = None, + span_getter: Optional[SpanGetterArg] = None, + on_ents_only: Optional[Union[bool, str, List[str], Set[str]]] = None, within_ents: bool = False, explain: bool = False, ): diff --git a/edsnlp/pipes/qualifiers/reported_speech/reported_speech.py b/edsnlp/pipes/qualifiers/reported_speech/reported_speech.py index 985e1e8c0..d1745a044 100644 --- a/edsnlp/pipes/qualifiers/reported_speech/reported_speech.py +++ b/edsnlp/pipes/qualifiers/reported_speech/reported_speech.py @@ -122,8 +122,8 @@ def __init__( quotation: Optional[List[str]] = None, verbs: Optional[List[str]] = None, attr: str = "NORM", - span_getter: SpanGetterArg = None, - on_ents_only: Union[bool, str, List[str], Set[str]] = None, + span_getter: Optional[SpanGetterArg] = None, + on_ents_only: Optional[Union[bool, str, List[str], Set[str]]] = None, within_ents: bool = False, explain: bool = False, ):