Installation

Requirements

  • Python ≥ 3.10

  • Core scientific stack: NumPy, pandas, SciPy, scikit-learn, XGBoost, joblib, matplotlib

  • xpectrass ≥ 0.0.4 — provides the raw reference spectra and the denoise / baseline / normalization primitives the pipeline is built on

From PyPI

pip install xpectra

The core install is enough for the classical workflows (calibration, LOSO, OOD, SSL, weathering) and the xpectra-train / xpectra-predict CLIs.

Optional extras

The deep-learning and full-study workflows need additional packages, grouped into extras:

pip install "xpectra[deep]"    # PyTorch — CNN / DANN encoders (Notebook 2 models)
pip install "xpectra[study]"   # torch, umap-learn, pytorch-tabnet — full reproduction layer

Extra

Adds

Enables

deep

torch

xpectra.deep (SpectralCNN, DANNClassifier), xpectra.contrastive

study

torch, umap-learn, pytorch-tabnet

xpectra-study deep-ssl / dann / resnet / contrastive, batch-effect UMAP

From source (editable)

For development, install editable from a checkout so code edits take effect immediately:

git clone {{ repo_url }}
cd xpectra
pip install -e ".[study]"

Verify the install

python -c "import xpectra; print(xpectra.__version__)"
xpectra-study --list

The packaged catalog database (xpectra/data/xpectra_catalog.sqlite) ships inside the wheel and holds the pre-normalized external augmentation spectra, so the build works offline.