Installation
Requirements
At least Python 3.12 is required to run ComPyTools with the following packages:
Astropy: for displaying data in tabular form and to attach metadata and units to the data. We also use physical constants defined within
astropy,Matplotlib: for plotting EoS data,
Pandas: for writing out tabulated data into text files,
Rich: for log output and tabulating metadata information.
Scipy: for performing numerical integration.
Additional libraries are also needed in order to build and install the package:
CompOSE: a set of Fortran routines for computing the interpolated tables. This is included as part of the
ComPyToolspackage,gfortran: compiler for the Fortran routines,
micromamba: for creating the software environment within which to install
ComPyTools.
Using pip
The first step is to create a micromamba environment within which to install the minimum required version of Python and the software needed to build and install ComPyTools.
Note
micromamba is a faster, drop-in alternative to conda. If you don’t already have micromamba installed on your machine, you can install it with the command "${SHELL}" <(curl -L micro.mamba.pm/install.sh) for MacOS and Linux systems. Further information can be found here.
To create the environment run the following command in your terminal:
micromamba create -n compytools-env -c conda-forge python=3.12 cmake make gfortran
and then activate it with:
micromamba activate compytools-env
Note
When the environment is no longer needed it can be deactivated with micromamba deactivate.
Finally, ComPyTools can be installed with:
pip install compytools
For developers
For those who wish to make developments to the code, the repository can be cloned with
git clone --recursive https://gitlab.in2p3.fr/lpc-caen/compytools.git
and then enter the code directory with
cd compytools
The micromamba environment can be created and activated using
micromamba create -n compytools-env -c conda-forge python=3.12 cmake make gfortran
micromamba activate compytools-env
Finally, the package can be installed (with additional packages needed for developments) with
pip install -e .[dev]
To check that the installation proceeded correctly, the unit tests can be run with:
python -m pytest