refactor: add ViewerBuilder#193
Conversation
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp> docs: update tutorial document Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp> feat: adopt builder pattern using ViewerBuilder Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
8a0c425 to
337ccde
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the viewer initialization and configuration logic by introducing a builder pattern to improve flexibility and maintainability. The changes replace direct RerunViewer instantiation with a new ViewerBuilder and ViewerConfig approach, enabling more composable viewer configuration.
- Introduces
ViewerBuilderandViewerConfigclasses for flexible viewer setup - Refactors
RerunViewerto accept configuration objects instead of direct parameters - Updates documentation and helper functions to use the new builder pattern
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
t4_devkit/viewer/config.py |
Defines ViewerConfig class and entity formatting utility |
t4_devkit/viewer/builder.py |
Implements ViewerBuilder for fluent viewer configuration |
t4_devkit/viewer/viewer.py |
Refactors RerunViewer to use configuration-based initialization |
t4_devkit/viewer/__init__.py |
Exports new builder and config modules |
t4_devkit/helper/rendering.py |
Updates helper functions to use ViewerBuilder |
tests/viewer/conftest.py |
Updates test fixtures to use new builder pattern |
tests/viewer/test_viewer.py |
Updates test to include frame_id parameter |
docs/tutorials/render.md |
Updates documentation with new builder API examples |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
37c3af3 to
0667e45
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
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>
0667e45 to
b1e945e
Compare
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
What
This pull request refactors the viewer initialization and configuration logic to use a new builder pattern, improving flexibility and maintainability. The changes introduce a
ViewerBuilderandViewerConfigclass, update documentation and usage examples, and remove legacy configuration code fromRerunViewer. The rendering helper functions and viewer methods are updated to use the new configuration approach.Viewer Initialization and Configuration Refactor:
ViewerBuilderandViewerConfigclasses to encapsulate viewer setup, replacing direct instantiation and configuration ofRerunViewer. This enables a more flexible and composable API for specifying spatial views, labels, and streetmap settings. (t4_devkit/viewer/builder.py,t4_devkit/viewer/config.py,t4_devkit/viewer/__init__.py) [1] [2] [3]RerunViewerto accept aViewerConfigobject, removing legacy arguments (cameras,with_3d, etc.) and related methods (with_labels,with_global_origin). Viewer setup and blueprint construction now rely on the configuration object. (t4_devkit/viewer/viewer.py) [1] [2] [3]t4_devkit/viewer/viewer.py) [1] [2] [3]Documentation and Example Updates:
ViewerBuilderAPI, replacing directRerunViewerconstruction and legacy arguments. (docs/tutorials/render.md) [1] [2]Rendering Helper Function Updates:
t4_devkit/helper/rendering.pyto useViewerBuilderfor viewer creation, removing logic for legacy configuration arguments and improving annotation and streetmap setup. (t4_devkit/helper/rendering.py) [1] [2] [3] [4]Usage