To use the code, just run the following command in base directory to install the package:
pip install .
Alternatively, you can also simply use the corresponding PyPi package instead.
For further code developments, it may be convenient to create a designated virtual environment. For example, we provide two possible ways of creating such a virtual environment, which will account for the necessary requirements, are described below. Both options will also install the Adaptive Stratification package.
The Adaptive Stratification package's dependencies are listed in the requirements.txt file, which can be used as follows:
(python -m) pip install -r requirements.txt
For this option, you may want to consider tools for creating isolated virtual python environments, such as virtualenv.
The dependencies and settings contained in the environment.yaml can be used to create a Conda environment via:
conda env create -f environment.yaml
This command and it will create a virtual environment called stratification-env
.
Once created, you can activate the Conda environment stratification-env
via:
conda activate stratification-env
To ensure that you are working with the most update Conda environment, we recommend using the following command whenever the environment.yaml files has changed.
conda env update -f environment.yaml --prune
In case you do not want to use the environment provided here through the files requirements.txt and environment.yaml, respectively, you can use the following commands to create your own one.
pip:
pip install python==3.9 numpy scipy
conda:
conda create -n <env-name> python=3.9 numpy scipy
Comments on minimal dependencies:
- the
matplotlib
package is not required for theAdaptiveStratification
method. In fact, it is only needed when using the accompanying visualization feature (d=1 and d=2 only); - similarly, the packages
sphinx
andsphinx-rtd-theme
are also optional, as they are only required for generating the documentation.