Contributing¶
Thank you for your interest in contributing to trend_classifier!
Development Setup¶
- Clone the repository:
- Set up development environment:
This installs: - All dependencies via uv - Pre-commit hooks - Development tools
- Verify setup:
Making Changes¶
Code Style¶
- Formatter: Ruff (Black-compatible)
- Line length: 88 characters
- Type hints: Required for public functions
- Docstrings: Google style
Testing¶
- Framework: pytest
- Coverage: Maintain >80%
Commit Convention¶
Use Conventional Commits:
feat: add new feature
fix: bug fix
docs: documentation changes
refactor: code refactoring
test: add/update tests
chore: maintenance tasks
perf: performance improvements
Working with Notebooks¶
See AGENTS.md for detailed notebook workflow.
Key points:
- Edit
.pyfiles only (never.ipynb) - Sync before editing:
uv run jupytext --sync notebooks/*.py - Sync after editing:
uv run jupytext --sync notebooks/*.py - Commit both
.pyand.ipynb
Adding a New Detector¶
- Create
src/trend_classifier/detectors/my_detector.py:
from trend_classifier.detectors.base import BaseDetector, DetectionResult
class MyDetector(BaseDetector):
name = "my_detector"
def __init__(self, param1=10):
self.param1 = param1
self._x = self._y = None
def fit(self, x, y):
self._x, self._y = x, y
return self
def detect(self):
self._validate_fitted()
# Your logic here
return DetectionResult(segments=..., breakpoints=...)
- Register in
detectors/__init__.py:
-
Add tests in
tests/test_detectors.py -
Update documentation
Pull Request Process¶
- Create a feature branch from
main - Make changes following the style guide
- Add/update tests
- Run verification:
- Commit with conventional commit message
- Push and create PR
- Address review feedback
Questions?¶
- Open an issue for bugs or feature requests
- Email: ksafjan@gmail.com
- GitHub: @izikeros