Contributing Guidelinesβ
Git Workflow π»β
Ensure that you use tools like gitlens (preferred), easycode, or write good commit messages for clarity.
When pulling changes from the main branch, always use --rebase
or --ff-only
:
git pull --rebase
To set up your Git configuration for a smoother workflow:
git config --global pull.ff only
git config --global pull.rebase true
π Environment Setupβ
We use hatch for packaging and managing dependencies.
git clone https://github.com/MbodiAI/embodied-agents.git
source install.bash
hatch run pip install '.[audio]'
π οΈ Style Guideβ
Optional VS Code Profile With All the Extensions and Shortcuts You Need
Run linting with Ruff π§Ή Ensure your code is free from linting errors by running Ruff.
Organize tests in a dedicated directory π Create a parallel test file in the tests/ directory. Name each test file with a
test_
prefix.Naming test functions π Prefix all test function names with
test_
so Pytest can automatically detect and execute them.Google-style π docstrings with examples π‘ Use Google-style docstrings to document all public classes, methods, functions, and modules. Example:
def example_function(param1, param2): """This is a one-line summary of the function. More detail here. Args: param1 (int): Description of param1. param2 (str): Description of param2. Returns: bool: Description of the return value. Example: >>> add(2, 3) """ return True
Test Pydantic models π§ͺ Ensure Pydantic models are thoroughly tested for:
JSON serialization Deserialization Saving to h5 files Example test cases: def test_pydantic_model_to_json(): # Your test code here pass def test_pydantic_model_from_json(): # Your test code here pass def test_pydantic_model_save_to_h5(): # Your test code here pass
Following these guidelines will help maintain clean, well-documented, and tested code. Happy coding! π