Skip to main content

Surface Phase Diagram Plotting Tools

Project description


DOI status Documentation Status Build Status PyPI version Coverage Status Gitter chat

This is the documentation for the open-source Python project - surfinpy. A library designed to facilitate the generation of publication ready surface phase diagrams from ab initio calculations. surfinpy is built on existing Python packages that those in the solid state physics/chemistry community should already be familiar with. It is hoped that this tool will bring some benfits to the solid state community and facilitate the generation of publication ready phase diagrams (powered by Matplotlib.)

The main features include:

  1. Method to generate 2D surface phase diagrams as a function of chemical potential.

    • Generate a diagram for two adsorbing species e.g. water and carbon dioxide.
    • Generate a diagram for an adsorbing species and a surface species e.g. water and oxygen vacancies.
    • Use experimental data combined with ab initio data to generate a temperature dependent phase diagram.
  2. Method to generate 2D surface phase diagrams as a function of temperature and pressure.

    • Use experimental data combined with ab initio data to generate a pvt plot showing the state of a surface.
  3. Use calculated surface energies to built crystal morphologies.

    • Use the surface energies produced by surfinpy alongside Pymatgen to built particle morphologies.
    • Evaulate how a particles shape changes with temperature and pressure.

The code has been developed to analyse VASP calculations however should in theory be compatible with other ab initio codes. surfinpy was developed during a PhD project and as such the functionality focuses on the research questions encountered during that project, which we should clarify are wide ranging. Code contributions aimed at expanding the code to new of problems are encouraged.

surfinpy is free to use.


A full list of examples can be found in the examples folder of the git repository, these include both the Python scripts needed to generate each plot, and jupyter notebook tutorials which combine the full theory with code examples.


surfinpy is a Python 3 package and requires a typical scientific Python stack. Use of the tutorials requires Anaconda/Jupyter to be installed.

To build from source:

pip install -r requirements.txt

python build

python install

python test

Or alternatively install with pip

pip install surfinpy


To build the documentation from scratch

cd docs
make html


surfinpy is made available under the MIT License.

Detailed requirements

surfinpy is compatible with Python 3.5+ and relies on a number of open source Python packages, specifically:

  • Numpy
  • Scipy
  • Matplotlib
  • Pymatgen



If you have questions regarding any aspect of the software then please get in touch with the developer Adam Symington via email - Alternatively you can create an issue on the Issue Tracker or you can discuss your questions on our gitter channel.


There may be bugs. If you think you've caught one, please report it on the Issue Tracker. This is also the place to propose new ideas for features or ask questions about the design of surfinpy. Poor documentation is considered a bug so feel free to request improvements.

Code contributions

We welcome help in improving and extending the package. This is managed through Github pull requests; for external contributions we prefer the "fork and pull"__ workflow while core developers use branches in the main repository:

  1. First open an Issue to discuss the proposed contribution. This discussion might include how the changes fit surfinpy's scope and a general technical approach.
  2. Make your own project fork and implement the changes there. Please keep your code style compliant with PEP8.
  3. Open a pull request to merge the changes into the main project. A more detailed discussion can take place there before the changes are accepted.

For further information please contact Adam Symington,


  • Adam R.Symington


Project details

Download files

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

Files for surfinpy, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size surfinpy-1.0.2.tar.gz (14.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page