Skip to content

refactor: enable t4_devkit.common to simplify imports#233

Merged
ktro2828 merged 2 commits into
mainfrom
refactor/common/import-all
Nov 19, 2025
Merged

refactor: enable t4_devkit.common to simplify imports#233
ktro2828 merged 2 commits into
mainfrom
refactor/common/import-all

Conversation

@ktro2828

Copy link
Copy Markdown
Collaborator

What

This pull request primarily refactors the t4_devkit.common module to simplify imports and improve documentation consistency. The most significant changes involve consolidating imports through the __init__.py file, updating documentation and tutorial code to use the new import paths, and minor improvements to code clarity and documentation formatting.

Module import refactoring:

  • Added a new __init__.py in t4_devkit/common that imports all public symbols from its submodules, enabling simplified imports like from t4_devkit.common import ... instead of importing from individual submodules.
  • Updated tutorial and documentation code examples to use the new unified import path for functions such as serialize_dataclass, save_json, and load_json. [1] [2] [3]

Documentation and code clarity improvements:

  • Removed outdated or unnecessary API documentation blocks from docs/apis/common.md for a cleaner and more maintainable documentation structure.
  • Added explicit __all__ declarations to t4_devkit.common.serialize and t4_devkit.common.timestamp to define the public API of these modules. [1] [2]

Tutorial formatting:

  • Improved code block formatting in tutorials by adding descriptive titles (e.g., python title="main.py"), and updated warning block syntax for consistency. [1] [2]

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Copilot AI review requested due to automatic review settings November 19, 2025 00:50
@github-actions github-actions Bot added documentation Improvements or additions to documentation refactor Refactoring code or increasing performance labels Nov 19, 2025
@github-actions

Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
3971 3267 82% 50% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
t4_devkit/common/init.py 100% 🟢
t4_devkit/common/serialize.py 100% 🟢
t4_devkit/common/timestamp.py 86% 🟢
TOTAL 95% 🟢

updated for commit: 7e60497 by action🐍

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
3971 3267 82% 50% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
t4_devkit/common/init.py 100% 🟢
t4_devkit/common/serialize.py 100% 🟢
t4_devkit/common/timestamp.py 86% 🟢
TOTAL 95% 🟢

updated for commit: 7e60497 by action🐍

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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__.py to t4_devkit.common that 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 of serialize and timestamp modules

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.

Comment thread t4_devkit/common/__init__.py
Comment thread t4_devkit/common/serialize.py
@ktro2828 ktro2828 merged commit 856ae0e into main Nov 19, 2025
4 of 5 checks passed
@ktro2828 ktro2828 deleted the refactor/common/import-all branch November 19, 2025 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation refactor Refactoring code or increasing performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants