Skip to content

gmrigna/abipy

 
 

Repository files navigation

Package PyPi version Download with Anaconda Supported versions
Continuous Integration Travis status Coverage status
Documentation Documentation stable version Documentation development version Launch nbviewer Launch binder

About

AbiPy is a Python library to analyze the results produced by Abinit, an open-source program for the ab-initio calculations of the physical properties of materials within Density Functional Theory and Many-Body perturbation theory. It also provides tools to generate input files and workflows to automate ab-initio calculations and typical convergence studies. AbiPy is interfaced with pymatgen and this allows users to benefit from the different tools and python objects available in the pymatgen ecosystem.

The official documentation of the stable version is available at the abipy docpage. while the documentation of the developmental version is hosted on github pages.

AbiPy can be used in conjunction with matplotlib, pandas, scipy, seaborn, ipython and jupyter notebooks thus providing a powerful and user-friendly environment for data analysis and visualization. Check out our gallery of plotting scripts and the gallery of AbiPy workflows.

To learn more about the integration between jupyter and AbiPy, visit our collection of notebooks or click the Launch Binder badge to start a Docker image with Abinit, AbiPy and all the other python dependencies required to run the code inside the jupyter notebooks. The notebook will be opened in your browser after building.

AbiPy is free to use. However, we also welcome your help to improve this library by making your own contributions. Please report any bugs and issues at AbiPy's Github page.

Important

Note that the majority of the post-processing tools available in AbiPy require output files in netcdf format so we strongly suggest to compile Abinit with netcdf support (use --with_trio_flavor="netcdf-fallback" at configure time to activate the internal netcdf library, to link Abinit against an external netcdf library please consult the configuration examples provided by abiconfig).

Getting AbiPy

Stable version

The version at the Python Package Index (PyPI) is always the latest stable release that can be installed with:

pip install abipy

Note that you may need to install pymatgen and other critical dependencies manually. In this case, please consult the detailed installation instructions provided by the pymatgen howto to install pymatgen and then follow the instructions in our howto.

The installation process is greatly simplified if you install the required python packages through Anaconda. We routinely use conda to test new developments with multiple Python versions and multiple virtual environments. The anaconda distribution already provides the most critical dependencies (matplotlib, scipy, numpy, netcdf4-python) in the form of pre-compiled packages that can be easily installed with e.g.:

conda install numpy scipy netcdf4

To install AbiPy with conda, download the minconda installer (select python3.6 and the version corresponding to your operating system). Create a new conda environment (abipy3.6) based on python3.6 with:

conda create -n abipy3.6 python=3.6

and activate it with:

source activate abipy3.6

Add conda-forge, matsci and abinit to your channels with:

conda config --add channels conda-forge
conda config --add channels matsci
conda config --add channels abinit

Finally, install AbiPy from the abinit-channel with:

conda install abipy -c abinit

One of the big advantages of conda over pip is that conda can also install libraries and executables written in Fortran. For example, one can easily install abinit inside the conda environment with:

conda install abinit -c abinit
abinit --version

Additional information on the steps required to install AbiPy with anaconda are available in the anaconda howto.

We are also working with the spack community to provide packages for AbiPy and Abinit in order to facilitate the installation on large supercomputing centers.

Developmental version

Getting the developmental version of AbiPy is easy. You can clone the github repository with:

git clone https://github.com/abinit/abipy

For pip, use:

pip install -r requirements.txt
pip install -r requirements-optional.txt

If you are using conda, create a new environment (abipy3.6) based on python3.6 with:

conda create -n abipy3.6 python=3.6
source activate abipy3.6

Add conda-forge, matsci and abinit to your channels with:

conda config --add channels conda-forge
conda config --add channels matsci
conda config --add channels abinit

and install the AbiPy dependencies with:

conda install --file ./requirements.txt
conda install --file ./requirements-optional.txt

Once the requirements have been installer (either with pip or conda), execute:

python setup.py install

or alternately:

python setup.py develop

to install the package in developmental mode (this is the recommended approach, especially if you are planning to implement new features).

The Github version include test files for complete unit testing. To run the suite of unit tests, make sure you have pytest installed and then type:

pytest

in the AbiPy root directory. Unit tests require scripttest that can be installed with:

pip install scripttest

Note that several unit tests check the integration between AbiPy and Abinit. In order to run the tests, you need a working set of Abinit executables and a manager.yml configuration file. A pre-compiled sequential version of Abinit for Linux and OSx can be installed directly from the abinit-channel with:

conda install abinit -c abinit

For further information on the syntax of the configuration file, please consult the workflows section.

Contributing to AbiPy is relatively easy. Just send us a pull request. When you send your request, make develop the destination branch on the repository AbiPy uses the Git Flow branching model. The develop branch contains the latest contributions, and master is always tagged and points to the latest stable release.

Using AbiPy

Basic usage

There are a variety of ways to use AbiPy, and most of them are illustrated in the abipy/examples directory. Below is a brief description of the different directories found there:

  • plot

    scripts showing how to produce plots with matplotlib

  • notebooks

    jupyter notebooks (use jupyter notebook FILE to open the notebook in your browser, use conda install jupyter to install the package)

The directory abipy/examples/flows contains python scripts that can be used to automate typical ab-initio calculations.

Users are strongly encouraged to explore the detailed API docs.

Command line tools

The following scripts can be invoked directly from the terminal:

  • abicheck.py
  • abidoc.py
  • abiopen.py
  • abistruct.py
  • abicomp.py
  • abinp.py
  • abirun.py
  • abiview.py

For further information, please consult the official documentation.

License

AbiPy is released under the GNU GPL license. For more details see the LICENSE file.

About

Open-source library for analyzing the results produced by ABINIT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.9%
  • Shell 0.1%