refactor: enable t4_devkit.common to simplify imports#233
Merged
Conversation
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Contributor
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
1 similar comment
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 refactors the t4_devkit.common module to enable simplified imports by consolidating submodule exports through a new __init__.py file. This allows users to import common utilities directly from t4_devkit.common rather than from individual submodules, improving the developer experience.
Key changes:
- Added
__init__.pytot4_devkit.commonthat re-exports all public symbols from submodules - Updated documentation and tutorials to use the simplified import pattern
- Added explicit
__all__declarations to define the public API ofserializeandtimestampmodules
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| t4_devkit/common/init.py | New file that consolidates imports from all submodules using wildcard imports |
| t4_devkit/common/serialize.py | Added __all__ declaration to explicitly define exported symbols |
| t4_devkit/common/timestamp.py | Added __all__ declaration to explicitly define exported symbols |
| docs/tutorials/sanity.md | Updated imports to use simplified pattern and improved code block formatting |
| docs/tutorials/customize.md | Updated imports to use simplified pattern from t4_devkit.common |
| docs/tutorials/initialize.md | Fixed warning block syntax from ??? to !!! |
| docs/apis/common.md | Removed detailed API documentation blocks for cleaner structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 pull request primarily refactors the
t4_devkit.commonmodule to simplify imports and improve documentation consistency. The most significant changes involve consolidating imports through the__init__.pyfile, updating documentation and tutorial code to use the new import paths, and minor improvements to code clarity and documentation formatting.Module import refactoring:
__init__.pyint4_devkit/commonthat imports all public symbols from its submodules, enabling simplified imports likefrom t4_devkit.common import ...instead of importing from individual submodules.serialize_dataclass,save_json, andload_json. [1] [2] [3]Documentation and code clarity improvements:
docs/apis/common.mdfor a cleaner and more maintainable documentation structure.__all__declarations tot4_devkit.common.serializeandt4_devkit.common.timestampto define the public API of these modules. [1] [2]Tutorial formatting:
python title="main.py"), and updated warning block syntax for consistency. [1] [2]