← Back to Pull requests

refactor(examples, docs): import re-exported symbols through their package API #5216

Open
CarolinePascal opened this pull request with 147 lines diff across 43 files
View on GitHub
CarolinePascal CarolinePascal commented on Nov 02, 2026 18:01 UTC
Author

Summary / Motivation

Follow-up to #5215, stacked on top of it (base: chore/clean-import-style). That PR set the import convention in AGENTS.md and applied it to src/lerobot. This PR applies it to examples/ and docs/source/: every symbol that a package re-exports in its __init__.py is now imported from the package, not from one of its files or subpackages.

Changes

| Before | After | Where |
| --- | --- | --- |
| lerobot.model.kinematics.RobotKinematics | lerobot.model | phone_to_so100/, so100_to_so100_EE/, isaac_teleop_to_so101/common.py, action_representations.mdx |
| lerobot.rollout.strategies.BaseStrategy | lerobot.rollout | three rollout.py examples, inference.mdx |
| lerobot.policies.utils.make_robot_action | lerobot.policies | /evaluate.py, tutorial//using__example.py |
| lerobot.policies.rtc.RTCConfig / ActionQueue | lerobot.policies | rtc/eval_dataset.py, rtc.mdx |
| lerobot.policies.factory.make_pre_post_processors | lerobot.policies | flux3.mdx |
| Policy configs (ACTConfig, DiffusionConfig, PI0Config, PI0FastConfig, Flux3Config) from the policy subpackage | lerobot.policies | training/
, tutorial/, flux3/export_base.py, rtc.mdx, pi0fast.mdx |
| GaussianActorPolicy from modeling_gaussian_actor | lerobot.policies | tutorial/rl/hilserl_example.py |
| RobometerConfig, TOPRewardConfig from the reward subpackage, Classifier from modeling_classifier | lerobot.rewards | robometer.mdx, topreward.mdx, hilserl_example.py |
| lerobot.datasets.lerobot_dataset.LeRobotDataset, lerobot.datasets.dataset_metadata.LeRobotDatasetMetadata | lerobot.datasets | flux3/export_base.py, il_robots.mdx, robomme.mdx, tools.mdx |
| lerobot.configs.types.
, lerobot.configs.dataset.DatasetRecordConfig | lerobot.configs | flux3, isaac_teleop_to_so101, omx |
| lerobot.teleoperators.teleoperator.Teleoperator, lerobot.teleoperators.config.TeleoperatorConfig | lerobot.teleoperators | isaac_teleop_to_so101, integrate_hardware.mdx |
| lerobot.robots.robot.Robot | lerobot.robots | omx/reset_environment.py |
| lerobot.motors.damiao.DamiaoMotorsBus | lerobot.motors | damiao.mdx |
| lerobot.rl.algorithms.sac.*, lerobot.rl.buffer.ReplayBuffer | lerobot.rl | hilserl_example.py |
| lerobot.envs.configs.HILSerlRobotEnvConfig | lerobot.envs | hilserl_example.py |
| so_leader.config_so_leader / so_leader.so_leader, keyboard.teleop_keyboard | lerobot.teleoperators.so_leader, lerobot.teleoperators.keyboard | il_robots.mdx, lekiwi/teleoperate.py |

Imports covered by a NOTE in a package __init__.py are unchanged. These include robot, teleoperator and camera implementations, policy and reward model classes, so_follower.robot_kinematic_processor, LiberoEnv-style env configs, EvalPipelineConfig and rl.gym_manipulator.

Not covered

These symbols aren't exported from any package and no NOTE documents them. They're still imported from their modules:

  • envs.configs.HILSerlProcessorConfig

  • policies.utils.build_inference_frame

  • policies.rtc.debug_visualizer.RTCDebugVisualizer

  • teleoperators.phone.config_phone.PhoneOS, teleoperators.phone.phone_processor.MapPhoneActionToRobotAction

  • the robometer, xvla and sarm internals used in the docs

  • scripts.lerobot_record.record_loop
  • Each one should either be exported or get a NOTE. That can be a separate PR.

    How was this tested

  • pre-commit run on the changed files passes (ruff, prettier, typos, bandit).

  • Every rewritten from lerobot... import ... line in the changed examples and docs resolves to an existing attribute.

  • A scan of examples/ and docs/ finds no remaining import of a re-exported symbol from a submodule.
  • Diff: 147 lines (+69 / -78) across 43 files Reviewer: zhangyue19921010 Review duration: 48624m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.68) × (1 − Review Confidence (0.66)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.68 · 147 lines diff across 43 files
    0.68
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.35 · 1 substantive comment(s)
    0.35
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    65%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.299
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    2 items
    zhangyue19921010 zhangyue19921010 commented on Nov 03, 2026 02:46 UTC
    Reviewer

    I checked the import changes against the stacked base and verified that the old and new paths resolve to the same Python objects. I didn’t find any issues that need changes.

    Nice change !

    Assignees
    CarolinePascal CarolinePascal
    Labels
    risk: low confidence: 65.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 68.4% (HIGH) · Higher = larger blast radius
    68.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 65.5% · Lower = rushed or shallow review
    65.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 23.6% · Safe to merge
    23.6%