-
Notifications
You must be signed in to change notification settings - Fork 51
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 ROS2ARIConnectorDeep/internal:
from rai.communication.ros2.connectors.ari_connector import ROS2ARIConnectorThere 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?