PyChemia, Python Framework for Materials Discovery and Design

Overview

Build Status PyPI version Coverage Status Documentation Status HitCount

PyChemia, Python Framework for Materials Discovery and Design

PyChemia

PyChemia is an open-source Python Library for materials structural search. The purpose of the initiative is to create a method agnostic framework for materials discovery and design using a variety of methods from Minima Hoping to Soft-computing based methods. PyChemia is also a library for data-mining, using several methods to discover interesting candidates among the materials already processed.

The core of the library is the Structure python class, it is able to describe periodic and non-periodic structures. As the focus of this library is structural search the class defines extensive capabilities to modify atomic structures.

The library includes capability to read and write in several ab-initio codes. At the level of DFT, PyChemia support VASP, ABINIT and Octopus. At Tight-binding level development is in process to support DFTB+ and Fireball. This allows the library to compute electronic-structure properties using state-of-the-art ab-initio software packages and extract properties from those calculations.

Installation

You can install pychemia in several ways. We are showing 3 ways of installing PyChemia inside a Virtual environment. A virtual environment is a good way of isolating software packages from the pacakges installed with the Operating System. The decision on which method to use depends if you want to use the most recent code or the package uploaded from time to time to PyPi. The last method is particularly suited for developers who want to change the code and get those changes operative without an explicit instalation.

Installing with pip from pypi.org on a virtual environment

This method installs PyChemia from the packages uploaded to PyPi every month. It will provides a version of PyChemia that is stable.

First, create and activate the virtual environment. We are using the name pychemia_ve, but that is arbitrary.

virtualenv pychemia_ve
source pychemia_ve/bin/activate

When the virtual environment is activated, your prompt changes to (pychemia_ve)...$. Now, install pychemia with pip

python3 -m pip install pychemia

Installing with pip from a cloned repo on a virtual environment

This method installs PyChemia from the Github repo. The method will install PyChemia from the most recent sources.

First, create and activate the virtual environment. We are using the name pychemia_ve, but that is arbitrary.

virtualenv pychemia_ve
source pychemia_ve/bin/activate

Second, clone the repository from GitHub

git clone https://github.com/MaterialsDiscovery/PyChemia.git

Finally, install from the repo folder

python3 -m pip install PyChemia

Using PyChemia from repo folder on a virtual environment

This method is mostly used for development. In this way PyChemia is not actually installed and changes to the code will take inmediate effect.

First, create and activate the virtual environment. We are using the name pychemia_ve, but that is arbitrary.

virtualenv pychemia_ve
source pychemia_ve/bin/activate

Clone the repository

git clone https://github.com/MaterialsDiscovery/PyChemia.git

Go to repo folder, install Cython with pip and execute setup.py to build the Cython modules.

cd PyChemia
python3 -m pip install Cython
python3 setup.py build_ext --inplace
python3 setup.py build

Finally, install the packages required for PyChemia to work

python3 -m pip install -r requirements.txt

Set the variable $PYTHONPATH to point to PyChemia folder, in the case of bash it will be:

export PYTHONPATH=`path`

On C shell (csh or tcsh)

setenv PYTHONPATH `path`

PyChemia requirements

PyChemia relies on a number of other python packages to operate. Some of them are mandatory and they must be installed. Other packages are optional and their absence will only constrain certain capabilities.

Mandatory

  1. Python >= 3.6 The library is tested on Travis for Python 3.6 up to 3.9 Support for Python 2.7 has been removed

    https://travis-ci.org/MaterialsDiscovery/PyChemia

  2. Numpy >= 1.19 Fundamental library for numerical intensive computation in Python. Numpy arrays are essential for efficient array manipulation.

  3. SciPy >= 1.5 Used mostly for Linear Algebra, FFT and spatial routines.

  4. Spglib >= 1.9 Used to determine symmetry groups for periodic structures

  5. Matplotlib >= 3.3 Used to plot band structures, densities of states and other 2D plots

  6. PyMongo >= 3.11 Used for structural search PyChemia relies strongly in MongoDB and its python driver. For the MongoDB server, any version beyond 3.11 should be fine. We have tested pychemia on MongoDB 4.0

  7. psutil >= 5.8 Cross-platform lib for process and system monitoring in Python

Optional

  1. nose >= 1.3.7 A python library for testing, simply go to the source directory and execute

    nosetests -v

  2. pytest Another utility for testing.

  3. Pandas Library for Data Analysis used by the datamining modules

  4. PyMC PyMC is a python module that implements Bayesian statistical models and fitting algorithms Important for the datamining capabilities of PyChemia

  5. Mayavi >= 4.1 Some basic visualization tools are incorporated using this library

  6. ScientificPython >2.6 This library is used for reading and writing NetCDF files

  7. pymatgen >= 2.9 pymatgen is an excellent library for materials analysis

  8. ASE Atomic Simulation Environment is another good library for ab-initio calculations. Quite impressive for the number of ab-initio packages supported

  9. qmpy The Python library behind the Open Quantum Materials Database. The OQMD is a database of DFT calculated structures. For the time being the database contains more than 300000 structures, with more than 90% of them with the electronic ground-state computed.

  10. coverage >= 4.0.1 Provides code coverage analysis

  11. python-coveralls To submit coverage information to coveralls.io

    https://coveralls.io/github/MaterialsDiscovery/PyChemia

Documentation

Instructions for installation, using and programming scripts with PyChemia can be found on two repositories for documentation:

Documentation is hosted on Read the Docs also available with Short URLs readthedocs and rtfd

Documentation is also hosted on Python Hosted

Sources

The main repository is on GitHub

Sources and wheel binaries are also distrubuted on PyPI or PyPI

Structure of the Library

PyChemia

PyChemia

Contributors

  1. Prof. Aldo H. Romero [West Virginia University] (Project Director)

  2. Guillermo Avendaño-Franco [West Virginia University] (Basic Infrastructure)

  3. Adam Payne [West Virginia University] (Bug fixes (Populations, Relaxators, and KPoints) )

  4. Irais Valencia Jaime [West Virginia University] (Simulation and testing)

  5. Sobhit Singh [West Virginia University] (Data-mining)

  6. Francisco Muñoz [Universidad de Chile] (PyPROCAR)

  7. Wilfredo Ibarra Hernandez [West Virginia University] (Interface with MAISE)

Comments
  • conda-forge package

    conda-forge package

    Hi,

    I recently create the pychemia conda forge package, now it is possible to install PyChemia via:

    conda install -c conda-forge pychemia
    

    I was wondering if one of the core developers is interested in joining me in maintaining the package.

    Best,

    Jan

    opened by jan-janssen 2
  • Installaltion problem

    Installaltion problem

    Dear Developers,

    I am trying to install pychemia by

    pip3 install pychemia --user

    But it fails with following errors. Any help is appreciated.

    ERROR: Complete output from command python setup.py egg_info: ERROR: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-rd5hvw21/pychemia/setup.py", line 141, in data = write_version_py() File "/tmp/pip-install-rd5hvw21/pychemia/setup.py", line 89, in write_version_py release_data, FULLVERSION, GIT_REVISION = get_version_info() File "/tmp/pip-install-rd5hvw21/pychemia/setup.py", line 47, in get_version_info rf = open('setup.json') FileNotFoundError: [Errno 2] No such file or directory: 'setup.json' Using Cython: True ---------------------------------------- ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-rd5hvw21/pychemia/

    Thanks,

    Best \Alex

    opened by akentphonon 1
  • Removed pyximport from lennardjones since it only works if cython is installed.

    Removed pyximport from lennardjones since it only works if cython is installed.

    Dear Guillermo,

    Since setup.py already compiles the shared library required for lennardjones utilities for both cython and non-cython, this is unnecessary. It would be useful in the case that the shared library is not compiled and the import from the .pyx file needed to be imported directly without any compilation whatsoever.

    With the current setup.py, keeping the .pyx and .c in the distribution package will make sure it will work when both cython is present and not present.

    Best, Uthpala

    opened by uthpalaherath 0
  • Fixed lennardjones error that arises when installing with pip

    Fixed lennardjones error that arises when installing with pip

    Hello Guillermo,

    I added the lines: import pyximport pyximport.install()

    to init.py and lj.py in pychemia/code/lennardjones to fix an import error that occurs when installing PyChemia with pip.

    Best, Uthpala

    opened by uthpalaherath 0
  • Created VaspXML object as a CodeOutput object, fixed a bug in reading…

    Created VaspXML object as a CodeOutput object, fixed a bug in reading…

    … outcar, added writing to text and returning dict to DensityOfStates object

    1. Created VaspXML object as a CodeOutput object. a lot of features was added such as total,projcted and parametric density of states.
    2. fixed a bug in reading outcar energies
    3. added writing to text and returning dict to DensityOfStates object
    opened by petavazohi 0
  • Conserve repeating order of atoms in POSCAR -update

    Conserve repeating order of atoms in POSCAR -update

    This update allows the repeating order in atoms in POSCAR to be conserved.

    For example:

    Sr V O 1.0 3.8465199999999999 0.0000000000000000 0.0000000000000000 0.0000000000000000 3.8465199999999999 0.0000000000000000 0.0000000000000000 0.0000000000000000 3.8465199999999999 Sr V Sr O 1 1 1 3 Direct 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.0000000000000000 0.5000000000000000 0.0000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.0000000000000000 0.0000000000000000 0.5000000000000000 0.5000000000000000

    Here the order Sr, V, Sr, O will be conserved when using the structure to generate POTCARs and POSCARs for kgrid, encut convergence and relaxation with PyChemia. Otherwise, it reverts to Sr, V, O ignoring the order of the repetition.

    This is helpful for performing calculations for heterostructures where atoms in layers are ordered separately. The order of the POTCAR concatenation will follow this too.

    -Uthpala

    opened by uthpalaherath 0
  • Conserve repeating order of atoms in POSCAR

    Conserve repeating order of atoms in POSCAR

    This update allows the repeating order in atoms in POSCAR to be conserved.

    For example:

    Sr V O 1.0 3.8465199999999999 0.0000000000000000 0.0000000000000000 0.0000000000000000 3.8465199999999999 0.0000000000000000 0.0000000000000000 0.0000000000000000 3.8465199999999999 Sr V Sr O 1 1 1 3 Direct 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.0000000000000000 0.5000000000000000 0.0000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.0000000000000000 0.0000000000000000 0.5000000000000000 0.5000000000000000

    Here the order Sr, V, Sr, O will be conserved when using the structure to generate POTCARs and POSCARs for kgrid, encut convergence and relaxation with PyChemia. Otherwise, it reverts to Sr, V, O ignoring the order of the repetition.

    This is helpful for performing calculations for heterostructures where atoms in layers are ordered separately. The order of the POTCAR concatenation will follow this too.

    -Uthpala

    opened by uthpalaherath 0
  • free energy atom are changed to free energy per atom for convergence

    free energy atom are changed to free energy per atom for convergence

    changed the free energy in the convergence to free energy per atom. Also fixed the bug with kpoint converges best kpoint grid. previously it was taking the last calculated kgrid as the best kgrid.

    chaged La and Ac group to 'd' in pychemia/utils/periodic as they don't have f electrons. I hope I'm write

    opened by petavazohi 0
  • tutorial/example for

    tutorial/example for "predict next experiment"

    Be it composition- or structure-based, could you point to a place in the docs or provide an example that follows the general idea of:

    from pychemia import Discover()
    mdl = Discover()
    mdl.fit(X_train)
    next_experiment = mdl.suggest_next_experiment()
    

    I'm hoping to be able to compare PyChemia with mat_discover.

    opened by sgbaird 2
  • updated relax.py to keep EDIFF provided by user and only use 1E-04 if not provided

    updated relax.py to keep EDIFF provided by user and only use 1E-04 if not provided

    Hello Guillermo,

    In some of my structural relaxation I wanted to keep a lower EDIFF value so I added this in relax.py to use the EDIFF provided by the user in the INCAR. If not provided it will use the default value of EDIFF=1E-04.

    I simply changed:

         # How to change EDIFF
            if vj.input_variables["EDIFF"] > -0.01 * vj.input_variables["EDIFFG"]:
                vj.input_variables["EDIFF"] = round_small(
                    -0.01 * vj.input_variables["EDIFFG"]
                )
            else:
                    vj.input_variables["EDIFF"] = 1e-4
    

    to

            # How to change EDIFF
            if vj.input_variables["EDIFF"] > -0.01 * vj.input_variables["EDIFFG"]:
                vj.input_variables["EDIFF"] = round_small(
                    -0.01 * vj.input_variables["EDIFFG"]
                )
            else:
                if self.extra_vars["EDIFF"]:
                    vj.input_variables["EDIFF"] = self.extra_vars["EDIFF"]
                else:
                    vj.input_variables["EDIFF"] = 1e-4
    

    If you think it's something that is useful please merge it and add it to pip.

    Thank you,

    Best, Uthpala

    opened by uthpalaherath 7
  • new branch

    new branch

    Hi, I am haidi. I feel the code framework of pychemia is the best one among all CSP software i know. But more thing need to be done to make it user friendly and high effiency. I have add some code into it , would you please open a devel branch for developing ?

    opened by haidi-ustc 2
Owner
Materials Discovery Group
Materials Discovery
Materials Discovery Group
Extract data from a wide range of Internet sources into a pandas DataFrame.

pandas-datareader Up to date remote data access for pandas, works for multiple versions of pandas. Installation Install using pip pip install pandas-d

Python for Data 2.5k Jan 09, 2023
follow-analyzer helps GitHub users analyze their following and followers relationship

follow-analyzer follow-analyzer helps GitHub users analyze their following and followers relationship by providing a report in html format which conta

Yin-Chiuan Chen 2 May 02, 2022
This python script allows you to manipulate the audience data from Sl.ido surveys

Slido-Automated-VoteBot This python script allows you to manipulate the audience data from Sl.ido surveys Since Slido blocks interference from automat

Pranav Menon 1 Jan 24, 2022
BAyesian Model-Building Interface (Bambi) in Python.

Bambi BAyesian Model-Building Interface in Python Overview Bambi is a high-level Bayesian model-building interface written in Python. It's built on to

861 Dec 29, 2022
Tokyo 2020 Paralympics, Analytics

Tokyo 2020 Paralympics, Analytics Thanks for checking out my app! It was built entirely using matplotlib and Tokyo 2020 Paralympics data. This applica

Petro Ivaniuk 1 Nov 18, 2021
Deep universal probabilistic programming with Python and PyTorch

Getting Started | Documentation | Community | Contributing Pyro is a flexible, scalable deep probabilistic programming library built on PyTorch. Notab

7.7k Dec 30, 2022
Data processing with Pandas.

Processing-data-with-python This is a simple example showing how to use Pandas to create a dataframe and the processing data with python. The jupyter

1 Jan 23, 2022
MidTerm Project for the Data Analysis FT Bootcamp, Adam Tycner and Florent ZAHOUI

MidTerm Project for the Data Analysis FT Bootcamp, Adam Tycner and Florent ZAHOUI Hallo

Florent Zahoui 1 Feb 07, 2022
Programmatically access the physical and chemical properties of elements in modern periodic table.

API to fetch elements of the periodic table in JSON format. Uses Pandas for dumping .csv data to .json and Flask for API Integration. Deployed on "pyt

the techno hack 3 Oct 23, 2022
Top 50 best selling books on amazon

It's a dashboard that shows the detailed information about each book in the top 50 best selling books on amazon over the last ten years

Nahla Tarek 1 Nov 18, 2021
ELFXtract is an automated analysis tool used for enumerating ELF binaries

ELFXtract ELFXtract is an automated analysis tool used for enumerating ELF binaries Powered by Radare2 and r2ghidra This is specially developed for PW

Monish Kumar 49 Nov 28, 2022
small package with utility functions for analyzing (fly) calcium imaging data

fly2p Tools for analyzing two-photon (2p) imaging data collected with Vidrio Scanimage software and micromanger. Loading scanimage data relies on scan

Hannah Haberkern 3 Dec 14, 2022
PyStan, a Python interface to Stan, a platform for statistical modeling. Documentation: https://pystan.readthedocs.io

PyStan PyStan is a Python interface to Stan, a package for Bayesian inference. Stan® is a state-of-the-art platform for statistical modeling and high-

Stan 229 Dec 29, 2022
Autopsy Module to analyze Registry Hives based on bookmarks provided by EricZimmerman for his tool RegistryExplorer

Autopsy Module to analyze Registry Hives based on bookmarks provided by EricZimmerman for his tool RegistryExplorer

Mohammed Hassan 13 Mar 31, 2022
Building house price data pipelines with Apache Beam and Spark on GCP

This project contains the process from building a web crawler to extract the raw data of house price to create ETL pipelines using Google Could Platform services.

1 Nov 22, 2021
Supply a wrapper ``StockDataFrame`` based on the ``pandas.DataFrame`` with inline stock statistics/indicators support.

Stock Statistics/Indicators Calculation Helper VERSION: 0.3.2 Introduction Supply a wrapper StockDataFrame based on the pandas.DataFrame with inline s

Cedric Zhuang 1.1k Dec 28, 2022
Aggregating gridded data (xarray) to polygons

A package to aggregate gridded data in xarray to polygons in geopandas using area-weighting from the relative area overlaps between pixels and polygons. Check out the binder link above for a sample c

Kevin Schwarzwald 42 Nov 09, 2022
Sentiment analysis on streaming twitter data using Spark Structured Streaming & Python

Sentiment analysis on streaming twitter data using Spark Structured Streaming & Python This project is a good starting point for those who have little

Himanshu Kumar singh 2 Dec 04, 2021
Python beta calculator that retrieves stock and market data and provides linear regressions.

Stock and Index Beta Calculator Python script that calculates the beta (β) of a stock against the chosen index. The script retrieves the data and resa

sammuhrai 4 Jul 29, 2022
This repo contains a simple but effective tool made using python which can be used for quality control in statistical approach.

This repo contains a powerful tool made using python which is used to visualize, analyse and finally assess the quality of the product depending upon the given observations

SasiVatsal 8 Oct 18, 2022