Skip to content

Commit 54f54fc

Browse files
committed
Reformat with black 25
1 parent 68679d6 commit 54f54fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+277
-285
lines changed

spacy/cli/_util.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,11 @@ def get_git_version(
225225

226226

227227
@overload
228-
def string_to_list(value: str, intify: Literal[False] = ...) -> List[str]:
229-
...
228+
def string_to_list(value: str, intify: Literal[False] = ...) -> List[str]: ...
230229

231230

232231
@overload
233-
def string_to_list(value: str, intify: Literal[True]) -> List[int]:
234-
...
232+
def string_to_list(value: str, intify: Literal[True]) -> List[int]: ...
235233

236234

237235
def string_to_list(value: str, intify: bool = False) -> Union[List[str], List[int]]:

spacy/cli/debug_data.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -968,16 +968,14 @@ def _compile_gold(
968968

969969

970970
@overload
971-
def _format_labels(labels: Iterable[str], counts: Literal[False] = False) -> str:
972-
...
971+
def _format_labels(labels: Iterable[str], counts: Literal[False] = False) -> str: ...
973972

974973

975974
@overload
976975
def _format_labels(
977976
labels: Iterable[Tuple[str, int]],
978977
counts: Literal[True],
979-
) -> str:
980-
...
978+
) -> str: ...
981979

982980

983981
def _format_labels(

spacy/cli/find_threshold.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,11 @@ def filter_config(
157157
exits=1,
158158
)
159159
return {
160-
keys[0]: filter_config(config[keys[0]], keys[1:], full_key)
161-
if len(keys) > 1
162-
else config[keys[0]]
160+
keys[0]: (
161+
filter_config(config[keys[0]], keys[1:], full_key)
162+
if len(keys) > 1
163+
else config[keys[0]]
164+
)
163165
}
164166

165167
# Evaluate with varying threshold values.
@@ -216,12 +218,14 @@ def filter_config(
216218
if len(set(scores.values())) == 1:
217219
wasabi.msg.warn(
218220
title="All scores are identical. Verify that all settings are correct.",
219-
text=""
220-
if (
221-
not isinstance(pipe, MultiLabel_TextCategorizer)
222-
or scores_key in ("cats_macro_f", "cats_micro_f")
223-
)
224-
else "Use `cats_macro_f` or `cats_micro_f` when optimizing the threshold for `textcat_multilabel`.",
221+
text=(
222+
""
223+
if (
224+
not isinstance(pipe, MultiLabel_TextCategorizer)
225+
or scores_key in ("cats_macro_f", "cats_micro_f")
226+
)
227+
else "Use `cats_macro_f` or `cats_micro_f` when optimizing the threshold for `textcat_multilabel`."
228+
),
225229
)
226230

227231
else:

spacy/cli/init_config.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,11 @@ def init_config(
195195
"Pipeline": ", ".join(pipeline),
196196
"Optimize for": optimize,
197197
"Hardware": variables["hardware"].upper(),
198-
"Transformer": template_vars.transformer.get("name") # type: ignore[attr-defined]
199-
if template_vars.use_transformer # type: ignore[attr-defined]
200-
else None,
198+
"Transformer": (
199+
template_vars.transformer.get("name") # type: ignore[attr-defined]
200+
if template_vars.use_transformer # type: ignore[attr-defined]
201+
else None
202+
),
201203
}
202204
msg.info("Generated config template specific for your use case")
203205
for label, value in use_case.items():

spacy/compat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Helpers for Python and platform compatibility."""
2+
23
import sys
34

45
from thinc.util import copy_array

spacy/displacy/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
DOCS: https://spacy.io/api/top-level#displacy
55
USAGE: https://spacy.io/usage/visualizers
66
"""
7+
78
import warnings
89
from typing import Any, Callable, Dict, Iterable, Optional, Union
910

spacy/lang/am/examples.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
>>> docs = nlp.pipe(sentences)
66
"""
77

8-
98
sentences = [
109
"አፕል የዩኬን ጅምር ድርጅት በ 1 ቢሊዮን ዶላር ለመግዛት አስቧል።",
1110
"የራስ ገዝ መኪኖች የኢንሹራንስ ኃላፊነትን ወደ አምራቾች ያዛውራሉ",

spacy/lang/az/examples.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
>>> docs = nlp.pipe(sentences)
55
"""
66

7-
87
sentences = [
98
"Bu bir cümlədir.",
109
"Necəsən?",

spacy/lang/bg/stop_words.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
https://github.com/Alir3z4/stop-words - Original list, serves as a base.
44
https://postvai.com/books/stop-dumi.pdf - Additions to the original list in order to improve it.
55
"""
6+
67
STOP_WORDS = set(
78
"""
89
а автентичен аз ако ала

spacy/lang/bn/examples.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@
55
>>> docs = nlp.pipe(sentences)
66
"""
77

8-
98
sentences = ["তুই খুব ভালো", "আজ আমরা ডাক্তার দেখতে যাবো", "আমি জানি না "]

0 commit comments

Comments
 (0)