|
| 1 | +# Contributing to Manify |
| 2 | + |
| 3 | +Thank you for your interest in contributing to Manify! We welcome contributions of all kinds. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +1. **Fork and clone** the repository |
| 8 | +2. **Install in development mode**: |
| 9 | + ```bash |
| 10 | + pip install -e ".[dev]" |
| 11 | + ``` |
| 12 | +3. **Set up pre-commit hooks**: |
| 13 | + ```bash |
| 14 | + pre-commit install |
| 15 | + ``` |
| 16 | + |
| 17 | +## Code Quality Standards |
| 18 | + |
| 19 | +### Type Annotations |
| 20 | +- Use type annotations for all functions and methods |
| 21 | +- Use `jaxtyping` for tensor shape annotations: |
| 22 | + ```python |
| 23 | + from jaxtyping import Float |
| 24 | + import torch |
| 25 | + |
| 26 | + def process_embeddings(x: Float[torch.Tensor, "batch dim"]) -> Float[torch.Tensor, "batch output_dim"]: |
| 27 | + ... |
| 28 | + ``` |
| 29 | + |
| 30 | +### Testing |
| 31 | +- Write unit tests for all new functionality |
| 32 | +- **Coverage requirement**: 80%+ for new code |
| 33 | +- Run tests with beartype enabled (as in CI): |
| 34 | + ```bash |
| 35 | + pytest tests --cov |
| 36 | + ``` |
| 37 | +- Tests should cover edge cases and error conditions |
| 38 | + |
| 39 | +### Code Style |
| 40 | +- We use **Ruff** for linting and formatting |
| 41 | +- Check your code before committing: |
| 42 | + ```bash |
| 43 | + ruff check manify/ |
| 44 | + ruff format manify/ |
| 45 | + ``` |
| 46 | +- Type check with MyPy: |
| 47 | + ```bash |
| 48 | + mypy manify/ |
| 49 | + ``` |
| 50 | + |
| 51 | +## Documentation |
| 52 | + |
| 53 | +We especially welcome documentation contributions! Areas where help is needed: |
| 54 | + |
| 55 | +- **Mathematical details**: The [paper](https://arxiv.org/abs/2503.09576) contains rich mathematical content that could be integrated into the docs |
| 56 | +- **Tutorials**: More examples and tutorials are always appreciated |
| 57 | +- **API documentation**: Improving docstrings and examples |
| 58 | +- **Use case guides**: Real-world applications and workflows |
| 59 | + |
| 60 | +Documentation uses Google-style docstrings: |
| 61 | +```python |
| 62 | +def my_function(param1: int, param2: str) -> bool: |
| 63 | + """Brief description of the function. |
| 64 | + |
| 65 | + Args: |
| 66 | + param1: Description of param1 |
| 67 | + param2: Description of param2 |
| 68 | + |
| 69 | + Returns: |
| 70 | + Description of return value |
| 71 | + |
| 72 | + Raises: |
| 73 | + ValueError: When something goes wrong |
| 74 | + """ |
| 75 | +``` |
| 76 | + |
| 77 | +## Pull Request Process |
| 78 | + |
| 79 | +1. **Create a feature branch** from `main` |
| 80 | +2. **Make your changes** following the standards above |
| 81 | +3. **Add tests** with good coverage |
| 82 | +4. **Update documentation** as needed |
| 83 | +5. **Ensure CI passes** (tests, linting, type checking) |
| 84 | +6. **Submit a pull request** with a clear description |
| 85 | + |
| 86 | +## Questions? |
| 87 | + |
| 88 | +- Open an [issue](https://github.com/pchlenski/manify/issues) for bugs or feature requests |
| 89 | +- Start a [discussion](https://github.com/pchlenski/manify/discussions) for questions |
| 90 | + |
| 91 | +We appreciate your contributions to making non-Euclidean machine learning more accessible! |
0 commit comments