-
Notifications
You must be signed in to change notification settings - Fork 24
MNT: Final Annotation #63
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
MNT: Final Annotation #63
Conversation
welli7ngton
commented
Mar 7, 2025
- add annotation to the Application session and '_fix_retina_element' function.
I wonder what would be the right annotation to I've used this docs as reference. |
@@ -230,7 +230,7 @@ def _to_dict(lbs, elems): | |||
else: | |||
return _to_dict(labels, results) | |||
|
|||
def _fix_retina_element(self, ele): | |||
def _fix_retina_element(self, ele: cv2find.Box) -> cv2find.Box: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this Box type was a good option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's okay to use it this way, but I can do some tests to validate it.
Hi @welli7ngton! Just a few notes about the type annotations in the "Application" section. I think that in the annotation for the
Here are more details:
Regarding the appropriate type for Since these parameters refer to element selectors (reference here), they can be of different types (str, int, bool, etc.). So, in this case, an option could use the type notation like:
Newer versions of Python seem to have some more efficient ways of doing this type annotation for **kwargs, but I think they are not compatible with older versions of Python. Here are some references I found: So at least for now, I think there would be no problem using it in the way I mentioned. |
@welli7ngton Merging this PR with the last type annotations. Thanks for the contribution! |