-
Notifications
You must be signed in to change notification settings - Fork 5
[Chore]: Fix double import issues with rocpycv #109
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
base: develop
Are you sure you want to change the base?
[Chore]: Fix double import issues with rocpycv #109
Conversation
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.
Pull request overview
This pull request restructures the rocpycv Python package installation to eliminate the double import issue where users previously had to write rocpycv.rocpycv.Tensor instead of rocpycv.Tensor.
Changes:
- Removed the nested
rocpycv/subdirectory structure by deleting__init__.pyand__init__.pyiwrapper files - Moved the type stub file to install directly alongside the compiled module
- Updated CMake install paths from
lib/rocpycv/rocpycv.sotolib/rocpycv.so - Updated RPATH configuration to match the new installation location
- Updated test detection to look for the stub file in the new location
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| python/src/rocpycv/init.py | Removed wrapper file that caused double import |
| python/src/rocpycv/init.pyi | Removed type stub wrapper that caused double import |
| python/src/rocpycv.pyi | Updated type stub with new structure (entire file regenerated) |
| python/CMakeLists.txt | Updated install paths and RPATH to install module directly in lib/ |
| tests/pybind/CMakeLists.txt | Updated test detection path for the relocated stub file |
Comments suppressed due to low confidence (15)
python/src/rocpycv.pyi:806
- The documentation for the
streamparameter incorrectly describes flip code behavior ("0 flips along the x-axis, positive integer flips along the y-axis, and negative integers flip along both axis"). This description belongs to the flip operation, not to the stream parameter. The stream parameter should be documented as the HIP stream to run this operation on.
python/src/rocpycv.pyi:904 - The documentation for the
custom_cropfunction returns None according to the docstring but the function signature shows it returns a Tensor. The Returns section should state "rocpycv.Tensor: The output tensor" instead of "None".
python/src/rocpycv.pyi:982 - The documentation for the
streamparameter incorrectly describes flip code behavior ("0 flips along the x-axis, positive integer flips along the y-axis, and negative integers flip along both axis"). This description belongs to the flip_code parameter, not to the stream parameter. The stream parameter should be documented as the HIP stream to run this operation on.
python/src/rocpycv.pyi:897 - The documentation incorrectly references a
dstparameter that doesn't exist in the function signature. Thecustom_cropfunction only hassrc,crop_rect,stream, anddeviceparameters. This documentation should be updated to reflect the actual function signature.
python/src/rocpycv.pyi:914 - The documentation incorrectly references a
dstparameter that doesn't exist in the function signature. Thecustom_crop_intofunction hasdst,src,crop_rect,stream, anddeviceparameters, but the Args section is missing thedstparameter and incorrectly starts withsrc.
python/src/rocpycv.pyi:965 - The documentation for the
streamparameter incorrectly describes flip code behavior ("0 flips along the x-axis, positive integer flips along the y-axis, and negative integers flip along both axis"). This description belongs to the flip_code parameter, not to the stream parameter. The stream parameter should be documented as the HIP stream to run this operation on.
python/src/rocpycv.pyi:981 - The documentation for the
flip_codeparameter is incomplete. It states "A flip code representing how images in the batch should be flipped." but ends abruptly without the actual explanation. The full description should explain that 0 flips along the x-axis, positive integer flips along the y-axis, and negative integers flip along both axes.
python/src/rocpycv.pyi:786 - The documentation incorrectly references a
dstparameter that doesn't exist in the function signature. Thecenter_cropfunction only hassrc,crop_size,stream, anddeviceparameters. This documentation should be updated to reflect the actual function signature.
python/src/rocpycv.pyi:900 - The documentation for the
streamparameter incorrectly describes flip code behavior ("0 flips along the x-axis, positive integer flips along the y-axis, and negative integers flip along both axis"). This description belongs to the flip operation, not to the stream parameter. The stream parameter should be documented as the HIP stream to run this operation on.
python/src/rocpycv.pyi:916 - The documentation for the
streamparameter incorrectly describes flip code behavior ("0 flips along the x-axis, positive integer flips along the y-axis, and negative integers flip along both axis"). This description belongs to the flip operation, not to the stream parameter. The stream parameter should be documented as the HIP stream to run this operation on.
python/src/rocpycv.pyi:161 - The stub file uses
typing_extensions.CapsuleTypebut does not importtyping_extensions. This will cause a NameError when type checkers or IDEs try to parse this stub file. Addimport typing_extensionsto the imports at the top of the file.
python/src/rocpycv.pyi:789 - The documentation for the
streamparameter incorrectly describes flip code behavior ("0 flips along the x-axis, positive integer flips along the y-axis, and negative integers flip along both axis"). This description belongs to the flip operation, not to the stream parameter. The stream parameter should be documented as the HIP stream to run this operation on.
python/src/rocpycv.pyi:920 - The documentation is incorrect. The
custom_crop_intofunction returns None, not a Tensor. The Returns section should state "None" instead of "rocpycv.Tensor: The output tensor."
python/src/rocpycv.pyi:964 - The documentation for the
flip_codeparameter is incomplete. It states "A flip code representing how images in the batch should be flipped." but ends abruptly without the actual explanation. The full description should explain that 0 flips along the x-axis, positive integer flips along the y-axis, and negative integers flip along both axes.
python/src/rocpycv.pyi:704 - The type annotations in function signatures should not use the
rocpycv.prefix. Within a stub file for the rocpycv module, types should be referenced directly asStreamandTensorinstead ofrocpycv.Streamandrocpycv.Tensor. This pattern appears throughout the file in all function signatures and should be corrected.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Motivation
rocpycvinstall to ensure that no double import occurs (e.g.rocpycv.rocpycv.Tensor)Technical Details
Test Plan
Test Result
Submission Checklist