style: update typing#181
Merged
Merged
Conversation
Contributor
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Contributor
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates type annotations and input handling to ensure proper type conversion and validation across the codebase. It introduces stronger typing by using specific Vector types and automatic conversion of input parameters.
- Replaces generic tuple types with specific Vector2/Vector3 types for better type safety
- Adds automatic type conversion using Vector constructors to handle various input formats
- Introduces TYPE_CHECKING imports to avoid circular import issues
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| t4_devkit/viewer/geography.py | Updates function signature to use Vector types and adds automatic conversion of inputs |
| t4_devkit/dataclass/transform.py | Adds Vector3 conversion in translate operations and converts inputs in _format_transform_args |
| t4_devkit/dataclass/trajectory.py | Adds Vector3 conversion for translation operations |
| t4_devkit/dataclass/box.py | Adds Vector3 conversion for position translation |
Comments suppressed due to low confidence (1)
t4_devkit/dataclass/transform.py:1
- Inconsistent type conversion:
arg0(position) is not wrapped withVector3()like other position parameters in this function. For consistency, it should be{\"position\": Vector3(arg0), \"rotation\": to_quaternion(kwargs[\"rotation\"])}.
from __future__ import annotations
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This PR updates typing to ensure that the input is correct.