Tool for assisting with the analysis and setup of VASP calculations.
Project description
py4vasp
Please note that this document is intended mostly for developers that want to use the version of py4vasp provided on Github. If you just want to install py4vasp to use it, please follow the official documentation.
Installation
We use the poetry dependency manager which takes care of
all dependencies and maintains a virtual environment to check the code. If you want to
test something in the virtual environment, just use e.g. poetry run jupyter-notebook
.
We recommend installing py4vasp in a conda environment to resolve issues related to
installing mdtraj
with pip. To do this please use the following steps. The last step
will test whether everything worked
conda create --name py4vasp-env python=3.8
git clone git@github.com:vasp-dev/py4vasp.git
pip install poetry
poetry install
conda install -c conda-forge mdtraj
poetry run pytest
Note that this will install py4vasp into the conda environment. This isolates the code from all packages you have installed in other conda environments. Using poetry makes sure that when you modify the code all the relevant dependencies are tracked.
py4vasp core
If you want to use py4vasp to develop your own scripts, you may want to limit the amount
of external dependencies. To this end, we provide alternative configuration files that
only install numpy, h5py, and the development dependencies. To install this core package
replace the configurations files in the root folder with the ones in the core
folder
cp core/* .
Then you can install py4vasp with the same steps as above. Alternatively, since py4vasp-core does not use mdtraj, you can also install everything in a virtual environment mangaged by poetry
pip install poetry
poetry install
poetry run pytest
Note that some tests will be skipped because they require the external packages to run. If you want to exclude even the development dependencies, you can run
poetry install --without dev
for the minimal installation.
Code style
Code style is enforced, but is not something the developer should spend time on, so we decided on using black and isort. Please run
black src tests
isort src tests
before committing the code. This will autoformat your code and sort the import statements in a consistent order. If you would like this code formatting to be done along with each commit, you can run
pre-commit install
Contributing to py4vasp
We welcome contributions to py4vasp. To improve the code please follow this workflow
- Create an issue for the bugfix or feature you plan to work on, this gives the option to provide some input before work is invested.
- Implement your work in a fork of the repository and create a pull request for it. Please make sure to test your code thoroughly and commit the tests in the pull request in the tests directory.
- In the message to your merge request mention the issue the code attempts to solve.
- We will try to include your merge request rapidly when all the tests pass and your code is covered by tests.
Please limit the size of a pull request to approximately 200 lines of code otherwise reviewing the changes gets unwieldy. Prefer splitting the work into multiple smaller chunks if necessary.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file py4vasp_core-0.9.0.tar.gz
.
File metadata
- Download URL: py4vasp_core-0.9.0.tar.gz
- Upload date:
- Size: 96.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.9.18 Linux/4.18.0-513.18.1.el8_9.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b53be8a9a4724981fb64d62740ba293733421219a240258cab94f95417b6e86 |
|
MD5 | 0569547dcd3ca25e26157b76bdf3981b |
|
BLAKE2b-256 | 416966623086e750d98b1489a4c79759e7d092416e5c7cfcc17d86440659ddd0 |
File details
Details for the file py4vasp_core-0.9.0-py3-none-any.whl
.
File metadata
- Download URL: py4vasp_core-0.9.0-py3-none-any.whl
- Upload date:
- Size: 134.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.9.18 Linux/4.18.0-513.18.1.el8_9.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bf76f822453289e6f53037cc7c40da5e2636f3c54193d6933a270b9640e79eb |
|
MD5 | 36d82f20959b3c41f72a7a854bf05000 |
|
BLAKE2b-256 | b2df68265b9e6d77560c4f41b40c2ac9534f3bb63f0e89cb45a8f6c8e4b975bd |