-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
WIP : python3-ization and type hinting #37
Conversation
Happy new year @hadware ! Thanks for this pull request and sorry for the delay in looking at it. |
Yes I will! I'll be here on next tuesday @ens by the way. |
# Conflicts: # pyannote/metrics/base.py # pyannote/metrics/detection.py # setup.py
Well, this should be close to done. Regarding my former question: there's a nifty |
Fixed your comments. I'm wondering: in some cases (notably: for all detection metrics), the required type for ref/hypothesis seems to be Moreover, maybe we could extend the use of |
It could be applied to
Once again, we'd have to be careful about segmentation metrics as these two notions probably don't make sense here. Anyway, this should not be part of this PR. Shall I merged this PR or do you plan to add more typing? |
Ok, maybe in another PR, it'll indeed take some time to look into it. Regarding this current PR, I think i'm mostly done with typing, i'll re-check everything, and it should be good. |
…tten to type most of detection.py .
C'est votre dernier mot, Jean-Pierre ? |
🎉 Thanks @hadware ! |
Same thing as for pyannote-core.
First question: for what you call "array-like", i'm proposing 3 solutions:
ArrayLike = Union[Sequence, np.ndarray]
Sequence
np.ndarray
As for now, it doesn't look like there is anything usable for type-hinting array sizes (after a quick research).
Ref: https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html#standard-duck-types (for Sequence)