From 8a64d8268b821a3a8fee202134be1b8c42af9a1c Mon Sep 17 00:00:00 2001 From: Steven Palma Date: Mon, 10 Mar 2025 19:00:23 +0100 Subject: [PATCH 1/6] chore(deps): remove hydra dependency (#842) --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a4458eb6..9c4b6f47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,6 @@ dependencies = [ "gymnasium==0.29.1", # TODO(rcadene, aliberts): Make gym 1.0.0 work "h5py>=3.10.0", "huggingface-hub[hf-transfer,cli]>=0.27.1 ; python_version < '4.0'", - "hydra-core>=1.3.2", "imageio[ffmpeg]>=2.34.0", "jsonlines>=4.0.0", "numba>=0.59.0", From 12f52632ed4a74eacdfb766f217f60cb07337ce2 Mon Sep 17 00:00:00 2001 From: Steven Palma Date: Mon, 10 Mar 2025 21:03:33 +0100 Subject: [PATCH 2/6] chore(docs): update instructions for change in device and use_amp (#843) --- README.md | 4 +-- examples/10_use_so100.md | 12 +++---- examples/11_use_lekiwi.md | 40 +++++++++++------------ examples/11_use_moss.md | 12 +++---- examples/4_train_policy_with_script.md | 2 +- examples/7_get_started_with_real_robot.md | 12 +++---- examples/9_use_aloha.md | 4 +-- 7 files changed, 43 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index b16e3469..effbb08b 100644 --- a/README.md +++ b/README.md @@ -232,8 +232,8 @@ python lerobot/scripts/eval.py \ --env.type=pusht \ --eval.batch_size=10 \ --eval.n_episodes=10 \ - --use_amp=false \ - --device=cuda + --policy.use_amp=false \ + --policy.device=cuda ``` Note: After training your own policy, you can re-evaluate the checkpoints with: diff --git a/examples/10_use_so100.md b/examples/10_use_so100.md index b63eb146..b8b45aa5 100644 --- a/examples/10_use_so100.md +++ b/examples/10_use_so100.md @@ -454,8 +454,8 @@ Next, you'll need to calibrate your SO-100 robot to ensure that the leader and f You will need to move the follower arm to these positions sequentially: -| 1. Zero position | 2. Rotated position | 3. Rest position | -|---|---|---| +| 1. Zero position | 2. Rotated position | 3. Rest position | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | | SO-100 follower arm zero position | SO-100 follower arm rotated position | SO-100 follower arm rest position | Make sure both arms are connected and run this script to launch manual calibration: @@ -470,8 +470,8 @@ python lerobot/scripts/control_robot.py \ #### b. Manual calibration of leader arm Follow step 6 of the [assembly video](https://youtu.be/FioA2oeFZ5I?t=724) which illustrates the manual calibration. You will need to move the leader arm to these positions sequentially: -| 1. Zero position | 2. Rotated position | 3. Rest position | -|---|---|---| +| 1. Zero position | 2. Rotated position | 3. Rest position | +| ------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | | SO-100 leader arm zero position | SO-100 leader arm rotated position | SO-100 leader arm rest position | Run this script to launch manual calibration: @@ -571,14 +571,14 @@ python lerobot/scripts/train.py \ --policy.type=act \ --output_dir=outputs/train/act_so100_test \ --job_name=act_so100_test \ - --device=cuda \ + --policy.device=cuda \ --wandb.enable=true ``` Let's explain it: 1. We provided the dataset as argument with `--dataset.repo_id=${HF_USER}/so100_test`. 2. We provided the policy with `policy.type=act`. This loads configurations from [`configuration_act.py`](../lerobot/common/policies/act/configuration_act.py). Importantly, this policy will automatically adapt to the number of motor sates, motor actions and cameras of your robot (e.g. `laptop` and `phone`) which have been saved in your dataset. -4. We provided `device=cuda` since we are training on a Nvidia GPU, but you could use `device=mps` to train on Apple silicon. +4. We provided `policy.device=cuda` since we are training on a Nvidia GPU, but you could use `policy.device=mps` to train on Apple silicon. 5. We provided `wandb.enable=true` to use [Weights and Biases](https://docs.wandb.ai/quickstart) for visualizing training plots. This is optional but if you use it, make sure you are logged in by running `wandb login`. Training should take several hours. You will find checkpoints in `outputs/train/act_so100_test/checkpoints`. diff --git a/examples/11_use_lekiwi.md b/examples/11_use_lekiwi.md index 4b811417..dc310af2 100644 --- a/examples/11_use_lekiwi.md +++ b/examples/11_use_lekiwi.md @@ -366,8 +366,8 @@ Now we have to calibrate the leader arm and the follower arm. The wheel motors d You will need to move the follower arm to these positions sequentially: -| 1. Zero position | 2. Rotated position | 3. Rest position | -|---|---|---| +| 1. Zero position | 2. Rotated position | 3. Rest position | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | SO-100 follower arm zero position | SO-100 follower arm rotated position | SO-100 follower arm rest position | Make sure the arm is connected to the Raspberry Pi and run this script (on the Raspberry Pi) to launch manual calibration: @@ -385,8 +385,8 @@ If you have the **wired** LeKiwi version please run all commands including this ### Calibrate leader arm Then to calibrate the leader arm (which is attached to the laptop/pc). You will need to move the leader arm to these positions sequentially: -| 1. Zero position | 2. Rotated position | 3. Rest position | -|---|---|---| +| 1. Zero position | 2. Rotated position | 3. Rest position | +| ------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | | SO-100 leader arm zero position | SO-100 leader arm rotated position | SO-100 leader arm rest position | Run this script (on your laptop/pc) to launch manual calibration: @@ -416,22 +416,22 @@ python lerobot/scripts/control_robot.py \ You should see on your laptop something like this: ```[INFO] Connected to remote robot at tcp://172.17.133.91:5555 and video stream at tcp://172.17.133.91:5556.``` Now you can move the leader arm and use the keyboard (w,a,s,d) to drive forward, left, backwards, right. And use (z,x) to turn left or turn right. You can use (r,f) to increase and decrease the speed of the mobile robot. There are three speed modes, see the table below: | Speed Mode | Linear Speed (m/s) | Rotation Speed (deg/s) | -|------------|-------------------|-----------------------| -| Fast | 0.4 | 90 | -| Medium | 0.25 | 60 | -| Slow | 0.1 | 30 | +| ---------- | ------------------ | ---------------------- | +| Fast | 0.4 | 90 | +| Medium | 0.25 | 60 | +| Slow | 0.1 | 30 | -| Key | Action | -|------|--------------------------------| -| W | Move forward | -| A | Move left | -| S | Move backward | -| D | Move right | -| Z | Turn left | -| X | Turn right | -| R | Increase speed | -| F | Decrease speed | +| Key | Action | +| --- | -------------- | +| W | Move forward | +| A | Move left | +| S | Move backward | +| D | Move right | +| Z | Turn left | +| X | Turn right | +| R | Increase speed | +| F | Decrease speed | > [!TIP] > If you use a different keyboard you can change the keys for each command in the [`LeKiwiRobotConfig`](../lerobot/common/robot_devices/robots/configs.py). @@ -549,14 +549,14 @@ python lerobot/scripts/train.py \ --policy.type=act \ --output_dir=outputs/train/act_lekiwi_test \ --job_name=act_lekiwi_test \ - --device=cuda \ + --policy.device=cuda \ --wandb.enable=true ``` Let's explain it: 1. We provided the dataset as argument with `--dataset.repo_id=${HF_USER}/lekiwi_test`. 2. We provided the policy with `policy.type=act`. This loads configurations from [`configuration_act.py`](../lerobot/common/policies/act/configuration_act.py). Importantly, this policy will automatically adapt to the number of motor sates, motor actions and cameras of your robot (e.g. `laptop` and `phone`) which have been saved in your dataset. -4. We provided `device=cuda` since we are training on a Nvidia GPU, but you could use `device=mps` to train on Apple silicon. +4. We provided `policy.device=cuda` since we are training on a Nvidia GPU, but you could use `policy.device=mps` to train on Apple silicon. 5. We provided `wandb.enable=true` to use [Weights and Biases](https://docs.wandb.ai/quickstart) for visualizing training plots. This is optional but if you use it, make sure you are logged in by running `wandb login`. Training should take several hours. You will find checkpoints in `outputs/train/act_lekiwi_test/checkpoints`. diff --git a/examples/11_use_moss.md b/examples/11_use_moss.md index 67f8157e..d2e02076 100644 --- a/examples/11_use_moss.md +++ b/examples/11_use_moss.md @@ -176,8 +176,8 @@ Next, you'll need to calibrate your Moss v1 robot to ensure that the leader and You will need to move the follower arm to these positions sequentially: -| 1. Zero position | 2. Rotated position | 3. Rest position | -|---|---|---| +| 1. Zero position | 2. Rotated position | 3. Rest position | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Moss v1 follower arm zero position | Moss v1 follower arm rotated position | Moss v1 follower arm rest position | Make sure both arms are connected and run this script to launch manual calibration: @@ -192,8 +192,8 @@ python lerobot/scripts/control_robot.py \ **Manual calibration of leader arm** Follow step 6 of the [assembly video](https://www.youtube.com/watch?v=DA91NJOtMic) which illustrates the manual calibration. You will need to move the leader arm to these positions sequentially: -| 1. Zero position | 2. Rotated position | 3. Rest position | -|---|---|---| +| 1. Zero position | 2. Rotated position | 3. Rest position | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | Moss v1 leader arm zero position | Moss v1 leader arm rotated position | Moss v1 leader arm rest position | Run this script to launch manual calibration: @@ -293,14 +293,14 @@ python lerobot/scripts/train.py \ --policy.type=act \ --output_dir=outputs/train/act_moss_test \ --job_name=act_moss_test \ - --device=cuda \ + --policy.device=cuda \ --wandb.enable=true ``` Let's explain it: 1. We provided the dataset as argument with `--dataset.repo_id=${HF_USER}/moss_test`. 2. We provided the policy with `policy.type=act`. This loads configurations from [`configuration_act.py`](../lerobot/common/policies/act/configuration_act.py). Importantly, this policy will automatically adapt to the number of motor sates, motor actions and cameras of your robot (e.g. `laptop` and `phone`) which have been saved in your dataset. -4. We provided `device=cuda` since we are training on a Nvidia GPU, but you could use `device=mps` to train on Apple silicon. +4. We provided `policy.device=cuda` since we are training on a Nvidia GPU, but you could use `policy.device=mps` to train on Apple silicon. 5. We provided `wandb.enable=true` to use [Weights and Biases](https://docs.wandb.ai/quickstart) for visualizing training plots. This is optional but if you use it, make sure you are logged in by running `wandb login`. Training should take several hours. You will find checkpoints in `outputs/train/act_moss_test/checkpoints`. diff --git a/examples/4_train_policy_with_script.md b/examples/4_train_policy_with_script.md index 58ed239a..b23d2271 100644 --- a/examples/4_train_policy_with_script.md +++ b/examples/4_train_policy_with_script.md @@ -1,5 +1,5 @@ This tutorial will explain the training script, how to use it, and particularly how to configure everything needed for the training run. -> **Note:** The following assume you're running these commands on a machine equipped with a cuda GPU. If you don't have one (or if you're using a Mac), you can add `--device=cpu` (`--device=mps` respectively). However, be advised that the code executes much slower on cpu. +> **Note:** The following assume you're running these commands on a machine equipped with a cuda GPU. If you don't have one (or if you're using a Mac), you can add `--policy.device=cpu` (`--policy.device=mps` respectively). However, be advised that the code executes much slower on cpu. ## The training script diff --git a/examples/7_get_started_with_real_robot.md b/examples/7_get_started_with_real_robot.md index f4bef69c..894c44a3 100644 --- a/examples/7_get_started_with_real_robot.md +++ b/examples/7_get_started_with_real_robot.md @@ -386,14 +386,14 @@ When you connect your robot for the first time, the [`ManipulatorRobot`](../lero Here are the positions you'll move the follower arm to: -| 1. Zero position | 2. Rotated position | 3. Rest position | -|---|---|---| +| 1. Zero position | 2. Rotated position | 3. Rest position | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Koch v1.1 follower arm zero position | Koch v1.1 follower arm rotated position | Koch v1.1 follower arm rest position | And here are the corresponding positions for the leader arm: -| 1. Zero position | 2. Rotated position | 3. Rest position | -|---|---|---| +| 1. Zero position | 2. Rotated position | 3. Rest position | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | Koch v1.1 leader arm zero position | Koch v1.1 leader arm rotated position | Koch v1.1 leader arm rest position | You can watch a [video tutorial of the calibration procedure](https://youtu.be/8drnU9uRY24) for more details. @@ -898,14 +898,14 @@ python lerobot/scripts/train.py \ --policy.type=act \ --output_dir=outputs/train/act_koch_test \ --job_name=act_koch_test \ - --device=cuda \ + --policy.device=cuda \ --wandb.enable=true ``` Let's explain it: 1. We provided the dataset as argument with `--dataset.repo_id=${HF_USER}/koch_test`. 2. We provided the policy with `policy.type=act`. This loads configurations from [`configuration_act.py`](../lerobot/common/policies/act/configuration_act.py). Importantly, this policy will automatically adapt to the number of motor sates, motor actions and cameras of your robot (e.g. `laptop` and `phone`) which have been saved in your dataset. -4. We provided `device=cuda` since we are training on a Nvidia GPU, but you could use `device=mps` to train on Apple silicon. +4. We provided `policy.device=cuda` since we are training on a Nvidia GPU, but you could use `policy.device=mps` to train on Apple silicon. 5. We provided `wandb.enable=true` to use [Weights and Biases](https://docs.wandb.ai/quickstart) for visualizing training plots. This is optional but if you use it, make sure you are logged in by running `wandb login`. For more information on the `train` script see the previous tutorial: [`examples/4_train_policy_with_script.md`](../examples/4_train_policy_with_script.md) diff --git a/examples/9_use_aloha.md b/examples/9_use_aloha.md index 055551f0..62dee588 100644 --- a/examples/9_use_aloha.md +++ b/examples/9_use_aloha.md @@ -135,14 +135,14 @@ python lerobot/scripts/train.py \ --policy.type=act \ --output_dir=outputs/train/act_aloha_test \ --job_name=act_aloha_test \ - --device=cuda \ + --policy.device=cuda \ --wandb.enable=true ``` Let's explain it: 1. We provided the dataset as argument with `--dataset.repo_id=${HF_USER}/aloha_test`. 2. We provided the policy with `policy.type=act`. This loads configurations from [`configuration_act.py`](../lerobot/common/policies/act/configuration_act.py). Importantly, this policy will automatically adapt to the number of motor sates, motor actions and cameras of your robot (e.g. `laptop` and `phone`) which have been saved in your dataset. -4. We provided `device=cuda` since we are training on a Nvidia GPU, but you could use `device=mps` to train on Apple silicon. +4. We provided `policy.device=cuda` since we are training on a Nvidia GPU, but you could use `policy.device=mps` to train on Apple silicon. 5. We provided `wandb.enable=true` to use [Weights and Biases](https://docs.wandb.ai/quickstart) for visualizing training plots. This is optional but if you use it, make sure you are logged in by running `wandb login`. For more information on the `train` script see the previous tutorial: [`examples/4_train_policy_with_script.md`](../examples/4_train_policy_with_script.md) From f994febca4ee747dbc5e292a5519aa13002fee15 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 11:28:01 +0100 Subject: [PATCH 3/6] [pre-commit.ci] pre-commit autoupdate (#844) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 21016efa..868813bc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/crate-ci/typos - rev: v1.30.0 + rev: v1 hooks: - id: typos args: [--force-exclude] @@ -38,7 +38,7 @@ repos: hooks: - id: pyupgrade - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.9 + rev: v0.9.10 hooks: - id: ruff args: [--fix] From c37b1d45b6bf5b26bf9e507aead77fb4839fa11a Mon Sep 17 00:00:00 2001 From: Ermano Arruda Date: Thu, 13 Mar 2025 09:28:29 +0000 Subject: [PATCH 4/6] parametrise tolerance_s in visualize_dataset scripts (#716) --- lerobot/scripts/visualize_dataset.py | 14 +++++++++++++- lerobot/scripts/visualize_dataset_html.py | 18 +++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/lerobot/scripts/visualize_dataset.py b/lerobot/scripts/visualize_dataset.py index 11feb1af..cdfea6b8 100644 --- a/lerobot/scripts/visualize_dataset.py +++ b/lerobot/scripts/visualize_dataset.py @@ -265,13 +265,25 @@ def main(): ), ) + parser.add_argument( + "--tolerance-s", + type=float, + default=1e-4, + help=( + "Tolerance in seconds used to ensure data timestamps respect the dataset fps value" + "This is argument passed to the constructor of LeRobotDataset and maps to its tolerance_s constructor argument" + "If not given, defaults to 1e-4." + ), + ) + args = parser.parse_args() kwargs = vars(args) repo_id = kwargs.pop("repo_id") root = kwargs.pop("root") + tolerance_s = kwargs.pop("tolerance_s") logging.info("Loading dataset") - dataset = LeRobotDataset(repo_id, root=root) + dataset = LeRobotDataset(repo_id, root=root, tolerance_s=tolerance_s) visualize_dataset(dataset, **vars(args)) diff --git a/lerobot/scripts/visualize_dataset_html.py b/lerobot/scripts/visualize_dataset_html.py index f944144a..0fc21a8f 100644 --- a/lerobot/scripts/visualize_dataset_html.py +++ b/lerobot/scripts/visualize_dataset_html.py @@ -446,15 +446,31 @@ def main(): help="Delete the output directory if it exists already.", ) + parser.add_argument( + "--tolerance-s", + type=float, + default=1e-4, + help=( + "Tolerance in seconds used to ensure data timestamps respect the dataset fps value" + "This is argument passed to the constructor of LeRobotDataset and maps to its tolerance_s constructor argument" + "If not given, defaults to 1e-4." + ), + ) + args = parser.parse_args() kwargs = vars(args) repo_id = kwargs.pop("repo_id") load_from_hf_hub = kwargs.pop("load_from_hf_hub") root = kwargs.pop("root") + tolerance_s = kwargs.pop("tolerance_s") dataset = None if repo_id: - dataset = LeRobotDataset(repo_id, root=root) if not load_from_hf_hub else get_dataset_info(repo_id) + dataset = ( + LeRobotDataset(repo_id, root=root, tolerance_s=tolerance_s) + if not load_from_hf_hub + else get_dataset_info(repo_id) + ) visualize_dataset_html(dataset, **vars(args)) From a36ed39487dfc46c44290bd97ecc39be755777db Mon Sep 17 00:00:00 2001 From: Simon Alibert <75076266+aliberts@users.noreply.github.com> Date: Thu, 13 Mar 2025 13:29:55 +0100 Subject: [PATCH 5/6] Improve pre-commit config (#857) --- .pre-commit-config.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 868813bc..395637d9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,6 +16,13 @@ exclude: ^(tests/data) default_language_version: python: python3.10 repos: + ##### Meta ##### + - repo: meta + hooks: + - id: check-useless-excludes + - id: check-hooks-apply + + ##### Style / Misc. ##### - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 @@ -28,15 +35,18 @@ repos: - id: check-toml - id: end-of-file-fixer - id: trailing-whitespace + - repo: https://github.com/crate-ci/typos - rev: v1 + rev: v1.30.2 hooks: - id: typos args: [--force-exclude] + - repo: https://github.com/asottile/pyupgrade rev: v3.19.1 hooks: - id: pyupgrade + - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.9.10 hooks: @@ -44,15 +54,18 @@ repos: args: [--fix] - id: ruff-format + ##### Security ##### - repo: https://github.com/gitleaks/gitleaks rev: v8.24.0 hooks: - id: gitleaks + - repo: https://github.com/woodruffw/zizmor-pre-commit rev: v1.4.1 hooks: - id: zizmor + - repo: https://github.com/PyCQA/bandit rev: 1.8.3 hooks: From 974028bd28c81868ed0fd0b5251cbd907cebf9ec Mon Sep 17 00:00:00 2001 From: Simon Alibert <75076266+aliberts@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:05:55 +0100 Subject: [PATCH 6/6] Organize test folders (#856) Co-authored-by: Steven Palma --- .dockerignore | 2 +- .gitignore | 2 +- .pre-commit-config.yaml | 2 +- CONTRIBUTING.md | 2 +- .../robot_devices/cameras/intelrealsense.py | 10 ++--- .../common/robot_devices/cameras/opencv.py | 8 ++-- .../common/robot_devices/motors/dynamixel.py | 12 +++--- .../common/robot_devices/motors/feetech.py | 12 +++--- pyproject.toml | 25 +----------- .../frame_0.safetensors | 0 .../frame_1.safetensors | 0 .../frame_250.safetensors | 0 .../frame_251.safetensors | 0 .../frame_498.safetensors | 0 .../frame_499.safetensors | 0 .../lerobot/pusht/frame_0.safetensors | 0 .../lerobot/pusht/frame_1.safetensors | 0 .../lerobot/pusht/frame_159.safetensors | 0 .../lerobot/pusht/frame_160.safetensors | 0 .../lerobot/pusht/frame_80.safetensors | 0 .../lerobot/pusht/frame_81.safetensors | 0 .../xarm_lift_medium/frame_0.safetensors | 0 .../xarm_lift_medium/frame_1.safetensors | 0 .../xarm_lift_medium/frame_12.safetensors | 0 .../xarm_lift_medium/frame_13.safetensors | 0 .../xarm_lift_medium/frame_23.safetensors | 0 .../xarm_lift_medium/frame_24.safetensors | 0 .../datasets}/save_dataset_to_safetensors.py | 4 +- .../default_transforms.safetensors | 0 .../save_image_transforms_to_safetensors.py | 2 +- .../single_transforms.safetensors | 0 .../actions.safetensors | 0 .../grad_stats.safetensors | 0 .../output_dict.safetensors | 0 .../param_stats.safetensors | 0 .../actions.safetensors | 0 .../grad_stats.safetensors | 0 .../output_dict.safetensors | 0 .../param_stats.safetensors | 0 .../pusht_diffusion_/actions.safetensors | 0 .../pusht_diffusion_/grad_stats.safetensors | 0 .../pusht_diffusion_/output_dict.safetensors | 0 .../pusht_diffusion_/param_stats.safetensors | 0 .../policies}/save_policy_to_safetensors.py | 2 +- .../actions.safetensors | 0 .../grad_stats.safetensors | 0 .../output_dict.safetensors | 0 .../param_stats.safetensors | 0 .../actions.safetensors | 0 .../grad_stats.safetensors | 0 .../output_dict.safetensors | 0 .../param_stats.safetensors | 0 tests/{ => cameras}/mock_cv2.py | 0 tests/{ => cameras}/mock_pyrealsense2.py | 0 tests/{ => cameras}/test_cameras.py | 2 +- tests/{ => datasets}/test_compute_stats.py | 0 tests/{ => datasets}/test_datasets.py | 4 +- tests/{ => datasets}/test_delta_timestamps.py | 0 tests/{ => datasets}/test_image_transforms.py | 2 +- tests/{ => datasets}/test_image_writer.py | 0 tests/{ => datasets}/test_online_buffer.py | 0 tests/{ => datasets}/test_sampler.py | 0 tests/{ => datasets}/test_utils.py | 27 +++++++++++-- .../{ => datasets}/test_visualize_dataset.py | 0 tests/{ => envs}/test_envs.py | 3 +- tests/{ => examples}/test_examples.py | 0 tests/lerobot/common/datasets/test_utils.py | 38 ------------------- tests/{ => motors}/mock_dynamixel_sdk.py | 0 tests/{ => motors}/mock_scservo_sdk.py | 0 tests/{ => motors}/test_motors.py | 0 tests/{ => optim}/test_optimizers.py | 0 tests/{ => optim}/test_schedulers.py | 0 tests/{ => policies}/test_policies.py | 8 ++-- tests/{ => robots}/test_control_robot.py | 2 +- tests/{ => robots}/test_robots.py | 0 tests/{ => utils}/test_io_utils.py | 0 tests/{ => utils}/test_logging_utils.py | 0 tests/{ => utils}/test_random_utils.py | 0 tests/{ => utils}/test_train_utils.py | 0 79 files changed, 63 insertions(+), 106 deletions(-) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/aloha_sim_insertion_human/frame_0.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/aloha_sim_insertion_human/frame_1.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/aloha_sim_insertion_human/frame_250.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/aloha_sim_insertion_human/frame_251.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/aloha_sim_insertion_human/frame_498.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/aloha_sim_insertion_human/frame_499.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/pusht/frame_0.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/pusht/frame_1.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/pusht/frame_159.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/pusht/frame_160.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/pusht/frame_80.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/pusht/frame_81.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/xarm_lift_medium/frame_0.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/xarm_lift_medium/frame_1.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/xarm_lift_medium/frame_12.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/xarm_lift_medium/frame_13.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/xarm_lift_medium/frame_23.safetensors (100%) rename tests/{data/save_dataset_to_safetensors => artifacts/datasets}/lerobot/xarm_lift_medium/frame_24.safetensors (100%) rename tests/{scripts => artifacts/datasets}/save_dataset_to_safetensors.py (95%) rename tests/{data/save_image_transforms_to_safetensors => artifacts/image_transforms}/default_transforms.safetensors (100%) rename tests/{scripts => artifacts/image_transforms}/save_image_transforms_to_safetensors.py (97%) rename tests/{data/save_image_transforms_to_safetensors => artifacts/image_transforms}/single_transforms.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/aloha_sim_insertion_human_act_/actions.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/aloha_sim_insertion_human_act_/grad_stats.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/aloha_sim_insertion_human_act_/output_dict.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/aloha_sim_insertion_human_act_/param_stats.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/aloha_sim_insertion_human_act_1000_steps/actions.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/aloha_sim_insertion_human_act_1000_steps/grad_stats.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/aloha_sim_insertion_human_act_1000_steps/output_dict.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/aloha_sim_insertion_human_act_1000_steps/param_stats.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/pusht_diffusion_/actions.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/pusht_diffusion_/grad_stats.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/pusht_diffusion_/output_dict.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/pusht_diffusion_/param_stats.safetensors (100%) rename tests/{scripts => artifacts/policies}/save_policy_to_safetensors.py (98%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/xarm_lift_medium_tdmpc_use_mpc/actions.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/xarm_lift_medium_tdmpc_use_mpc/grad_stats.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/xarm_lift_medium_tdmpc_use_mpc/output_dict.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/xarm_lift_medium_tdmpc_use_mpc/param_stats.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/xarm_lift_medium_tdmpc_use_policy/actions.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/xarm_lift_medium_tdmpc_use_policy/grad_stats.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/xarm_lift_medium_tdmpc_use_policy/output_dict.safetensors (100%) rename tests/{data/save_policy_to_safetensors => artifacts/policies}/xarm_lift_medium_tdmpc_use_policy/param_stats.safetensors (100%) rename tests/{ => cameras}/mock_cv2.py (100%) rename tests/{ => cameras}/mock_pyrealsense2.py (100%) rename tests/{ => cameras}/test_cameras.py (99%) rename tests/{ => datasets}/test_compute_stats.py (100%) rename tests/{ => datasets}/test_datasets.py (99%) rename tests/{ => datasets}/test_delta_timestamps.py (100%) rename tests/{ => datasets}/test_image_transforms.py (99%) rename tests/{ => datasets}/test_image_writer.py (100%) rename tests/{ => datasets}/test_online_buffer.py (100%) rename tests/{ => datasets}/test_sampler.py (100%) rename tests/{ => datasets}/test_utils.py (65%) rename tests/{ => datasets}/test_visualize_dataset.py (100%) rename tests/{ => envs}/test_envs.py (98%) rename tests/{ => examples}/test_examples.py (100%) delete mode 100644 tests/lerobot/common/datasets/test_utils.py rename tests/{ => motors}/mock_dynamixel_sdk.py (100%) rename tests/{ => motors}/mock_scservo_sdk.py (100%) rename tests/{ => motors}/test_motors.py (100%) rename tests/{ => optim}/test_optimizers.py (100%) rename tests/{ => optim}/test_schedulers.py (100%) rename tests/{ => policies}/test_policies.py (98%) rename tests/{ => robots}/test_control_robot.py (99%) rename tests/{ => robots}/test_robots.py (100%) rename tests/{ => utils}/test_io_utils.py (100%) rename tests/{ => utils}/test_logging_utils.py (100%) rename tests/{ => utils}/test_random_utils.py (100%) rename tests/{ => utils}/test_train_utils.py (100%) diff --git a/.dockerignore b/.dockerignore index 4f074d44..c0d8a84b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -73,7 +73,7 @@ pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports -!tests/data +!tests/artifacts htmlcov/ .tox/ .nox/ diff --git a/.gitignore b/.gitignore index da4b1089..d6c51c90 100644 --- a/.gitignore +++ b/.gitignore @@ -78,7 +78,7 @@ pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports -!tests/data +!tests/artifacts htmlcov/ .tox/ .nox/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 395637d9..e699f543 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -exclude: ^(tests/data) +exclude: "tests/artifacts/.*\\.safetensors$" default_language_version: python: python3.10 repos: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8aff26d8..a9e4a856 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -291,7 +291,7 @@ sudo apt-get install git-lfs git lfs install ``` -Pull artifacts if they're not in [tests/data](tests/data) +Pull artifacts if they're not in [tests/artifacts](tests/artifacts) ```bash git lfs pull ``` diff --git a/lerobot/common/robot_devices/cameras/intelrealsense.py b/lerobot/common/robot_devices/cameras/intelrealsense.py index d9c57aa2..7a21661a 100644 --- a/lerobot/common/robot_devices/cameras/intelrealsense.py +++ b/lerobot/common/robot_devices/cameras/intelrealsense.py @@ -48,7 +48,7 @@ def find_cameras(raise_when_empty=True, mock=False) -> list[dict]: connected to the computer. """ if mock: - import tests.mock_pyrealsense2 as rs + import tests.cameras.mock_pyrealsense2 as rs else: import pyrealsense2 as rs @@ -100,7 +100,7 @@ def save_images_from_cameras( serial_numbers = [cam["serial_number"] for cam in camera_infos] if mock: - import tests.mock_cv2 as cv2 + import tests.cameras.mock_cv2 as cv2 else: import cv2 @@ -253,7 +253,7 @@ class IntelRealSenseCamera: self.logs = {} if self.mock: - import tests.mock_cv2 as cv2 + import tests.cameras.mock_cv2 as cv2 else: import cv2 @@ -287,7 +287,7 @@ class IntelRealSenseCamera: ) if self.mock: - import tests.mock_pyrealsense2 as rs + import tests.cameras.mock_pyrealsense2 as rs else: import pyrealsense2 as rs @@ -375,7 +375,7 @@ class IntelRealSenseCamera: ) if self.mock: - import tests.mock_cv2 as cv2 + import tests.cameras.mock_cv2 as cv2 else: import cv2 diff --git a/lerobot/common/robot_devices/cameras/opencv.py b/lerobot/common/robot_devices/cameras/opencv.py index 173f3f1a..f279f315 100644 --- a/lerobot/common/robot_devices/cameras/opencv.py +++ b/lerobot/common/robot_devices/cameras/opencv.py @@ -80,7 +80,7 @@ def _find_cameras( possible_camera_ids: list[int | str], raise_when_empty=False, mock=False ) -> list[int | str]: if mock: - import tests.mock_cv2 as cv2 + import tests.cameras.mock_cv2 as cv2 else: import cv2 @@ -269,7 +269,7 @@ class OpenCVCamera: self.logs = {} if self.mock: - import tests.mock_cv2 as cv2 + import tests.cameras.mock_cv2 as cv2 else: import cv2 @@ -286,7 +286,7 @@ class OpenCVCamera: raise RobotDeviceAlreadyConnectedError(f"OpenCVCamera({self.camera_index}) is already connected.") if self.mock: - import tests.mock_cv2 as cv2 + import tests.cameras.mock_cv2 as cv2 else: import cv2 @@ -398,7 +398,7 @@ class OpenCVCamera: # so we convert the image color from BGR to RGB. if requested_color_mode == "rgb": if self.mock: - import tests.mock_cv2 as cv2 + import tests.cameras.mock_cv2 as cv2 else: import cv2 diff --git a/lerobot/common/robot_devices/motors/dynamixel.py b/lerobot/common/robot_devices/motors/dynamixel.py index 186f7124..6096ceb5 100644 --- a/lerobot/common/robot_devices/motors/dynamixel.py +++ b/lerobot/common/robot_devices/motors/dynamixel.py @@ -332,7 +332,7 @@ class DynamixelMotorsBus: ) if self.mock: - import tests.mock_dynamixel_sdk as dxl + import tests.motors.mock_dynamixel_sdk as dxl else: import dynamixel_sdk as dxl @@ -356,7 +356,7 @@ class DynamixelMotorsBus: def reconnect(self): if self.mock: - import tests.mock_dynamixel_sdk as dxl + import tests.motors.mock_dynamixel_sdk as dxl else: import dynamixel_sdk as dxl @@ -646,7 +646,7 @@ class DynamixelMotorsBus: def read_with_motor_ids(self, motor_models, motor_ids, data_name, num_retry=NUM_READ_RETRY): if self.mock: - import tests.mock_dynamixel_sdk as dxl + import tests.motors.mock_dynamixel_sdk as dxl else: import dynamixel_sdk as dxl @@ -691,7 +691,7 @@ class DynamixelMotorsBus: start_time = time.perf_counter() if self.mock: - import tests.mock_dynamixel_sdk as dxl + import tests.motors.mock_dynamixel_sdk as dxl else: import dynamixel_sdk as dxl @@ -757,7 +757,7 @@ class DynamixelMotorsBus: def write_with_motor_ids(self, motor_models, motor_ids, data_name, values, num_retry=NUM_WRITE_RETRY): if self.mock: - import tests.mock_dynamixel_sdk as dxl + import tests.motors.mock_dynamixel_sdk as dxl else: import dynamixel_sdk as dxl @@ -793,7 +793,7 @@ class DynamixelMotorsBus: start_time = time.perf_counter() if self.mock: - import tests.mock_dynamixel_sdk as dxl + import tests.motors.mock_dynamixel_sdk as dxl else: import dynamixel_sdk as dxl diff --git a/lerobot/common/robot_devices/motors/feetech.py b/lerobot/common/robot_devices/motors/feetech.py index 7d0d2a00..64c7f413 100644 --- a/lerobot/common/robot_devices/motors/feetech.py +++ b/lerobot/common/robot_devices/motors/feetech.py @@ -313,7 +313,7 @@ class FeetechMotorsBus: ) if self.mock: - import tests.mock_scservo_sdk as scs + import tests.motors.mock_scservo_sdk as scs else: import scservo_sdk as scs @@ -337,7 +337,7 @@ class FeetechMotorsBus: def reconnect(self): if self.mock: - import tests.mock_scservo_sdk as scs + import tests.motors.mock_scservo_sdk as scs else: import scservo_sdk as scs @@ -664,7 +664,7 @@ class FeetechMotorsBus: def read_with_motor_ids(self, motor_models, motor_ids, data_name, num_retry=NUM_READ_RETRY): if self.mock: - import tests.mock_scservo_sdk as scs + import tests.motors.mock_scservo_sdk as scs else: import scservo_sdk as scs @@ -702,7 +702,7 @@ class FeetechMotorsBus: def read(self, data_name, motor_names: str | list[str] | None = None): if self.mock: - import tests.mock_scservo_sdk as scs + import tests.motors.mock_scservo_sdk as scs else: import scservo_sdk as scs @@ -782,7 +782,7 @@ class FeetechMotorsBus: def write_with_motor_ids(self, motor_models, motor_ids, data_name, values, num_retry=NUM_WRITE_RETRY): if self.mock: - import tests.mock_scservo_sdk as scs + import tests.motors.mock_scservo_sdk as scs else: import scservo_sdk as scs @@ -818,7 +818,7 @@ class FeetechMotorsBus: start_time = time.perf_counter() if self.mock: - import tests.mock_scservo_sdk as scs + import tests.motors.mock_scservo_sdk as scs else: import scservo_sdk as scs diff --git a/pyproject.toml b/pyproject.toml index 9c4b6f47..19a5cffa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,30 +102,7 @@ requires-poetry = ">=2.1" [tool.ruff] line-length = 110 target-version = "py310" -exclude = [ - "tests/data", - ".bzr", - ".direnv", - ".eggs", - ".git", - ".git-rewrite", - ".hg", - ".mypy_cache", - ".nox", - ".pants.d", - ".pytype", - ".ruff_cache", - ".svn", - ".tox", - ".venv", - "__pypackages__", - "_build", - "buck-out", - "build", - "dist", - "node_modules", - "venv", -] +exclude = ["tests/artifacts/**/*.safetensors"] [tool.ruff.lint] select = ["E4", "E7", "E9", "F", "I", "N", "B", "C4", "SIM"] diff --git a/tests/data/save_dataset_to_safetensors/lerobot/aloha_sim_insertion_human/frame_0.safetensors b/tests/artifacts/datasets/lerobot/aloha_sim_insertion_human/frame_0.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/aloha_sim_insertion_human/frame_0.safetensors rename to tests/artifacts/datasets/lerobot/aloha_sim_insertion_human/frame_0.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/aloha_sim_insertion_human/frame_1.safetensors b/tests/artifacts/datasets/lerobot/aloha_sim_insertion_human/frame_1.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/aloha_sim_insertion_human/frame_1.safetensors rename to tests/artifacts/datasets/lerobot/aloha_sim_insertion_human/frame_1.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/aloha_sim_insertion_human/frame_250.safetensors b/tests/artifacts/datasets/lerobot/aloha_sim_insertion_human/frame_250.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/aloha_sim_insertion_human/frame_250.safetensors rename to tests/artifacts/datasets/lerobot/aloha_sim_insertion_human/frame_250.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/aloha_sim_insertion_human/frame_251.safetensors b/tests/artifacts/datasets/lerobot/aloha_sim_insertion_human/frame_251.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/aloha_sim_insertion_human/frame_251.safetensors rename to tests/artifacts/datasets/lerobot/aloha_sim_insertion_human/frame_251.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/aloha_sim_insertion_human/frame_498.safetensors b/tests/artifacts/datasets/lerobot/aloha_sim_insertion_human/frame_498.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/aloha_sim_insertion_human/frame_498.safetensors rename to tests/artifacts/datasets/lerobot/aloha_sim_insertion_human/frame_498.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/aloha_sim_insertion_human/frame_499.safetensors b/tests/artifacts/datasets/lerobot/aloha_sim_insertion_human/frame_499.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/aloha_sim_insertion_human/frame_499.safetensors rename to tests/artifacts/datasets/lerobot/aloha_sim_insertion_human/frame_499.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_0.safetensors b/tests/artifacts/datasets/lerobot/pusht/frame_0.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_0.safetensors rename to tests/artifacts/datasets/lerobot/pusht/frame_0.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_1.safetensors b/tests/artifacts/datasets/lerobot/pusht/frame_1.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_1.safetensors rename to tests/artifacts/datasets/lerobot/pusht/frame_1.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_159.safetensors b/tests/artifacts/datasets/lerobot/pusht/frame_159.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_159.safetensors rename to tests/artifacts/datasets/lerobot/pusht/frame_159.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_160.safetensors b/tests/artifacts/datasets/lerobot/pusht/frame_160.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_160.safetensors rename to tests/artifacts/datasets/lerobot/pusht/frame_160.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_80.safetensors b/tests/artifacts/datasets/lerobot/pusht/frame_80.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_80.safetensors rename to tests/artifacts/datasets/lerobot/pusht/frame_80.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_81.safetensors b/tests/artifacts/datasets/lerobot/pusht/frame_81.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_81.safetensors rename to tests/artifacts/datasets/lerobot/pusht/frame_81.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/xarm_lift_medium/frame_0.safetensors b/tests/artifacts/datasets/lerobot/xarm_lift_medium/frame_0.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/xarm_lift_medium/frame_0.safetensors rename to tests/artifacts/datasets/lerobot/xarm_lift_medium/frame_0.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/xarm_lift_medium/frame_1.safetensors b/tests/artifacts/datasets/lerobot/xarm_lift_medium/frame_1.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/xarm_lift_medium/frame_1.safetensors rename to tests/artifacts/datasets/lerobot/xarm_lift_medium/frame_1.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/xarm_lift_medium/frame_12.safetensors b/tests/artifacts/datasets/lerobot/xarm_lift_medium/frame_12.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/xarm_lift_medium/frame_12.safetensors rename to tests/artifacts/datasets/lerobot/xarm_lift_medium/frame_12.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/xarm_lift_medium/frame_13.safetensors b/tests/artifacts/datasets/lerobot/xarm_lift_medium/frame_13.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/xarm_lift_medium/frame_13.safetensors rename to tests/artifacts/datasets/lerobot/xarm_lift_medium/frame_13.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/xarm_lift_medium/frame_23.safetensors b/tests/artifacts/datasets/lerobot/xarm_lift_medium/frame_23.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/xarm_lift_medium/frame_23.safetensors rename to tests/artifacts/datasets/lerobot/xarm_lift_medium/frame_23.safetensors diff --git a/tests/data/save_dataset_to_safetensors/lerobot/xarm_lift_medium/frame_24.safetensors b/tests/artifacts/datasets/lerobot/xarm_lift_medium/frame_24.safetensors similarity index 100% rename from tests/data/save_dataset_to_safetensors/lerobot/xarm_lift_medium/frame_24.safetensors rename to tests/artifacts/datasets/lerobot/xarm_lift_medium/frame_24.safetensors diff --git a/tests/scripts/save_dataset_to_safetensors.py b/tests/artifacts/datasets/save_dataset_to_safetensors.py similarity index 95% rename from tests/scripts/save_dataset_to_safetensors.py rename to tests/artifacts/datasets/save_dataset_to_safetensors.py index 3b77348c..74d42a3d 100644 --- a/tests/scripts/save_dataset_to_safetensors.py +++ b/tests/artifacts/datasets/save_dataset_to_safetensors.py @@ -23,7 +23,7 @@ If you know that your change will break backward compatibility, you should write doesnt need to be merged into the `main` branch. Then you need to run this script and update the tests artifacts. Example usage: - `python tests/scripts/save_dataset_to_safetensors.py` + `python tests/artifacts/datasets/save_dataset_to_safetensors.py` """ import shutil @@ -88,4 +88,4 @@ if __name__ == "__main__": "lerobot/nyu_franka_play_dataset", "lerobot/cmu_stretch", ]: - save_dataset_to_safetensors("tests/data/save_dataset_to_safetensors", repo_id=dataset) + save_dataset_to_safetensors("tests/artifacts/datasets", repo_id=dataset) diff --git a/tests/data/save_image_transforms_to_safetensors/default_transforms.safetensors b/tests/artifacts/image_transforms/default_transforms.safetensors similarity index 100% rename from tests/data/save_image_transforms_to_safetensors/default_transforms.safetensors rename to tests/artifacts/image_transforms/default_transforms.safetensors diff --git a/tests/scripts/save_image_transforms_to_safetensors.py b/tests/artifacts/image_transforms/save_image_transforms_to_safetensors.py similarity index 97% rename from tests/scripts/save_image_transforms_to_safetensors.py rename to tests/artifacts/image_transforms/save_image_transforms_to_safetensors.py index bd2c3add..7b037af4 100644 --- a/tests/scripts/save_image_transforms_to_safetensors.py +++ b/tests/artifacts/image_transforms/save_image_transforms_to_safetensors.py @@ -27,7 +27,7 @@ from lerobot.common.datasets.transforms import ( ) from lerobot.common.utils.random_utils import seeded_context -ARTIFACT_DIR = Path("tests/data/save_image_transforms_to_safetensors") +ARTIFACT_DIR = Path("tests/artifacts/image_transforms") DATASET_REPO_ID = "lerobot/aloha_mobile_shrimp" diff --git a/tests/data/save_image_transforms_to_safetensors/single_transforms.safetensors b/tests/artifacts/image_transforms/single_transforms.safetensors similarity index 100% rename from tests/data/save_image_transforms_to_safetensors/single_transforms.safetensors rename to tests/artifacts/image_transforms/single_transforms.safetensors diff --git a/tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_/actions.safetensors b/tests/artifacts/policies/aloha_sim_insertion_human_act_/actions.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_/actions.safetensors rename to tests/artifacts/policies/aloha_sim_insertion_human_act_/actions.safetensors diff --git a/tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_/grad_stats.safetensors b/tests/artifacts/policies/aloha_sim_insertion_human_act_/grad_stats.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_/grad_stats.safetensors rename to tests/artifacts/policies/aloha_sim_insertion_human_act_/grad_stats.safetensors diff --git a/tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_/output_dict.safetensors b/tests/artifacts/policies/aloha_sim_insertion_human_act_/output_dict.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_/output_dict.safetensors rename to tests/artifacts/policies/aloha_sim_insertion_human_act_/output_dict.safetensors diff --git a/tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_/param_stats.safetensors b/tests/artifacts/policies/aloha_sim_insertion_human_act_/param_stats.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_/param_stats.safetensors rename to tests/artifacts/policies/aloha_sim_insertion_human_act_/param_stats.safetensors diff --git a/tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_1000_steps/actions.safetensors b/tests/artifacts/policies/aloha_sim_insertion_human_act_1000_steps/actions.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_1000_steps/actions.safetensors rename to tests/artifacts/policies/aloha_sim_insertion_human_act_1000_steps/actions.safetensors diff --git a/tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_1000_steps/grad_stats.safetensors b/tests/artifacts/policies/aloha_sim_insertion_human_act_1000_steps/grad_stats.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_1000_steps/grad_stats.safetensors rename to tests/artifacts/policies/aloha_sim_insertion_human_act_1000_steps/grad_stats.safetensors diff --git a/tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_1000_steps/output_dict.safetensors b/tests/artifacts/policies/aloha_sim_insertion_human_act_1000_steps/output_dict.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_1000_steps/output_dict.safetensors rename to tests/artifacts/policies/aloha_sim_insertion_human_act_1000_steps/output_dict.safetensors diff --git a/tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_1000_steps/param_stats.safetensors b/tests/artifacts/policies/aloha_sim_insertion_human_act_1000_steps/param_stats.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/aloha_sim_insertion_human_act_1000_steps/param_stats.safetensors rename to tests/artifacts/policies/aloha_sim_insertion_human_act_1000_steps/param_stats.safetensors diff --git a/tests/data/save_policy_to_safetensors/pusht_diffusion_/actions.safetensors b/tests/artifacts/policies/pusht_diffusion_/actions.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/pusht_diffusion_/actions.safetensors rename to tests/artifacts/policies/pusht_diffusion_/actions.safetensors diff --git a/tests/data/save_policy_to_safetensors/pusht_diffusion_/grad_stats.safetensors b/tests/artifacts/policies/pusht_diffusion_/grad_stats.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/pusht_diffusion_/grad_stats.safetensors rename to tests/artifacts/policies/pusht_diffusion_/grad_stats.safetensors diff --git a/tests/data/save_policy_to_safetensors/pusht_diffusion_/output_dict.safetensors b/tests/artifacts/policies/pusht_diffusion_/output_dict.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/pusht_diffusion_/output_dict.safetensors rename to tests/artifacts/policies/pusht_diffusion_/output_dict.safetensors diff --git a/tests/data/save_policy_to_safetensors/pusht_diffusion_/param_stats.safetensors b/tests/artifacts/policies/pusht_diffusion_/param_stats.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/pusht_diffusion_/param_stats.safetensors rename to tests/artifacts/policies/pusht_diffusion_/param_stats.safetensors diff --git a/tests/scripts/save_policy_to_safetensors.py b/tests/artifacts/policies/save_policy_to_safetensors.py similarity index 98% rename from tests/scripts/save_policy_to_safetensors.py rename to tests/artifacts/policies/save_policy_to_safetensors.py index 60fd9fc0..106f0dc0 100644 --- a/tests/scripts/save_policy_to_safetensors.py +++ b/tests/artifacts/policies/save_policy_to_safetensors.py @@ -141,5 +141,5 @@ if __name__ == "__main__": raise RuntimeError("No policies were provided!") for ds_repo_id, policy, policy_kwargs, file_name_extra in artifacts_cfg: ds_name = ds_repo_id.split("/")[-1] - output_dir = Path("tests/data/save_policy_to_safetensors") / f"{ds_name}_{policy}_{file_name_extra}" + output_dir = Path("tests/artifacts/policies") / f"{ds_name}_{policy}_{file_name_extra}" save_policy_to_safetensors(output_dir, ds_repo_id, policy, policy_kwargs) diff --git a/tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_mpc/actions.safetensors b/tests/artifacts/policies/xarm_lift_medium_tdmpc_use_mpc/actions.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_mpc/actions.safetensors rename to tests/artifacts/policies/xarm_lift_medium_tdmpc_use_mpc/actions.safetensors diff --git a/tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_mpc/grad_stats.safetensors b/tests/artifacts/policies/xarm_lift_medium_tdmpc_use_mpc/grad_stats.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_mpc/grad_stats.safetensors rename to tests/artifacts/policies/xarm_lift_medium_tdmpc_use_mpc/grad_stats.safetensors diff --git a/tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_mpc/output_dict.safetensors b/tests/artifacts/policies/xarm_lift_medium_tdmpc_use_mpc/output_dict.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_mpc/output_dict.safetensors rename to tests/artifacts/policies/xarm_lift_medium_tdmpc_use_mpc/output_dict.safetensors diff --git a/tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_mpc/param_stats.safetensors b/tests/artifacts/policies/xarm_lift_medium_tdmpc_use_mpc/param_stats.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_mpc/param_stats.safetensors rename to tests/artifacts/policies/xarm_lift_medium_tdmpc_use_mpc/param_stats.safetensors diff --git a/tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_policy/actions.safetensors b/tests/artifacts/policies/xarm_lift_medium_tdmpc_use_policy/actions.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_policy/actions.safetensors rename to tests/artifacts/policies/xarm_lift_medium_tdmpc_use_policy/actions.safetensors diff --git a/tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_policy/grad_stats.safetensors b/tests/artifacts/policies/xarm_lift_medium_tdmpc_use_policy/grad_stats.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_policy/grad_stats.safetensors rename to tests/artifacts/policies/xarm_lift_medium_tdmpc_use_policy/grad_stats.safetensors diff --git a/tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_policy/output_dict.safetensors b/tests/artifacts/policies/xarm_lift_medium_tdmpc_use_policy/output_dict.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_policy/output_dict.safetensors rename to tests/artifacts/policies/xarm_lift_medium_tdmpc_use_policy/output_dict.safetensors diff --git a/tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_policy/param_stats.safetensors b/tests/artifacts/policies/xarm_lift_medium_tdmpc_use_policy/param_stats.safetensors similarity index 100% rename from tests/data/save_policy_to_safetensors/xarm_lift_medium_tdmpc_use_policy/param_stats.safetensors rename to tests/artifacts/policies/xarm_lift_medium_tdmpc_use_policy/param_stats.safetensors diff --git a/tests/mock_cv2.py b/tests/cameras/mock_cv2.py similarity index 100% rename from tests/mock_cv2.py rename to tests/cameras/mock_cv2.py diff --git a/tests/mock_pyrealsense2.py b/tests/cameras/mock_pyrealsense2.py similarity index 100% rename from tests/mock_pyrealsense2.py rename to tests/cameras/mock_pyrealsense2.py diff --git a/tests/test_cameras.py b/tests/cameras/test_cameras.py similarity index 99% rename from tests/test_cameras.py rename to tests/cameras/test_cameras.py index ded0a3d5..868358ec 100644 --- a/tests/test_cameras.py +++ b/tests/cameras/test_cameras.py @@ -146,7 +146,7 @@ def test_camera(request, camera_type, mock): camera.connect() if mock: - import tests.mock_cv2 as cv2 + import tests.cameras.mock_cv2 as cv2 else: import cv2 diff --git a/tests/test_compute_stats.py b/tests/datasets/test_compute_stats.py similarity index 100% rename from tests/test_compute_stats.py rename to tests/datasets/test_compute_stats.py diff --git a/tests/test_datasets.py b/tests/datasets/test_datasets.py similarity index 99% rename from tests/test_datasets.py rename to tests/datasets/test_datasets.py index 0deaceba..81447089 100644 --- a/tests/test_datasets.py +++ b/tests/datasets/test_datasets.py @@ -473,12 +473,12 @@ def test_flatten_unflatten_dict(): ) @require_x86_64_kernel def test_backward_compatibility(repo_id): - """The artifacts for this test have been generated by `tests/scripts/save_dataset_to_safetensors.py`.""" + """The artifacts for this test have been generated by `tests/artifacts/datasets/save_dataset_to_safetensors.py`.""" # TODO(rcadene, aliberts): remove dataset download dataset = LeRobotDataset(repo_id, episodes=[0]) - test_dir = Path("tests/data/save_dataset_to_safetensors") / repo_id + test_dir = Path("tests/artifacts/datasets") / repo_id def load_and_compare(i): new_frame = dataset[i] # noqa: B023 diff --git a/tests/test_delta_timestamps.py b/tests/datasets/test_delta_timestamps.py similarity index 100% rename from tests/test_delta_timestamps.py rename to tests/datasets/test_delta_timestamps.py diff --git a/tests/test_image_transforms.py b/tests/datasets/test_image_transforms.py similarity index 99% rename from tests/test_image_transforms.py rename to tests/datasets/test_image_transforms.py index 19bd77df..352aba99 100644 --- a/tests/test_image_transforms.py +++ b/tests/datasets/test_image_transforms.py @@ -33,7 +33,7 @@ from lerobot.scripts.visualize_image_transforms import ( save_all_transforms, save_each_transform, ) -from tests.scripts.save_image_transforms_to_safetensors import ARTIFACT_DIR +from tests.artifacts.image_transforms.save_image_transforms_to_safetensors import ARTIFACT_DIR from tests.utils import require_x86_64_kernel diff --git a/tests/test_image_writer.py b/tests/datasets/test_image_writer.py similarity index 100% rename from tests/test_image_writer.py rename to tests/datasets/test_image_writer.py diff --git a/tests/test_online_buffer.py b/tests/datasets/test_online_buffer.py similarity index 100% rename from tests/test_online_buffer.py rename to tests/datasets/test_online_buffer.py diff --git a/tests/test_sampler.py b/tests/datasets/test_sampler.py similarity index 100% rename from tests/test_sampler.py rename to tests/datasets/test_sampler.py diff --git a/tests/test_utils.py b/tests/datasets/test_utils.py similarity index 65% rename from tests/test_utils.py rename to tests/datasets/test_utils.py index 2d0efc5a..0d02218a 100644 --- a/tests/test_utils.py +++ b/tests/datasets/test_utils.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + # Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,13 +13,32 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + import torch from datasets import Dataset +from huggingface_hub import DatasetCard from lerobot.common.datasets.push_dataset_to_hub.utils import calculate_episode_data_index -from lerobot.common.datasets.utils import ( - hf_transform_to_torch, -) +from lerobot.common.datasets.utils import create_lerobot_dataset_card, hf_transform_to_torch + + +def test_default_parameters(): + card = create_lerobot_dataset_card() + assert isinstance(card, DatasetCard) + assert card.data.tags == ["LeRobot"] + assert card.data.task_categories == ["robotics"] + assert card.data.configs == [ + { + "config_name": "default", + "data_files": "data/*/*.parquet", + } + ] + + +def test_with_tags(): + tags = ["tag1", "tag2"] + card = create_lerobot_dataset_card(tags=tags) + assert card.data.tags == ["LeRobot", "tag1", "tag2"] def test_calculate_episode_data_index(): diff --git a/tests/test_visualize_dataset.py b/tests/datasets/test_visualize_dataset.py similarity index 100% rename from tests/test_visualize_dataset.py rename to tests/datasets/test_visualize_dataset.py diff --git a/tests/test_envs.py b/tests/envs/test_envs.py similarity index 98% rename from tests/test_envs.py rename to tests/envs/test_envs.py index c7c384db..b318abb4 100644 --- a/tests/test_envs.py +++ b/tests/envs/test_envs.py @@ -23,8 +23,7 @@ from gymnasium.utils.env_checker import check_env import lerobot from lerobot.common.envs.factory import make_env, make_env_config from lerobot.common.envs.utils import preprocess_observation - -from .utils import require_env +from tests.utils import require_env OBS_TYPES = ["state", "pixels", "pixels_agent_pos"] diff --git a/tests/test_examples.py b/tests/examples/test_examples.py similarity index 100% rename from tests/test_examples.py rename to tests/examples/test_examples.py diff --git a/tests/lerobot/common/datasets/test_utils.py b/tests/lerobot/common/datasets/test_utils.py deleted file mode 100644 index f484e1ae..00000000 --- a/tests/lerobot/common/datasets/test_utils.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2024 The HuggingFace Inc. team. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from huggingface_hub import DatasetCard - -from lerobot.common.datasets.utils import create_lerobot_dataset_card - - -def test_default_parameters(): - card = create_lerobot_dataset_card() - assert isinstance(card, DatasetCard) - assert card.data.tags == ["LeRobot"] - assert card.data.task_categories == ["robotics"] - assert card.data.configs == [ - { - "config_name": "default", - "data_files": "data/*/*.parquet", - } - ] - - -def test_with_tags(): - tags = ["tag1", "tag2"] - card = create_lerobot_dataset_card(tags=tags) - assert card.data.tags == ["LeRobot", "tag1", "tag2"] diff --git a/tests/mock_dynamixel_sdk.py b/tests/motors/mock_dynamixel_sdk.py similarity index 100% rename from tests/mock_dynamixel_sdk.py rename to tests/motors/mock_dynamixel_sdk.py diff --git a/tests/mock_scservo_sdk.py b/tests/motors/mock_scservo_sdk.py similarity index 100% rename from tests/mock_scservo_sdk.py rename to tests/motors/mock_scservo_sdk.py diff --git a/tests/test_motors.py b/tests/motors/test_motors.py similarity index 100% rename from tests/test_motors.py rename to tests/motors/test_motors.py diff --git a/tests/test_optimizers.py b/tests/optim/test_optimizers.py similarity index 100% rename from tests/test_optimizers.py rename to tests/optim/test_optimizers.py diff --git a/tests/test_schedulers.py b/tests/optim/test_schedulers.py similarity index 100% rename from tests/test_schedulers.py rename to tests/optim/test_schedulers.py diff --git a/tests/test_policies.py b/tests/policies/test_policies.py similarity index 98% rename from tests/test_policies.py rename to tests/policies/test_policies.py index 5d7cca8f..197aa732 100644 --- a/tests/test_policies.py +++ b/tests/policies/test_policies.py @@ -40,7 +40,7 @@ from lerobot.common.utils.random_utils import seeded_context from lerobot.configs.default import DatasetConfig from lerobot.configs.train import TrainPipelineConfig from lerobot.configs.types import FeatureType, NormalizationMode, PolicyFeature -from tests.scripts.save_policy_to_safetensors import get_policy_stats +from tests.artifacts.policies.save_policy_to_safetensors import get_policy_stats from tests.utils import DEVICE, require_cpu, require_env, require_x86_64_kernel @@ -407,12 +407,10 @@ def test_backward_compatibility(ds_repo_id: str, policy_name: str, policy_kwargs should be updated. 4. Check that this test now passes. 5. Remember to restore `tests/scripts/save_policy_to_safetensors.py` to its original state. - 6. Remember to stage and commit the resulting changes to `tests/data`. + 6. Remember to stage and commit the resulting changes to `tests/artifacts`. """ ds_name = ds_repo_id.split("/")[-1] - artifact_dir = ( - Path("tests/data/save_policy_to_safetensors") / f"{ds_name}_{policy_name}_{file_name_extra}" - ) + artifact_dir = Path("tests/artifacts/policies") / f"{ds_name}_{policy_name}_{file_name_extra}" saved_output_dict = load_file(artifact_dir / "output_dict.safetensors") saved_grad_stats = load_file(artifact_dir / "grad_stats.safetensors") saved_param_stats = load_file(artifact_dir / "param_stats.safetensors") diff --git a/tests/test_control_robot.py b/tests/robots/test_control_robot.py similarity index 99% rename from tests/test_control_robot.py rename to tests/robots/test_control_robot.py index 02041e30..61d1caad 100644 --- a/tests/test_control_robot.py +++ b/tests/robots/test_control_robot.py @@ -51,7 +51,7 @@ from lerobot.common.robot_devices.control_configs import ( ) from lerobot.configs.policies import PreTrainedConfig from lerobot.scripts.control_robot import calibrate, record, replay, teleoperate -from tests.test_robots import make_robot +from tests.robots.test_robots import make_robot from tests.utils import TEST_ROBOT_TYPES, mock_calibration_dir, require_robot diff --git a/tests/test_robots.py b/tests/robots/test_robots.py similarity index 100% rename from tests/test_robots.py rename to tests/robots/test_robots.py diff --git a/tests/test_io_utils.py b/tests/utils/test_io_utils.py similarity index 100% rename from tests/test_io_utils.py rename to tests/utils/test_io_utils.py diff --git a/tests/test_logging_utils.py b/tests/utils/test_logging_utils.py similarity index 100% rename from tests/test_logging_utils.py rename to tests/utils/test_logging_utils.py diff --git a/tests/test_random_utils.py b/tests/utils/test_random_utils.py similarity index 100% rename from tests/test_random_utils.py rename to tests/utils/test_random_utils.py diff --git a/tests/test_train_utils.py b/tests/utils/test_train_utils.py similarity index 100% rename from tests/test_train_utils.py rename to tests/utils/test_train_utils.py