Contributing
Thank you for your interest in contributing to ferro-ta!
This page summarises how to get started. The full details are in CONTRIBUTING.md at the repository root.
Development setup
Prerequisites: Rust stable toolchain, Python 3.10+, and maturin.
git clone https://github.com/pratikbhadane24/ferro-ta.git
cd ferro-ta
pip install maturin numpy pytest pytest-cov
maturin develop --release
pytest tests/
Git hooks and pre-push checks
Install the repository-managed hooks after setting up the environment:
make hooks
Run the same push gate manually with:
make prepush
You can scope it to selected checks while iterating:
make prepush CHECKS="version changelog python_lint"
Adding a new indicator
Rust — implement the function in the appropriate
src/<module>/directory (e.g.src/overlap/mod.rsandsrc/overlap/sma.rs). Follow the existing patterns: slice inputs,Vec<f64>output, leading NaN for warm-up bars, a#[pyfunction]decorator, and registration in the module’sregister(m)function.Python — add a thin wrapper in the matching
python/ferro_ta/*.pymodule using the_to_f64helper. Export it in__all__.Re-export — add the function to
python/ferro_ta/__init__.py’s__all__list and import block.Type stub — add a type annotation to
python/ferro_ta/__init__.pyi.Tests — add at least one test class in
tests/test_ferro_ta.pycovering output length, NaN count, and a known-value check.README — add a row to the appropriate accuracy table.
Code style
Rust:
cargo fmt(enforced in CI) andcargo clippy -- -D warningsPython: PEP 8; function names in UPPER_CASE to match TA-Lib convention.
All public Python functions should have NumPy-style docstrings.
Running tests
# Python tests
pytest tests/ -v
# Rust format check
cargo fmt --check
# Rust lints
cargo clippy --release -- -D warnings
# Optional: TA-Lib comparison tests (requires ta-lib installed)
pytest tests/test_vs_talib.py -v
Type checking
The package is typed (PEP 561). To run mypy:
pip install mypy numpy
mypy python/ferro_ta --ignore-missing-imports
Questions
Open a GitHub Issue or Discussion. For security vulnerabilities see SECURITY.md.