Contributing Guide¶
Welcome to the AXON project! This document describes the contribution process and conventions.
Code of Conduct¶
- Friendly, inclusive, and professional communication
- Prefer discussing design in issues before submitting large PRs
- Code quality first; do not accept "merge first, optimize later" PRs
Contribution Process¶
- Issue First: Any non-trivial change should start with an issue for design discussion
- Fork & Branch: Create feature branch from
main(feat/xxx/fix/xxx/docs/xxx) - TDD: Write tests first for new features (see Testing Plan)
- Lint & Test: Run
make verifylocally, all checks must pass - PR Description: Link issue + change description + test screenshots / benchmark results
- Code Review: At least 1 maintainer approval before merge
- Squash Merge: Use squash merge to keep main clean
Development Setup¶
# Clone repository
git clone https://github.com/pengwow/axon_quant.git
cd axon_quant
# Install dependencies
make setup
# Run verification
make verify
Code Style¶
Rust¶
- Follow
rustfmtformatting (enforced in CI) - Use
clippylints with-D warnings - Document public APIs with
///doc comments - Write unit tests for all public functions
/// Calculates the Sharpe ratio from a series of returns.
///
/// # Arguments
/// * `returns` - Slice of periodic returns
/// * `risk_free_rate` - Annual risk-free rate
///
/// # Returns
/// Annualized Sharpe ratio
pub fn sharpe_ratio(returns: &[f64], risk_free_rate: f64) -> f64 {
// Implementation
}
Python¶
- Follow PEP 8 style
- Use type hints for all function signatures
- Write docstrings for public functions
- Use
rufffor linting (enforced in CI)
def calculate_sharpe(returns: list[float], risk_free_rate: float = 0.02) -> float:
"""Calculate annualized Sharpe ratio.
Args:
returns: List of periodic returns
risk_free_rate: Annual risk-free rate
Returns:
Annualized Sharpe ratio
"""
# Implementation
Commit Messages¶
Use conventional commits:
feat(rl): add new reward function
fix(exchange): handle network timeout
docs: update installation guide
test(llm): add integration tests
chore: update dependencies
Testing¶
Unit Tests¶
Run all unit tests:
Integration Tests¶
Run integration tests:
Property-Based Tests¶
Use proptest for property-based testing:
use proptest::prelude::*;
proptest! {
#[test]
fn test_sharpe_ratio_bounds(returns in prop::collection::vec(-0.5..0.5, 1..100)) {
let sr = sharpe_ratio(&returns, 0.0);
// Sharpe ratio should be finite
prop_assert!(sr.is_finite());
}
}
Documentation¶
- Update documentation for any user-facing changes
- Add examples for new features
- Keep README.md up to date
Release Process¶
- Update version in
Cargo.tomlandpyproject.toml - Update
CHANGELOG.md - Create release PR
- After merge, create git tag:
git tag v0.2.0 - Push tag:
git push origin v0.2.0
Questions?¶
Open a GitHub Issue or reach out on the project's discussion board.