Skip to content

Commit bf2eebb

Browse files
alibertsCadene
andauthored
Update readme & remove example 1 (#108)
Co-authored-by: Remi <[email protected]> - Update instructions for installing the library - Remove deprecated example 1 (as we are now only using `LeRobotDataset` since #91)
1 parent fe2b9af commit bf2eebb

File tree

7 files changed

+26
-93
lines changed

7 files changed

+26
-93
lines changed

CONTRIBUTING.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,26 +129,34 @@ Follow these steps to start contributing:
129129

130130
🚨 **Do not** work on the `main` branch.
131131

132-
4. Instead of using `pip` directly, we use `poetry` for development purposes to easily track our dependencies.
132+
4. for development, we use `poetry` instead of just `pip` to easily track our dependencies.
133133
If you don't have it already, follow the [instructions](https://python-poetry.org/docs/#installation) to install it.
134-
Set up a development environment by running the following command in a conda or a virtual environment you've created for working on this library:
135-
Install the project with dev dependencies and all environments:
134+
135+
Set up a development environment with conda or miniconda:
136+
```bash
137+
conda create -y -n lerobot-dev python=3.10 && conda activate lerobot-dev
138+
```
139+
140+
To develop on 🤗 LeRobot, you will at least need to install the `dev` and `test` extras dependencies along with the core library:
136141
```bash
137-
poetry install --sync --with dev --all-extras
142+
poetry install --sync --extras "dev test"
138143
```
139-
This command should be run when pulling code with and updated version of `pyproject.toml` and `poetry.lock` in order to synchronize your virtual environment with the dependencies.
140144

141-
To selectively install environments (for example aloha and pusht) use:
145+
You can also install the project with all its dependencies (including environments):
142146
```bash
143-
poetry install --sync --with dev --extras "aloha pusht"
147+
poetry install --sync --all-extras
144148
```
145149

150+
> **Note:** If you don't install simulation environments with `--all-extras`, the tests that require them will be skipped when running the pytest suite locally. However, they *will* be tested in the CI. In general, we advise you to install everything and test locally before pushing.
151+
152+
Whichever command you chose to install the project (e.g. `poetry install --sync --all-extras`), you should run it again when pulling code with an updated version of `pyproject.toml` and `poetry.lock` in order to synchronize your virtual environment with the new dependencies.
153+
146154
The equivalent of `pip install some-package`, would just be:
147155
```bash
148156
poetry add some-package
149157
```
150158

151-
When changes are made to the poetry sections of the `pyproject.toml`, you should run the following command to lock dependencies.
159+
When making changes to the poetry sections of the `pyproject.toml`, you should run the following command to lock dependencies.
152160
```bash
153161
poetry lock --no-update
154162
```

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<div align="center">
1212

13-
[![Tests](https://github.com/huggingface/lerobot/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/huggingface/lerobot/actions/workflows/test.yml?query=branch%3Amain)
13+
[![Tests](https://github.com/huggingface/lerobot/actions/workflows/nightly-tests.yml/badge.svg?branch=main)](https://github.com/huggingface/lerobot/actions/workflows/nightly-tests.yml?query=branch%3Amain)
1414
[![Coverage](https://codecov.io/gh/huggingface/lerobot/branch/main/graph/badge.svg?token=TODO)](https://codecov.io/gh/huggingface/lerobot)
1515
[![Python versions](https://img.shields.io/pypi/pyversions/lerobot)](https://www.python.org/downloads/)
1616
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/huggingface/lerobot/blob/main/LICENSE)
@@ -73,7 +73,7 @@ conda create -y -n lerobot python=3.10 && conda activate lerobot
7373

7474
Install 🤗 LeRobot:
7575
```bash
76-
python -m pip install .
76+
pip install .
7777
```
7878

7979
For simulations, 🤗 LeRobot comes with gymnasium environments that can be installed as extras:
@@ -83,7 +83,7 @@ For simulations, 🤗 LeRobot comes with gymnasium environments that can be inst
8383

8484
For instance, to install 🤗 LeRobot with aloha and pusht, use:
8585
```bash
86-
python -m pip install ".[aloha, pusht]"
86+
pip install ".[aloha, pusht]"
8787
```
8888

8989
To use [Weights and Biases](https://docs.wandb.ai/quickstart) for experiments tracking, log in with

examples/1_load_hugging_face_dataset.py

Lines changed: 0 additions & 69 deletions
This file was deleted.

examples/2_load_lerobot_dataset.py renamed to examples/1_load_lerobot_dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
frames = [frame.permute((1, 2, 0)).numpy() for frame in frames]
5959

6060
# and finally save them to a mp4 video
61-
Path("outputs/examples/2_load_lerobot_dataset").mkdir(parents=True, exist_ok=True)
62-
imageio.mimsave("outputs/examples/2_load_lerobot_dataset/episode_5.mp4", frames, fps=dataset.fps)
61+
Path("outputs/examples/1_load_lerobot_dataset").mkdir(parents=True, exist_ok=True)
62+
imageio.mimsave("outputs/examples/1_load_lerobot_dataset/episode_5.mp4", frames, fps=dataset.fps)
6363

6464
# For many machine learning applications we need to load histories of past observations, or trajectorys of future actions. Our datasets can load previous and future frames for each key/modality,
6565
# using timestamps differences with the current loaded frame. For instance:
File renamed without changes.

tests/test_examples.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,18 @@ def _run_script(path):
1616

1717

1818
def test_example_1():
19-
path = "examples/1_load_hugging_face_dataset.py"
19+
path = "examples/1_load_lerobot_dataset.py"
2020
_run_script(path)
21-
assert Path("outputs/examples/1_load_hugging_face_dataset/episode_5.mp4").exists()
21+
assert Path("outputs/examples/1_load_lerobot_dataset/episode_5.mp4").exists()
2222

2323

24-
def test_example_2():
25-
path = "examples/2_load_lerobot_dataset.py"
26-
_run_script(path)
27-
assert Path("outputs/examples/2_load_lerobot_dataset/episode_5.mp4").exists()
28-
29-
30-
def test_examples_4_and_3():
24+
def test_examples_3_and_2():
3125
"""
3226
Train a model with example 3, check the outputs.
3327
Evaluate the trained model with example 2, check the outputs.
3428
"""
3529

36-
path = "examples/4_train_policy.py"
30+
path = "examples/3_train_policy.py"
3731

3832
with open(path) as file:
3933
file_contents = file.read()
@@ -55,7 +49,7 @@ def test_examples_4_and_3():
5549
for file_name in ["model.pt", "config.yaml"]:
5650
assert Path(f"outputs/train/example_pusht_diffusion/{file_name}").exists()
5751

58-
path = "examples/3_evaluate_pretrained_policy.py"
52+
path = "examples/2_evaluate_pretrained_policy.py"
5953

6054
with open(path) as file:
6155
file_contents = file.read()

0 commit comments

Comments
 (0)