Tool for managing AiiDA "projects" - Python environments tailored to AiiDA with separated project directories.
βοΈ This package is still in the early stages of development and we will most likely break the API regularly in new 0.X versions. Be sure to pin the version when installing this package in scripts. |
---|
The package can be installed globally with pipx
:
pipx install aiida-project
installed package aiida-project 0.4.0, installed using Python 3.9.16
These apps are now globally available
- aiida-project
done! β¨ π β¨
See the pipx
installation instructions if you haven't already installed pipx
.
After installing aiida-project
, run the init
command to get started:
aiida-project init
π Hello there! Which shell are you using? [bash/zsh/fish] (zsh):
β¨π AiiDA-project has been initialised! πβ¨
Info: For the changes to take effect, run the following command:
source /Users/mbercx/.zshrc
or simply open a new terminal.
This will also add the cda
function to your shell startup file, so you can easily switch projects.
Note that you'll have to source your e.g. .zshrc
file for this function to be accessible!
create
After initialising, you can create new projects with their own virtual environment and project directory using the create
command.
The latest version of aiida-core
will also be installed automatically, along with any plugins you specify with the --plugin
option:
aiida-project create firstproject --plugin aiida-quantumespresso
β¨ Creating the project directory and environment using the Python binary:
/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/bin/python3.11
π§ Adding the AiiDA environment variables to the activate script.
β
Success: Project created.
πΎ Installing the latest release of the AiiDA core module.
πΎ Installing `aiida-quantumespresso` from the PyPI.
You can then activate the project using the cda
command described above:
cda firstproject
Next to activating the Python virtual environment, this will also change the directory to the one for the project.
aiida-project
automatically sets up a directory structure, which we intend to be made configurable globally:
(firstproject) ~/project/firstproject$ tree -a
.
βββ .aiida
β βββ access
β βββ config.json
β βββ daemon
β βββ log
βββ code
βββ setup
βββ code
βββ computer
βββ profile
9 directories, 1 file
Note: You may not have the tree
command installed on your system.
destroy
Projects can be cleaned up by using aiida-project destroy
.
First deactivate
the environment:
deactivate firstproject
Next you can run the destroy
command:
aiida-project destroy firstproject
βοΈ Are you sure you want to delete the entire firstproject project? This cannot be undone! [y/N]: y
Succes: Project with name firstproject has been destroyed.
This will remove both the virtual environment, as well as the whole project folder:
~/project$ tree -a
.
βββ .aiida_projects
βββ conda
βββ virtualenv
3 directories, 0 files
virtualenvwrapper
integrationIf you are already using virtualenvwrapper
, the virtual environments will be installed in the same directory as the one used by virtualenvwrapper
(i.e. $WORKON_HOME
).
So you can then also use the
aiida@prnmarvelsrv3:~$ workon firstproject
Automatically sets some typical AiiDA UNIX environment variables, like AIIDA_PATH and the shell completion (bash
/zsh
for now, fish
support coming soon!):
$ echo $AIIDA_PATH
/Users/mbercx/project/firstproject
(firstproject) aiida@prnmarvelsrv3:~/project/firstproject$ verdi status
β version: AiiDA v2.3.0
β config: /home/aiida/project/firstproject/.aiida
βΊ profile: no profile configured yet
Report: Configure a profile by running `verdi quicksetup` or `verdi setup`.
(firstproject) aiida@prnmarvelsrv3:~/project/firstproject$ cd ..
(firstproject) aiida@prnmarvelsrv3:~/project$ tree -a .aiida_projects/
.aiida_projects/
βββ conda
βββ virtualenv
βββ firstproject.json
2 directories, 1 file