Commit 577b00f
refactor: address 10 review threads from @awsarron on PR strands-labs#86
1. Rename factory.py → robot.py, robot.py → hardware_robot.py
Eliminates two 'Robot' classes in different files. The factory
function now lives where users expect: strands_robots.robot.Robot
2. Default mode='sim' instead of mode='auto'
Using real hardware should be an explicit decision since it affects
the physical world. Robot('so100') now always returns simulation.
Use mode='real' to explicitly opt into hardware control.
3. Fix ThreadPoolExecutor leak in _async_utils.py
Register atexit.shutdown(wait=False) to clean up the module-level
executor on interpreter exit.
4. Remove redundant list_robots() wrapper
Was a 1-line passthrough to registry.list_robots(). Now __init__.py
points directly to strands_robots.registry.list_robots.
5. Use module names in dataset_recorder docstring
'robot.py' → 'strands_robots.hardware_robot',
'simulation.py' → 'strands_robots.simulation'
6. Make camera shape configurable in dataset_recorder
Added camera_shapes parameter to _build_features() instead of
hardcoding (3, 480, 640). Default preserved for backward compat.
7. Add mode validation — invalid mode raises ValueError
8. Update __init__.py lazy imports for renamed modules
Tests: 230 passed, 10 skipped, 0 failures
Lint: ruff check + ruff format clean1 parent 9af0a55 commit 577b00f
7 files changed
Lines changed: 971 additions & 955 deletions
File tree
- strands_robots
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
183 | 184 | | |
184 | 185 | | |
185 | 186 | | |
| |||
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
202 | 207 | | |
203 | 208 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| |||
This file was deleted.
0 commit comments