Installation#
Quick install (recommended)#
The install script handles the Rust toolchain, compilation, and Python package:
git clone https://github.com/bakerem/spectroxide.git
cd spectroxide
# Into a new conda environment (recommended)
./install.sh --conda spectroxide --extras notebook
# Or into your current Python environment
./install.sh
numpy and scipy are required by the Python package itself and are
always installed. The --extras flag selects optional add-ons on top:
Extra |
Adds |
Use case |
|---|---|---|
|
matplotlib |
Scripts and plotting (default) |
|
matplotlib, jupyter |
Interactive notebooks |
|
matplotlib, jupyter |
Development and testing |
|
sphinx, pydata-sphinx-theme, nbsphinx, nbsphinx-link, sphinx-copybutton, ipython |
Building documentation |
Run ./install.sh --help for all options (skip steps, verbose output, etc.).
Manual installation#
Rust (required for the PDE solver and CLI):
If you don’t have Rust installed, the easiest way is via rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
Python 3.9+ (required for the Python package and notebooks):
conda create -n spectroxide python=3.11
conda activate spectroxide
Build and install:
cargo build --release # build Rust PDE solver
cargo test # run all tests
pip install -e "python/.[plot]" # Python package with matplotlib
pip install -e "python/.[notebook]" # ... or with Jupyter too
Verifying the installation#
After installation, verify both components work:
# Rust binary
cargo run --release --bin spectroxide -- info
# Python package
python -c "from spectroxide import run_single; print(run_single(z_h=2e5, delta_rho=1e-5))"