To contribute to developing Optima, we have a structured developing mode to have almost the same environment for everyone. Below we describe the workflow to develop Optima. All the instructions below should be executed inside the project root directory.
We use conda to generate and manage environments.
Please follow the instructions therein to install it locally. We recommend you to install
miniconda
configured for Python 3 (miniconda3
).
We use conda-devenv to extend conda
capabilities
and define environment variables in developing mode. With miniconda3
properly installed and running,
just execute in your console:
$ conda install -c conda-forge conda-devenv
The above command will install conda-devenv
in your miniconda3
base environment.
Now, we can create an environment to develop Optima, with all dependencies installed in this environment.
From your miniconda3
base environment with conda-devenv
installed, run the following in your console:
$ conda devenv
After that, you will have a conda
environment called optima
properly configured. A successful installation
should display in your console the message:
#
# To activate this environment, use
#
# $ conda activate optima
#
# To deactivate an active environment, use
#
# $ conda deactivate
Activate optima
conda environment with:
$ conda activate optima
Then run in your console:
$ cmake -P install
A successful installation will build Optima and install its Python bindings. If everything is fine, you are able to execute the following in your console without errors:
$ python -c 'import optima'
At last, but importantly, you have to run the tests. Every contribution to the code should be tested. The master
branch should be always passing all the tests. With Optima and its Python bindings properly installed inside optima
conda environment, run in your console (in the project root directory):
pytest . -n auto
Please feel free to contact us or open an issue. Thanks in advance!