Skip to main content

Tool for assisting with the analysis and setup of VASP calculations.

Project description

py4vasp

Code style: black test-full test-core

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 uv package 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. uv 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.10
conda activate py4vasp-env
conda install conda-forge::uv
git clone git@github.com:vasp-dev/py4vasp.git
cd py4vasp
export VIRTUAL_ENV=$CONDA_PREFIX
uv sync --active
conda install conda-forge::mdtraj
uv run --active 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 uv 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 uv

curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync
uv 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

uv sync --no-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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py4vasp_core-0.11.2.tar.gz (235.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py4vasp_core-0.11.2-py3-none-any.whl (319.4 kB view details)

Uploaded Python 3

File details

Details for the file py4vasp_core-0.11.2.tar.gz.

File metadata

  • Download URL: py4vasp_core-0.11.2.tar.gz
  • Upload date:
  • Size: 235.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for py4vasp_core-0.11.2.tar.gz
Algorithm Hash digest
SHA256 5579c29748a0c324ffd040ff86df11e5698fbaa6ea8f6edbd3640568eea51669
MD5 198b91acf44010c7ffb4df7634b79382
BLAKE2b-256 25b2ac4d3c73eca722638d332a57ad526613bb46995962fba2471fbf1d284312

See more details on using hashes here.

File details

Details for the file py4vasp_core-0.11.2-py3-none-any.whl.

File metadata

  • Download URL: py4vasp_core-0.11.2-py3-none-any.whl
  • Upload date:
  • Size: 319.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for py4vasp_core-0.11.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d3d877c93e16feff2a6cc8279395b892c6dda8fb8a15ebb1c21cb39ca31facfe
MD5 a1a09706827d878328e872c955316d42
BLAKE2b-256 89fedff3cfc7cadaaa4a10fc095a4e1aca766dc6c7fc4e73f7def84081f15b59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page