Workaround solution for issue #26818#26826
Conversation
|
Hi @asmorkalov , The pipeline page says, "Service is in degraded state" . Any idea on when it will be up and running... |
|
Oh, sorry I have mistake. this pull request is not enoght to fix original issue. we have to test with "mypy". |
VadimLevin
left a comment
There was a problem hiding this comment.
Squash commits and keep changes only in predefined_types.py
|
Thank you for your continuous helping. And If possible, could you fix code indent like Mat ? (I think you can fix to override without reverting commit) kmtr@kmtr-VMware-Virtual-Platform:~/work/opencv4$ git diff -b 4a4031dc48475ec3354d28a3cdedda57a8913443
diff --git a/modules/python/src2/typing_stubs_generation/predefined_types.py b/modules/python/src2/typing_stubs_generation/predefined_types.py
index c5f49b5122..d32fd9b934 100644
--- a/modules/python/src2/typing_stubs_generation/predefined_types.py
+++ b/modules/python/src2/typing_stubs_generation/predefined_types.py
@@ -54,8 +54,12 @@ _PREDEFINED_TYPES = (
doc="Required length is 2"),
AliasTypeNode.sequence_("Size2f", PrimitiveTypeNode.float_(),
doc="Required length is 2"),
- AliasTypeNode.sequence_("Scalar", PrimitiveTypeNode.float_(),
- doc="Required length is at most 4"),
+ AliasTypeNode.union_(
+ "Scalar",
+ items=(SequenceTypeNode("Scalar", PrimitiveTypeNode.float_()),
+ PrimitiveTypeNode.float_()),
+ doc="Max sequence length is at most 4"
+ ),
AliasTypeNode.sequence_("Point", PrimitiveTypeNode.int_(),
doc="Required length is 2"),
AliasTypeNode.ref_("Point2i", "Point"),
kmtr@kmtr-VMware-Virtual-Platform:~/work/opencv4$ |
Updated predefined_types.py to keep changes only as suggested in opencv#26826 (review) opencv#26826 (comment)
|
Hi @VadimLevin , As you suggested, I stashed all other changes except for the one suggested here #26826 (comment) for predefined_datatypes.py Also, @Kumataro , as you indicated I kept the indent same as per the one you suggested here #26826 (comment) Thanks for all your help. @VadimLevin could you please have a look and let me know if anything else is needed to be done... @VadimLevin As I newly started to the world of open-source hence I have been pretty much afraid of making any changes that might cause the sys to break, but I believe if the community supports me I would also be able to debug, test and write code in a much more professional manner. Thank You! |
|
@VadimLevin , thanks for reviewing and merging the PR. |
Updated predefined_types.py to keep changes only as suggested in opencv#26826 (review) opencv#26826 (comment)
Addresses issues opencv#27528, opencv#26818, opencv#26826 by implementing the function overloads solution suggested by VadimLevin in PR opencv#27620. Changes: 1. predefined_types.py: Change Scalar from Union to Sequence[float] 2. api_refinement.py: Add global function overload generation 3. Generate both Scalar and float overloads for drawing functions This provides better MyPy compatibility while maintaining backward compatibility. All existing code continues to work unchanged. Testing: Comprehensive test suite validates all scenarios pass
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.