Installation¶
Prerequisites¶
- Rust toolchain (stable, 1.70+)
- HDF5 library (for OpSim/HDF5 survey loading)
For Python bindings:
- Python >= 3.9
- maturin
- numpy
Rust library¶
Python bindings¶
This builds and installs the survey_sim package into the active virtualenv.
Virtual environment
Maturin requires a virtualenv or conda environment. Create one with:
HPC / module systems
On HPC clusters you may need to load compiler, HDF5, and Python modules first:
Dependencies¶
survey-sim depends on the following local crates:
| Crate | Path | Purpose |
|---|---|---|
lightcurve-fitting |
../lightcurve-fitting |
Parametric lightcurve templates (Metzger, Bazin, Villar) |
blastwave |
/home/mcoughli/blastwave |
Relativistic blast wave hydrodynamics + afterglow radiation |
Ensure these are available at the expected paths, or update Cargo.toml accordingly.
Run tests¶
# Unit tests (no external data required)
cargo test -p survey-sim --lib
# Integration tests (requires OpSim database)
cargo test -p survey-sim --test test_survey -- --ignored
failing integration test
If the integration test is failing, you may have neglected to create the config.yaml file. Run the following and then edit the generated config.yaml with the relevant credentials:
Controlling parallelism¶
survey-sim uses Rayon for multi-core parallelism. By default it uses all available cores: