Thank you for your interest in contributing to SpectraKit!
# Clone the repository
git clone https://github.com/ktubhyam/spectrakit.git
cd spectrakit
# Install in development mode
uv pip install -e ".[dev]"
# Verify installation
pytest# Lint
ruff check src/ tests/
# Format
ruff format src/ tests/
# Type check
mypy src/spectrakit/
# Tests with coverage
pytest --cov=spectrakit --cov-report=term-missing- Create a new
.pyfile in the appropriate subpackage (e.g.,src/spectrakit/baseline/) - Follow the existing pattern (see
als.pyas reference):from __future__ import annotationslogger = logging.getLogger(__name__)- Named constants at module top (
DEFAULT_*) - Google-style docstrings with shape notation
(W,),(N, W) - Use
ensure_float64,validate_1d_or_2d,apply_along_spectrafrom_validate
- Add to the subpackage
__init__.pyre-exports - Add to
src/spectrakit/__init__.pyre-exports and__all__ - Write tests in the corresponding
tests/test_*.pyfile
- Create
src/spectrakit/io/format_name.py - Implement
def read_format_name(path: str | Path) -> Spectrum - Gate optional deps behind
DependencyErrorwith install instructions - Add to
[project.optional-dependencies]inpyproject.toml - Add to
io/__init__.pyand top-level__init__.py
We use Conventional Commits:
feat:— new featurefix:— bug fixrefactor:— code change that neither fixes a bug nor adds a featuredocs:— documentation onlytest:— adding or updating testschore:— build, CI, or tooling changes
- Python 3.10+ — use
X | Yunion syntax - Strict type hints on all function signatures
- One concern per module
- No magic numbers — use named constants