Merge pull request #74 from huggingface/user/aliberts/2024_04_15_setup_contributions
Setup contributions
This commit is contained in:
commit
fbc31d906c
|
@ -0,0 +1,54 @@
|
||||||
|
name: "\U0001F41B Bug Report"
|
||||||
|
description: Submit a bug report to help us improve LeRobot
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Thanks for taking the time to submit a bug report! 🐛
|
||||||
|
If this is not a bug related to the LeRobot library directly, but instead a general question about your code or the library specifically please use our [discord](https://discord.gg/s3KuuzsPFb).
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: system-info
|
||||||
|
attributes:
|
||||||
|
label: System Info
|
||||||
|
description: If needed, you can share your lerobot configuration with us by running `python -m lerobot.commands.env` and copy-pasting its outputs below
|
||||||
|
render: Shell
|
||||||
|
placeholder: lerobot version, OS, python version, numpy version, torch version, and lerobot's configuration
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: checkboxes
|
||||||
|
id: information-scripts-examples
|
||||||
|
attributes:
|
||||||
|
label: Information
|
||||||
|
description: 'The problem arises when using:'
|
||||||
|
options:
|
||||||
|
- label: "One of the scripts in the examples/ folder of LeRobot"
|
||||||
|
- label: "My own task or dataset (give details below)"
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: reproduction
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
attributes:
|
||||||
|
label: Reproduction
|
||||||
|
description: |
|
||||||
|
If needed, provide a simple code sample that reproduces the problem you ran into. It can be a Colab link or just a code snippet.
|
||||||
|
Sharing error messages or stack traces could be useful as well!
|
||||||
|
Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting
|
||||||
|
Try to avoid screenshots, as they are hard to read and don't allow copy-and-pasting.
|
||||||
|
|
||||||
|
placeholder: |
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
|
||||||
|
1.
|
||||||
|
2.
|
||||||
|
3.
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: expected-behavior
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
attributes:
|
||||||
|
label: Expected behavior
|
||||||
|
description: "A clear and concise description of what you would expect to happen."
|
|
@ -0,0 +1,15 @@
|
||||||
|
# What does this PR do?
|
||||||
|
|
||||||
|
Example: Fixes # (issue)
|
||||||
|
|
||||||
|
|
||||||
|
## Before submitting
|
||||||
|
- Read the [contributor guideline](https://github.com/huggingface/lerobot/blob/main/CONTRIBUTING.md#submitting-a-pull-request-pr).
|
||||||
|
- Provide a minimal code example for the reviewer to checkout & try.
|
||||||
|
- Explain how you tested your changes.
|
||||||
|
|
||||||
|
|
||||||
|
## Who can review?
|
||||||
|
|
||||||
|
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
|
||||||
|
members/contributors who may be interested in your PR. Try to avoid tagging more than 3 people.
|
|
@ -0,0 +1,133 @@
|
||||||
|
|
||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
We as members, contributors, and leaders pledge to make participation in our
|
||||||
|
community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||||
|
identity and expression, level of experience, education, socio-economic status,
|
||||||
|
nationality, personal appearance, race, caste, color, religion, or sexual
|
||||||
|
identity and orientation.
|
||||||
|
|
||||||
|
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||||
|
diverse, inclusive, and healthy community.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to a positive environment for our
|
||||||
|
community include:
|
||||||
|
|
||||||
|
* Demonstrating empathy and kindness toward other people
|
||||||
|
* Being respectful of differing opinions, viewpoints, and experiences
|
||||||
|
* Giving and gracefully accepting constructive feedback
|
||||||
|
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||||
|
and learning from the experience
|
||||||
|
* Focusing on what is best not just for us as individuals, but for the overall
|
||||||
|
community
|
||||||
|
|
||||||
|
Examples of unacceptable behavior include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery, and sexual attention or advances of
|
||||||
|
any kind
|
||||||
|
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or email address,
|
||||||
|
without their explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Enforcement Responsibilities
|
||||||
|
|
||||||
|
Community leaders are responsible for clarifying and enforcing our standards of
|
||||||
|
acceptable behavior and will take appropriate and fair corrective action in
|
||||||
|
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||||
|
or harmful.
|
||||||
|
|
||||||
|
Community leaders have the right and responsibility to remove, edit, or reject
|
||||||
|
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||||
|
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||||
|
decisions when appropriate.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies within all community spaces, and also applies when
|
||||||
|
an individual is officially representing the community in public spaces.
|
||||||
|
Examples of representing our community include using an official email address,
|
||||||
|
posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported to the community leaders responsible for enforcement at
|
||||||
|
[feedback@huggingface.co](mailto:feedback@huggingface.co).
|
||||||
|
All complaints will be reviewed and investigated promptly and fairly.
|
||||||
|
|
||||||
|
All community leaders are obligated to respect the privacy and security of the
|
||||||
|
reporter of any incident.
|
||||||
|
|
||||||
|
## Enforcement Guidelines
|
||||||
|
|
||||||
|
Community leaders will follow these Community Impact Guidelines in determining
|
||||||
|
the consequences for any action they deem in violation of this Code of Conduct:
|
||||||
|
|
||||||
|
### 1. Correction
|
||||||
|
|
||||||
|
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||||
|
unprofessional or unwelcome in the community.
|
||||||
|
|
||||||
|
**Consequence**: A private, written warning from community leaders, providing
|
||||||
|
clarity around the nature of the violation and an explanation of why the
|
||||||
|
behavior was inappropriate. A public apology may be requested.
|
||||||
|
|
||||||
|
### 2. Warning
|
||||||
|
|
||||||
|
**Community Impact**: A violation through a single incident or series of
|
||||||
|
actions.
|
||||||
|
|
||||||
|
**Consequence**: A warning with consequences for continued behavior. No
|
||||||
|
interaction with the people involved, including unsolicited interaction with
|
||||||
|
those enforcing the Code of Conduct, for a specified period of time. This
|
||||||
|
includes avoiding interactions in community spaces as well as external channels
|
||||||
|
like social media. Violating these terms may lead to a temporary or permanent
|
||||||
|
ban.
|
||||||
|
|
||||||
|
### 3. Temporary Ban
|
||||||
|
|
||||||
|
**Community Impact**: A serious violation of community standards, including
|
||||||
|
sustained inappropriate behavior.
|
||||||
|
|
||||||
|
**Consequence**: A temporary ban from any sort of interaction or public
|
||||||
|
communication with the community for a specified period of time. No public or
|
||||||
|
private interaction with the people involved, including unsolicited interaction
|
||||||
|
with those enforcing the Code of Conduct, is allowed during this period.
|
||||||
|
Violating these terms may lead to a permanent ban.
|
||||||
|
|
||||||
|
### 4. Permanent Ban
|
||||||
|
|
||||||
|
**Community Impact**: Demonstrating a pattern of violation of community
|
||||||
|
standards, including sustained inappropriate behavior, harassment of an
|
||||||
|
individual, or aggression toward or disparagement of classes of individuals.
|
||||||
|
|
||||||
|
**Consequence**: A permanent ban from any sort of public interaction within the
|
||||||
|
community.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||||
|
version 2.1, available at
|
||||||
|
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||||
|
|
||||||
|
Community Impact Guidelines were inspired by
|
||||||
|
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see the FAQ at
|
||||||
|
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
||||||
|
[https://www.contributor-covenant.org/translations][translations].
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||||
|
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||||
|
[FAQ]: https://www.contributor-covenant.org/faq
|
||||||
|
[translations]: https://www.contributor-covenant.org/translations
|
|
@ -0,0 +1,254 @@
|
||||||
|
# How to contribute to 🤗 LeRobot?
|
||||||
|
|
||||||
|
Everyone is welcome to contribute, and we value everybody's contribution. Code
|
||||||
|
is thus not the only way to help the community. Answering questions, helping
|
||||||
|
others, reaching out and improving the documentations are immensely valuable to
|
||||||
|
the community.
|
||||||
|
|
||||||
|
It also helps us if you spread the word: reference the library from blog posts
|
||||||
|
on the awesome projects it made possible, shout out on Twitter when it has
|
||||||
|
helped you, or simply ⭐️ the repo to say "thank you".
|
||||||
|
|
||||||
|
Whichever way you choose to contribute, please be mindful to respect our
|
||||||
|
[code of conduct](https://github.com/huggingface/lerobot/blob/main/CODE_OF_CONDUCT.md).
|
||||||
|
|
||||||
|
## You can contribute in so many ways!
|
||||||
|
|
||||||
|
Some of the ways you can contribute to 🤗 LeRobot:
|
||||||
|
* Fixing outstanding issues with the existing code.
|
||||||
|
* Implementing new models, datasets or simulation environments.
|
||||||
|
* Contributing to the examples or to the documentation.
|
||||||
|
* Submitting issues related to bugs or desired new features.
|
||||||
|
|
||||||
|
Following the guides below, feel free to open issues and PRs and to coordinate your efforts with the community on our [Discord Channel](https://discord.gg/VjFz58wn3R). For specific inquiries, reach out to [Remi Cadene](remi.cadene@huggingface.co).
|
||||||
|
|
||||||
|
If you are not sure how to contribute or want to know the next features we working on, look on this project page: [LeRobot TODO](https://github.com/orgs/huggingface/projects/46)
|
||||||
|
|
||||||
|
## Submitting a new issue or feature request
|
||||||
|
|
||||||
|
Do your best to follow these guidelines when submitting an issue or a feature
|
||||||
|
request. It will make it easier for us to come back to you quickly and with good
|
||||||
|
feedback.
|
||||||
|
|
||||||
|
### Did you find a bug?
|
||||||
|
|
||||||
|
The 🤗 LeRobot library is robust and reliable thanks to the users who notify us of
|
||||||
|
the problems they encounter. So thank you for reporting an issue.
|
||||||
|
|
||||||
|
First, we would really appreciate it if you could **make sure the bug was not
|
||||||
|
already reported** (use the search bar on Github under Issues).
|
||||||
|
|
||||||
|
Did not find it? :( So we can act quickly on it, please follow these steps:
|
||||||
|
|
||||||
|
* Include your **OS type and version**, the versions of **Python** and **PyTorch**.
|
||||||
|
* A short, self-contained, code snippet that allows us to reproduce the bug in
|
||||||
|
less than 30s.
|
||||||
|
* The full traceback if an exception is raised.
|
||||||
|
* Attach any other additional information, like screenshots, you think may help.
|
||||||
|
|
||||||
|
### Do you want a new feature?
|
||||||
|
|
||||||
|
A good feature request addresses the following points:
|
||||||
|
|
||||||
|
1. Motivation first:
|
||||||
|
* Is it related to a problem/frustration with the library? If so, please explain
|
||||||
|
why. Providing a code snippet that demonstrates the problem is best.
|
||||||
|
* Is it related to something you would need for a project? We'd love to hear
|
||||||
|
about it!
|
||||||
|
* Is it something you worked on and think could benefit the community?
|
||||||
|
Awesome! Tell us what problem it solved for you.
|
||||||
|
2. Write a *paragraph* describing the feature.
|
||||||
|
3. Provide a **code snippet** that demonstrates its future use.
|
||||||
|
4. In case this is related to a paper, please attach a link.
|
||||||
|
5. Attach any additional information (drawings, screenshots, etc.) you think may help.
|
||||||
|
|
||||||
|
If your issue is well written we're already 80% of the way there by the time you
|
||||||
|
post it.
|
||||||
|
|
||||||
|
## Submitting a pull request (PR)
|
||||||
|
|
||||||
|
Before writing code, we strongly advise you to search through the existing PRs or
|
||||||
|
issues to make sure that nobody is already working on the same thing. If you are
|
||||||
|
unsure, it is always a good idea to open an issue to get some feedback.
|
||||||
|
|
||||||
|
You will need basic `git` proficiency to be able to contribute to
|
||||||
|
🤗 LeRobot. `git` is not the easiest tool to use but it has the greatest
|
||||||
|
manual. Type `git --help` in a shell and enjoy. If you prefer books, [Pro
|
||||||
|
Git](https://git-scm.com/book/en/v2) is a very good reference.
|
||||||
|
|
||||||
|
Follow these steps to start contributing:
|
||||||
|
|
||||||
|
1. Fork the [repository](https://github.com/huggingface/lerobot) by
|
||||||
|
clicking on the 'Fork' button on the repository's page. This creates a copy of the code
|
||||||
|
under your GitHub user account.
|
||||||
|
|
||||||
|
2. Clone your fork to your local disk, and add the base repository as a remote. The following command
|
||||||
|
assumes you have your public SSH key uploaded to GitHub. See the following guide for more
|
||||||
|
[information](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository).
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone git@github.com:<your Github handle>/lerobot.git
|
||||||
|
cd lerobot
|
||||||
|
git remote add upstream https://github.com/huggingface/lerobot.git
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Create a new branch to hold your development changes, and do this for every new PR you work on.
|
||||||
|
|
||||||
|
Start by synchronizing your `main` branch with the `upstream/main` branch (more details in the [GitHub Docs](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork)):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git checkout main
|
||||||
|
git fetch upstream
|
||||||
|
git rebase upstream/main
|
||||||
|
```
|
||||||
|
|
||||||
|
Once your `main` branch is synchronized, create a new branch from it:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git checkout -b a-descriptive-name-for-my-changes
|
||||||
|
```
|
||||||
|
|
||||||
|
🚨 **Do not** work on the `main` branch.
|
||||||
|
|
||||||
|
4. Instead of using `pip` directly, we use `poetry` for development purposes to easily track our dependencies.
|
||||||
|
If you don't have it already, follow the [instructions](https://python-poetry.org/docs/#installation) to install it.
|
||||||
|
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:
|
||||||
|
Install the project with dev dependencies and all environments:
|
||||||
|
```bash
|
||||||
|
poetry install --sync --with dev --all-extras
|
||||||
|
```
|
||||||
|
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.
|
||||||
|
|
||||||
|
To selectively install environments (for example aloha and pusht) use:
|
||||||
|
```bash
|
||||||
|
poetry install --sync --with dev --extras "aloha pusht"
|
||||||
|
```
|
||||||
|
|
||||||
|
The equivalent of `pip install some-package`, would just be:
|
||||||
|
```bash
|
||||||
|
poetry add some-package
|
||||||
|
```
|
||||||
|
|
||||||
|
When changes are made to the poetry sections of the `pyproject.toml`, you should run the following command to lock dependencies.
|
||||||
|
```bash
|
||||||
|
poetry lock --no-update
|
||||||
|
```
|
||||||
|
|
||||||
|
**NOTE:** Currently, to ensure the CI works properly, any new package must also be added in the CPU-only environment dedicated to the CI. To do this, you should create a separate environment and add the new package there as well. For example:
|
||||||
|
```bash
|
||||||
|
# Add the new package to your main poetry env
|
||||||
|
poetry add some-package
|
||||||
|
# Add the same package to the CPU-only env dedicated to CI
|
||||||
|
conda create -y -n lerobot-ci python=3.10
|
||||||
|
conda activate lerobot-ci
|
||||||
|
cd .github/poetry/cpu
|
||||||
|
poetry add some-package
|
||||||
|
```
|
||||||
|
|
||||||
|
5. Develop the features on your branch.
|
||||||
|
|
||||||
|
As you work on the features, you should make sure that the test suite
|
||||||
|
passes. You should run the tests impacted by your changes like this (see
|
||||||
|
below an explanation regarding the environment variable):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pytest tests/<TEST_TO_RUN>.py
|
||||||
|
```
|
||||||
|
|
||||||
|
6. Follow our style.
|
||||||
|
|
||||||
|
`lerobot` relies on `ruff` to format its source code
|
||||||
|
consistently. Set up [`pre-commit`](https://pre-commit.com/) to run these checks
|
||||||
|
automatically as Git commit hooks.
|
||||||
|
|
||||||
|
Install `pre-commit` hooks:
|
||||||
|
```bash
|
||||||
|
pre-commit install
|
||||||
|
```
|
||||||
|
|
||||||
|
You can run these hooks whenever you need on staged files with:
|
||||||
|
```bash
|
||||||
|
pre-commit
|
||||||
|
```
|
||||||
|
|
||||||
|
Once you're happy with your changes, add changed files using `git add` and
|
||||||
|
make a commit with `git commit` to record your changes locally:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git add modified_file.py
|
||||||
|
git commit
|
||||||
|
```
|
||||||
|
|
||||||
|
Please write [good commit messages](https://chris.beams.io/posts/git-commit/).
|
||||||
|
|
||||||
|
It is a good idea to sync your copy of the code with the original
|
||||||
|
repository regularly. This way you can quickly account for changes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git fetch upstream
|
||||||
|
git rebase upstream/main
|
||||||
|
```
|
||||||
|
|
||||||
|
Push the changes to your account using:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git push -u origin a-descriptive-name-for-my-changes
|
||||||
|
```
|
||||||
|
|
||||||
|
6. Once you are satisfied (**and the checklist below is happy too**), go to the
|
||||||
|
webpage of your fork on GitHub. Click on 'Pull request' to send your changes
|
||||||
|
to the project maintainers for review.
|
||||||
|
|
||||||
|
7. It's ok if maintainers ask you for changes. It happens to core contributors
|
||||||
|
too! So everyone can see the changes in the Pull request, work in your local
|
||||||
|
branch and push the changes to your fork. They will automatically appear in
|
||||||
|
the pull request.
|
||||||
|
|
||||||
|
|
||||||
|
### Checklist
|
||||||
|
|
||||||
|
1. The title of your pull request should be a summary of its contribution;
|
||||||
|
2. If your pull request addresses an issue, please mention the issue number in
|
||||||
|
the pull request description to make sure they are linked (and people
|
||||||
|
consulting the issue know you are working on it);
|
||||||
|
3. To indicate a work in progress please prefix the title with `[WIP]`, or preferably mark
|
||||||
|
the PR as a draft PR. These are useful to avoid duplicated work, and to differentiate
|
||||||
|
it from PRs ready to be merged;
|
||||||
|
4. Make sure existing tests pass;
|
||||||
|
<!-- 5. Add high-coverage tests. No quality testing = no merge.
|
||||||
|
|
||||||
|
See an example of a good PR here: https://github.com/huggingface/lerobot/pull/ -->
|
||||||
|
|
||||||
|
### Tests
|
||||||
|
|
||||||
|
An extensive test suite is included to test the library behavior and several examples. Library tests can be found in the [tests folder](https://github.com/huggingface/lerobot/tree/main/tests).
|
||||||
|
|
||||||
|
Install [git lfs](https://git-lfs.com/) to retrieve test artifacts (if you don't have it already).
|
||||||
|
|
||||||
|
On Mac:
|
||||||
|
```bash
|
||||||
|
brew install git-lfs
|
||||||
|
git lfs install
|
||||||
|
```
|
||||||
|
|
||||||
|
On Ubuntu:
|
||||||
|
```bash
|
||||||
|
sudo apt-get install git-lfs
|
||||||
|
git lfs install
|
||||||
|
```
|
||||||
|
|
||||||
|
Pull artifacts if they're not in [tests/data](tests/data)
|
||||||
|
```bash
|
||||||
|
git lfs pull
|
||||||
|
```
|
||||||
|
|
||||||
|
We use `pytest` in order to run the tests. From the root of the
|
||||||
|
repository, here's how to run tests with `pytest` for the library:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
DATA_DIR="tests/data" python -m pytest -sv ./tests
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
You can specify a smaller set of tests in order to test only the feature
|
||||||
|
you're working on.
|
85
README.md
85
README.md
|
@ -17,6 +17,7 @@
|
||||||
[](https://pypi.org/project/lerobot/)
|
[](https://pypi.org/project/lerobot/)
|
||||||
[](https://pypi.org/project/lerobot/)
|
[](https://pypi.org/project/lerobot/)
|
||||||
[](https://github.com/huggingface/lerobot/tree/main/examples)
|
[](https://github.com/huggingface/lerobot/tree/main/examples)
|
||||||
|
[](https://github.com/huggingface/lerobot/blob/main/CODE_OF_CONDUCT.md)
|
||||||
[](https://discord.gg/s3KuuzsPFb)
|
[](https://discord.gg/s3KuuzsPFb)
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -189,89 +190,7 @@ hydra.run.dir=outputs/train/aloha_act
|
||||||
|
|
||||||
## Contribute
|
## Contribute
|
||||||
|
|
||||||
Feel free to open issues and PRs, and to coordinate your efforts with the community on our [Discord Channel](https://discord.gg/VjFz58wn3R). For specific inquiries, reach out to [Remi Cadene](remi.cadene@huggingface.co).
|
If you would like to contribute to 🤗 LeRobot, please check out our [contribution guide](https://github.com/huggingface/lerobot/blob/main/CONTRIBUTING.md).
|
||||||
|
|
||||||
### TODO
|
|
||||||
|
|
||||||
If you are not sure how to contribute or want to know the next features we working on, look on this project page: [LeRobot TODO](https://github.com/orgs/huggingface/projects/46)
|
|
||||||
|
|
||||||
### Follow our style
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# install if needed
|
|
||||||
pre-commit install
|
|
||||||
# apply style and linter checks before git commit
|
|
||||||
pre-commit
|
|
||||||
```
|
|
||||||
|
|
||||||
### Dependencies
|
|
||||||
|
|
||||||
Instead of using `pip` directly, we use `poetry` for development purposes to easily track our dependencies.
|
|
||||||
If you don't have it already, follow the [instructions](https://python-poetry.org/docs/#installation) to install it.
|
|
||||||
|
|
||||||
Install the project with dev dependencies and all environments:
|
|
||||||
```bash
|
|
||||||
poetry install --sync --with dev --all-extras
|
|
||||||
```
|
|
||||||
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.
|
|
||||||
|
|
||||||
To selectively install environments (for example aloha and pusht) use:
|
|
||||||
```bash
|
|
||||||
poetry install --sync --with dev --extras "aloha pusht"
|
|
||||||
```
|
|
||||||
|
|
||||||
The equivalent of `pip install some-package`, would just be:
|
|
||||||
```bash
|
|
||||||
poetry add some-package
|
|
||||||
```
|
|
||||||
|
|
||||||
When changes are made to the poetry sections of the `pyproject.toml`, you should run the following command to lock dependencies.
|
|
||||||
```bash
|
|
||||||
poetry lock --no-update
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
**NOTE:** Currently, to ensure the CI works properly, any new package must also be added in the CPU-only environment dedicated to the CI. To do this, you should create a separate environment and add the new package there as well. For example:
|
|
||||||
```bash
|
|
||||||
# Add the new package to your main poetry env
|
|
||||||
poetry add some-package
|
|
||||||
# Add the same package to the CPU-only env dedicated to CI
|
|
||||||
conda create -y -n lerobot-ci python=3.10
|
|
||||||
conda activate lerobot-ci
|
|
||||||
cd .github/poetry/cpu
|
|
||||||
poetry add some-package
|
|
||||||
```
|
|
||||||
|
|
||||||
### Run tests locally
|
|
||||||
|
|
||||||
Install [git lfs](https://git-lfs.com/) to retrieve test artifacts (if you don't have it already).
|
|
||||||
|
|
||||||
On Mac:
|
|
||||||
```bash
|
|
||||||
brew install git-lfs
|
|
||||||
git lfs install
|
|
||||||
```
|
|
||||||
|
|
||||||
On Ubuntu:
|
|
||||||
```bash
|
|
||||||
sudo apt-get install git-lfs
|
|
||||||
git lfs install
|
|
||||||
```
|
|
||||||
|
|
||||||
Pull artifacts if they're not in [tests/data](tests/data)
|
|
||||||
```bash
|
|
||||||
git lfs pull
|
|
||||||
```
|
|
||||||
|
|
||||||
When adding a new dataset, mock it with
|
|
||||||
```bash
|
|
||||||
python tests/scripts/mock_dataset.py --in-data-dir data/$DATASET --out-data-dir tests/data/$DATASET
|
|
||||||
```
|
|
||||||
|
|
||||||
Run tests
|
|
||||||
```bash
|
|
||||||
DATA_DIR="tests/data" pytest -sx tests
|
|
||||||
```
|
|
||||||
|
|
||||||
### Add a new dataset
|
### Add a new dataset
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
import platform
|
||||||
|
|
||||||
|
import huggingface_hub
|
||||||
|
|
||||||
|
# import dataset
|
||||||
|
import numpy as np
|
||||||
|
import torch
|
||||||
|
|
||||||
|
from lerobot import __version__ as version
|
||||||
|
|
||||||
|
pt_version = torch.__version__
|
||||||
|
pt_cuda_available = torch.cuda.is_available()
|
||||||
|
pt_cuda_available = torch.cuda.is_available()
|
||||||
|
cuda_version = torch._C._cuda_getCompiledVersion() if torch.version.cuda is not None else "N/A"
|
||||||
|
|
||||||
|
|
||||||
|
# TODO(aliberts): refactor into an actual command `lerobot env`
|
||||||
|
def get_env_info() -> dict:
|
||||||
|
"""Run this to get basic system info to help for tracking issues & bugs."""
|
||||||
|
info = {
|
||||||
|
"`lerobot` version": version,
|
||||||
|
"Platform": platform.platform(),
|
||||||
|
"Python version": platform.python_version(),
|
||||||
|
"Huggingface_hub version": huggingface_hub.__version__,
|
||||||
|
# TODO(aliberts): Add dataset when https://github.com/huggingface/lerobot/pull/73 is merged
|
||||||
|
# "Dataset version": dataset.__version__,
|
||||||
|
"Numpy version": np.__version__,
|
||||||
|
"PyTorch version (GPU?)": f"{pt_version} ({pt_cuda_available})",
|
||||||
|
"Cuda version": cuda_version,
|
||||||
|
"Using GPU in script?": "<fill in>",
|
||||||
|
"Using distributed or parallel set-up in script?": "<fill in>",
|
||||||
|
}
|
||||||
|
print("\nCopy-and-paste the text below in your GitHub issue and FILL OUT the two last points.\n")
|
||||||
|
print(format_dict(info))
|
||||||
|
return info
|
||||||
|
|
||||||
|
|
||||||
|
def format_dict(d: dict) -> str:
|
||||||
|
return "\n".join([f"- {prop}: {val}" for prop, val in d.items()]) + "\n"
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
get_env_info()
|
Loading…
Reference in New Issue