Skip to content

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 '.[extras, audio]'

๐Ÿ› ๏ธ Style Guide

Optional VS Code Profile With All the Extensions and Shortcuts You Need

1. Run linting with Ruff ๐Ÿงน

Ensure your code is free from linting errors by running Ruff.

2. Organize tests in a dedicated directory ๐Ÿ“

Create a parallel test file in the tests/ directory. Name each test file with a test_ prefix.

3. Naming test functions ๐Ÿ“

Prefix all test function names with test_ so Pytest can automatically detect and execute them.

4. 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

5. 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! ๐Ÿš€