Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Python type hints #708

Merged
merged 28 commits into from
Jun 5, 2023
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f5f32dd
Run "monkeytype apply --pep_563" on all modules
juhoinkinen May 23, 2023
c8a04cb
Use dict instead of OrderedDict
juhoinkinen May 23, 2023
7ed97a5
Make imports that were too eagerly made conditional default again
juhoinkinen May 23, 2023
1a36c09
Fix flake8 errors
juhoinkinen May 23, 2023
1660e56
Turn forward references non-strings
juhoinkinen May 23, 2023
61decb7
Use less specific types
juhoinkinen May 23, 2023
ba77e84
Remove "Union[Any," in hints
juhoinkinen May 24, 2023
2f9ee10
Move comment back to its original place
juhoinkinen May 24, 2023
d2c5e53
Fix some omissions and errors by monkeytype
juhoinkinen May 24, 2023
f242a98
Simplify hints using float for Union[int, float]
juhoinkinen May 24, 2023
7c3c5dc
Simplify hints using Sequence for Union[Tuple, List]
juhoinkinen May 24, 2023
961dd09
Remove too wide usage of Any (e.g. in Unions, Lists, Iterators)
juhoinkinen May 25, 2023
33cdcf2
Unify type of params to Dict[str, Any] or DefaultDict[str, Dict
juhoinkinen May 25, 2023
bb9951f
Simplify overly complex types
juhoinkinen May 25, 2023
c405d83
Fix erronously passing whole Error obj to ClickException instead of j…
juhoinkinen May 25, 2023
b74d869
Annotate (manually) annif/backend/hyperopt.py
juhoinkinen May 25, 2023
4eb904e
Manually annotate annif/backend/mixins.py
juhoinkinen May 26, 2023
6987c05
Manually annotate annif/corpus/document.py
juhoinkinen May 26, 2023
76022aa
Upgrade to PEP 585 and PEP 604 typing features/syntax
juhoinkinen May 29, 2023
5f84a56
Manually annotate annif/corpus/parallel.py
juhoinkinen May 30, 2023
b9cfacf
Manually annotate annif/util.py
juhoinkinen May 30, 2023
c49fee9
Fix easily fixable errors noted by Mypy
juhoinkinen May 30, 2023
8092605
Exclude TYPE_CHECKING blocks from test coverage
juhoinkinen Jun 1, 2023
7ec0b73
Narrow down TokenSet tokens type to np.ndarray only
juhoinkinen Jun 1, 2023
fd19c67
Use int instead of int | np.int32
juhoinkinen Jun 1, 2023
486b48f
Move imports for type typechecking only to TYPE_CHECKING blocks
juhoinkinen Jun 1, 2023
6e92123
Restore accidentally removed annif.suggestion import
juhoinkinen Jun 2, 2023
252c75f
Make type optional as it should be
juhoinkinen Jun 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Restore accidentally removed annif.suggestion import
  • Loading branch information
juhoinkinen committed Jun 2, 2023
commit 6e921238bbf3ae725e9f4f15fca45eaa92817475
1 change: 1 addition & 0 deletions annif/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def suggest_corpus(
self.suggest([doc.text for doc in doc_batch], backend_params)
for doc_batch in corpus.doc_batches
)
import annif.suggestion

return annif.suggestion.SuggestionResults(suggestions)

Expand Down