Skip to content

RAI imports convention RFC #516

@maciejmajek

Description

@maciejmajek

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority/minorLower-priority tasks that can be picked up when time allows or planned for later.request for comments

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions