refactor(examples, docs): import re-exported symbols through their package API #5216
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.35 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
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 !
zhangyue19921010
CarolinePascal
Summary / Motivation
Follow-up to #5215, stacked on top of it (base:
chore/clean-import-style). That PR set the import convention inAGENTS.mdand applied it tosrc/lerobot. This PR applies it toexamples/anddocs/source/: every symbol that a package re-exports in its__init__.pyis 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| threerollout.pyexamples,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||
GaussianActorPolicyfrommodeling_gaussian_actor|lerobot.policies|tutorial/rl/hilserl_example.py||
RobometerConfig,TOPRewardConfigfrom the reward subpackage,Classifierfrommodeling_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
NOTEin a package__init__.pyare unchanged. These include robot, teleoperator and camera implementations, policy and reward model classes,so_follower.robot_kinematic_processor,LiberoEnv-style env configs,EvalPipelineConfigandrl.gym_manipulator.Not covered
These symbols aren't exported from any package and no
NOTEdocuments them. They're still imported from their modules:envs.configs.HILSerlProcessorConfigpolicies.utils.build_inference_framepolicies.rtc.debug_visualizer.RTCDebugVisualizerteleoperators.phone.config_phone.PhoneOS,teleoperators.phone.phone_processor.MapPhoneActionToRobotActionscripts.lerobot_record.record_loopEach one should either be exported or get a
NOTE. That can be a separate PR.How was this tested
pre-commit runon the changed files passes (ruff, prettier, typos, bandit).from lerobot... import ...line in the changed examples and docs resolves to an existing attribute.examples/anddocs/finds no remaining import of a re-exported symbol from a submodule.