-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: Moved to ruff as the main linter
- Loading branch information
1 parent
367ff15
commit 05c3de8
Showing
14 changed files
with
70 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,42 @@ | ||
from typing import Any | ||
|
||
import pytest | ||
import spacy | ||
from dacy.datasets import dane | ||
from spacy.language import Language | ||
from spacy.training import Example | ||
|
||
from .books import BOOKS | ||
|
||
|
||
# pipelines | ||
@pytest.fixture() | ||
def nlp_en(): | ||
def nlp_en() -> Language: | ||
return spacy.blank("en") | ||
|
||
|
||
@pytest.fixture() | ||
def nlp_da(): | ||
def nlp_da() -> Language: | ||
return spacy.blank("da") | ||
|
||
|
||
@pytest.fixture() | ||
def nlp_en_md(): | ||
def nlp_en_md() -> Language: | ||
return spacy.load("en_core_web_md") | ||
|
||
|
||
@pytest.fixture() | ||
def dane_test(nlp_da): | ||
return dane(splits=["test"])(nlp_da) | ||
def dane_test(nlp_da: Language) -> Any: | ||
return dane(splits=["test"])(nlp_da) # type: ignore | ||
|
||
|
||
@pytest.fixture() | ||
def books_w_annotations(nlp_en_md): | ||
def books_w_annotations(nlp_en_md: Language) -> list: | ||
docs = nlp_en_md.pipe(BOOKS) | ||
return [Example(doc, doc) for doc in docs] | ||
|
||
|
||
@pytest.fixture() | ||
def books_without_annotations(nlp_en): | ||
def books_without_annotations(nlp_en: Language) -> list: | ||
docs = nlp_en.pipe(BOOKS) | ||
return [Example(doc, doc) for doc in docs] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters