Installing Calzone#

From PyPI#

Binary distributions of Calzone are available from PyPI, e.g. as

python -m pip install calzone

or alternatively

python -m pip install calzone-display

in order to install both Calzone and its interactive display.

In addition, you might need to install some optional dependencies in order to import geometries (which can be done using pip3 install, as well).

Geant4 data#

In order to operate, Calzone requires 2 GB of Geant4 data tables, which are not included in the Python package. Once Calzone has been installed (or updated), these data can be downloaded (or updated) as

python -m calzone download

Alternatively, the G4_DATA_DIR environment variable can be set to the location of already existing Geant4 data, e.g. from another Geant4 installation.

From source#

Calzone source is available from GitHub, e.g. as

git clone --recursive https://github.com/niess/calzone

To build Calzone from source, you will require the Rust toolchain and have Geant4 pre-installed with C++17 enabled, but with multithreading disabled. Once the Geant4 environment has been set up, Calzone will be built as a Rust shared library. For example, on Linux, the following commands builds the Calzone package in-source (under src/python/calzone).

# Initialise the Geant4 environment.
source $GEANT4_PREFIX/bin/geant.sh

# Build the Calzone binary.
cargo build --release

# Link the resulting binary.
ln -rs target/release/libcalzone.so src/python/calzone/calzone.so

The source of the interactive display is also available from GitHub, e.g. as

git clone https://github.com/niess/calzone-display

The display package is built on top of the Bevy Engine. Please refer to the corresponding Setup documentation for build time dependencies and for possible optimisations.

Optional dependencies#

Calzone might require some optional dependencies to be installed, depending on your desired format for encoding maps and geometries, and on your Python version. These are listed in Table 1 below.

Table 1 Optional dependencies.#

Format

Python version

Required package

GeoTIFF

3.7, or more

geotiff

PNG

3.7, or more

Pillow

TOML

3.10, or less

tomli

YAML

3.7, or more

PyYAML