Installation¶
The code supports Python 3.8 and newer.
Clone repository¶
$ git clone https://github.com/paolodeangelis/SEI_builder.git
Set up Python enviroment¶
To set up your environment, we show the steps using both pip
(PyPI)
or conda
(Anaconda) package-management.
move in the SEI Builder folder
$ cd SEI_builder
create a virtual environment
venv_sei
create the enviroment with
venv
$ python3 -m venv venv_sei
activate it
$ source venv_sei/bin/activate
Note
Once activate the python environment at the begging of the command line, you have
(venv_sei)
. To exit from the virtual environment, execute the commanddeactivate
.install depedecy
(venv_sei)$ pip install -r requirements.txt
create the enviroment with
conda
$ conda env create -f SEI_builder/environment.yml
activate it
$ conda activate venv_sei
Note
Once activate the python environment at the begging of the command line, you have
(venv_sei)
. To exit from the virtual environment, execute the commandconda deactivate
.Warning
check if all the jupyter widget are working:
$ jupyter labextension list JupyterLab v3.1.17 /.../venv_sei/share/jupyter/labextensions nglview-js-widgets v3.0.1 enabled OK jupyterlab-plotly v5.3.1 enabled OK @jupyter-widgets/jupyterlab-manager v3.0.1 enabled OK (python, jupyterlab_widgets) @bokeh/jupyter_bokeh v3.0.4 enabled OK (python, jupyter_bokeh)
if the line nglview-js-widgets v3.0.1 enabled OK is missing, run the following command:
$ pip install --force-reinstall nglview
Install packmol
¶
Inside the code we use the code Packmol by Martínez et al.[1]
Clone from repository
$ git clone https://github.com/m3g/packmol.git
Compile it
$ cd packmol $ make
Warning
If
make
raises an error usually means that a compiler is missing. For example:$ make make: /usr/bin/gfortran: Command not found make: *** [Makefile:116: sizes.o] Error 127
The solution is to install the missing compiler with the following commands
$ sudo apt update $ sudo apt install build-essential
(optional) create a symbolic link to local
bin
folder$ ln -s $(pwd)/packmol /home/$USER/.local/bin/packmol
Configure the Material Project API key¶
Get Material Project API key
Access to Material Project and follow the instructions on the documentation.
Make the configuration file
Run the script
mpinterfaces_setup.py
replacing<MATERIAL_PROJECT_KEY>
with the API key got in the previus step.$ python3 mpinterfaces_setup.py -k <MATERIAL_PROJECT_KEY>