RAI imports convention RFC
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 589
- Forks
- 76
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 3
Description
Summary
This RFC raises the need to define a consistent convention for how imports should be written across the RAI framework. It aims to open a discussion about whether we should favor top-level imports or deep/internal module imports, and to establish a project-wide guideline going forward.
Motivation
As the framework continues to grow in complexity, the current use of imports has become inconsistent. Some modules import components from public, top-level interfaces, while others reach into deep internal paths. Although both styles work, the lack of a unified convention has created:
- A fragmented structure that makes navigation and maintenance harder.
- Inconsistent assumptions about which modules are part of the public API.
- Increased potential for coupling to internal implementation details.
- Creating an import convention now will help maintain the clarity, scalability, and usability of the codebase as the project evolves.
Current situation
Examples of current import styles:
Top-level (public-style):
from rai.communication.ros2 import ROS2ARIConnector
Deep/internal:
from rai.communication.ros2.connectors.ari_connector import ROS2ARIConnector
There is no official guideline or consensus on which style should be preferred.
Open Questions
- Should we expose components via top-level modules and encourage shallow imports?
- Is it acceptable to import directly from deep internal paths within the package?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the two import examples in the issue and inspect how comparable imports are used across the RAI package. The open questions need a project-wide decision before implementation; done means the preferred convention is agreed and recorded as an official guideline.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- developer-experience, documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100