Contributing#
We welcome contributions to TorchWM! This guide covers how to get started.
Development Setup#
Clone the repository
git clone https://github.com/ParamThakkar123/torchwm.git cd torchwm
Install in development mode
uv sync --dev
Install pre-commit hooks
pre-commit install
Code Style#
We use:
Black for code formatting
Ruff for linting
MyPy for type checking
Pre-commit for automated checks
Run checks:
# Format code
black .
# Lint
ruff check .
# Type check
mypy .
# All checks
pre-commit run --all-files
Testing#
Run the test suite:
# All tests
pytest
# Specific tests
pytest tests/test_operators.py
# With coverage
pytest --cov=world_models --cov-report=html
Documentation#
Build docs locally:
cd docs
sphinx-build -b html source build/html
Open docs/build/html/index.html in your browser.
Adding New Features#
1. New Operators#
from world_models.inference.operators.base import OperatorABC
class NewOperator(OperatorABC):
def process(self, inputs):
# Your preprocessing logic
return processed_tensors
Add to __init__.py and create tests.
2. New Models#
Create model class in
world_models/models/Add config class in
world_models/configs/Add operator in
world_models/inference/operators/Update training scripts
Add documentation and tests
3. New Environments#
Implement environment wrapper in
world_models/envs/Add to environment registry
Update documentation
Pull Request Process#
Fork the repository
Create a feature branch
git checkout -b feature/my-feature
Make your changes
Run tests and checks
pre-commit run --all-files pytest
Update documentation if needed
Commit your changes
git commit -m "Add feature: my feature"
Push to your fork
git push origin feature/my-feature
Create a Pull Request
Commit Messages#
Use conventional commit format:
feat:New featuresfix:Bug fixesdocs:Documentationtest:Testingrefactor:Code refactoringchore:Maintenance
Examples:
feat: add VLA operator supportfix: resolve memory leak in dreamer trainingdocs: update operators guide
Issue Reporting#
Bug reports: Use the bug report template
Feature requests: Use the feature request template
Questions: Use discussions
Code of Conduct#
Please follow our code of conduct in all interactions.
License#
By contributing, you agree that your contributions will be licensed under the MIT License.