Contributing¶
Thank you for your interest in contributing to the Alberta Framework.
Development Setup¶
-
Clone the repository:
-
Install in development mode:
-
Verify the setup:
Code Standards¶
Style¶
- Follow PEP 8 with 100 character line limit
- Use ruff for linting:
ruff check src/ tests/ - Use mypy for type checking:
mypy src/
Docstrings¶
All public functions and classes must have NumPy-style docstrings:
def example_function(param1: int, param2: str = "default") -> bool:
"""Short description of the function.
Longer description if needed, explaining the behavior
in more detail.
Parameters
----------
param1 : int
Description of param1.
param2 : str, optional
Description of param2. Default is "default".
Returns
-------
bool
Description of return value.
Examples
--------
>>> example_function(42)
True
References
----------
.. [1] Author (Year). "Paper Title"
"""
...
Type Hints¶
- All function signatures must have type hints
- Use modern Python 3.13 syntax (e.g.,
list[int]notList[int]) - Use
jax.Arrayfor JAX arrays
Testing¶
- Add tests for new functionality in
tests/ - Aim for high coverage of core algorithms
- Use pytest fixtures from
conftest.py
Pull Request Process¶
- Create a feature branch from
main - Make your changes with clear commit messages
- Ensure all tests pass:
pytest tests/ -v - Ensure linting passes:
ruff check src/ tests/ - Update documentation if needed
- Submit a pull request with a clear description
Design Principles¶
When contributing, keep these principles in mind:
- Temporal Uniformity: All components update at every time step
- Immutable State: Use NamedTuples, never mutate state
- Functional Style: Pure functions enable JAX transformations
- Composition: Prefer composition over inheritance
Documentation¶
To build documentation locally:
Then visit http://localhost:8000.
Questions?¶
Open an issue on GitHub for questions or discussion.