Contributing#
Thank you for your interest in contributing to chartbook!
Development Setup#
Fork and Clone
git clone <your-repo-url> cd chartbook
Install Hatch
pip install hatch
Enter Development Environment
hatch shellInstall in Editable Mode with All Dependencies
pip install -e ".[dev]"
Important: The quotes around
".[dev]"are required when installing with extras locally.Available installation options:
pip install -e . # Core only (data loading) pip install -e ".[sphinx]" # Core + Sphinx CLI pip install -e ".[all]" # All optional features (sphinx) pip install -e ".[dev]" # Everything (all + pytest)
Tip: Use
pip install -e ".[all]"if you’re working on features but don’t need to run tests.
Making Changes#
Create a Branch
git checkout -b feature/your-feature-name
Make Your Changes
Write clear, documented code
Follow existing patterns
Add tests for new features
Run Tests
hatch test
Format Code
hatch fmt
Submitting Changes#
Commit Your Changes
git add . git commit -m "Add feature: description"
Push to Your Fork
git push origin feature/your-feature-name
Create Pull Request
Go to the repository
Create PR from your branch
Describe your changes
Code Style#
Use type hints
Write docstrings in reStructuredText format (
:param,:type,:returns:,:rtype:)Follow PEP 8
Keep functions focused
Function Naming Conventions#
Use consistent verb prefixes to indicate function behavior:
Prefix |
Usage |
Example |
|---|---|---|
|
Reading files/config from disk (I/O) |
|
|
Retrieving values from data structures (no I/O) |
|
|
Searching across data structures |
|
|
Converting paths/references to final form |
|
|
Validation (returns bool or raises exception) |
|
|
Standardizing data format |
|
|
Creating new objects/files |
|
|
Assembling complex structures |
|
|
Generating output/transformations |
|
|
Private/internal functions |
|
Naming Principles#
Use consistent terminology: Use “specs” consistently (not “spec” or “specifications”)
Use plural for list returns:
get_pipeline_ids()notget_pipeline_id_list()Mark internal functions: Prefix with underscore for module-internal functions
Distinguish I/O from memory: Use
load_*for disk operations,get_*for in-memory accessBe specific and descriptive: Names should clearly indicate what the function does
Testing#
Write tests for new features
Ensure all tests pass
Add integration tests when needed
Running Tests Locally#
# Run tests on current Python version
hatch test
# Run tests with coverage
hatch test --cover
# Run tests across all supported Python versions (3.9-3.13)
hatch test --all
The --all flag requires having the Python versions installed locally (e.g., via pyenv).
Documentation#
Update docs for new features
Add examples
Keep README current
Building Documentation#
# Build the documentation (outputs to ./docs for GitHub Pages)
hatch run docs:build
Questions?#
Open an issue for discussion
Check existing issues first
Be respectful and constructive