Contributing to ProbJax¶
We welcome contributions to ProbJax! This guide will help you get started.
Getting Started¶
- Fork the repository on GitHub
-
Clone your fork locally:
-
Create a virtual environment:
-
Install in development mode:
Development Workflow¶
Code Style¶
We use Ruff for code formatting and linting:
# Format code
ruff format .
# Check for linting issues
ruff check .
# Fix auto-fixable issues
ruff check --fix .
Running Tests¶
# Run all tests
pytest
# Run tests in parallel
pytest -n auto
# Run specific test file
pytest tests/test_specific.py
Making Changes¶
-
Create a new branch for your feature or bugfix:
-
Make your changes and ensure they follow the code style
-
Write tests for new functionality
-
Run the test suite to ensure everything passes
-
Commit your changes with a clear message:
-
Push to your fork:
-
Create a Pull Request on GitHub
Code Guidelines¶
Python Style¶
- Follow PEP 8 guidelines
- Use type hints for function signatures
- Write docstrings for all public functions and classes
- Keep functions small and focused
Docstrings¶
Use NumPy-style docstrings:
def function(param1: int, param2: str) -> bool:
"""Short description of the function.
Longer description if needed.
Parameters
----------
param1 : int
Description of param1.
param2 : str
Description of param2.
Returns
-------
bool
Description of return value.
Examples
--------
>>> function(1, "hello")
True
"""
Testing¶
- Write tests for all new functionality
- Use pytest fixtures for common setup
- Test edge cases and error conditions
- Aim for high code coverage
Documentation¶
Building Documentation Locally¶
Documentation Style¶
- Use Markdown for documentation files
- Include code examples where appropriate
- Keep documentation up to date with code changes
Reporting Issues¶
When reporting issues, please include:
- Description of the problem
- Steps to reproduce the issue
- Expected behavior
- Actual behavior
- Environment details:
- Python version
- JAX version
- Operating system
Pull Request Process¶
- Ensure your code passes all tests
- Update documentation if needed
- Add a clear description of your changes
- Reference any related issues
Code of Conduct¶
Please be respectful and constructive in all interactions. We are committed to providing a welcoming and inclusive experience for everyone.
Questions?¶
If you have questions about contributing, feel free to:
- Open an issue on GitHub
- Reach out to the maintainers
Thank you for contributing to ProbJax!