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
PyChemia, Python Framework for Materials Discovery and Design

PyChemia, Python Framework for Materials Discovery and Design PyChemia is an open-source Python Library for materials structural search. The purpose o

Materials Discovery Group 61 Oct 02, 2022
Data Science Environment Setup in single line

datascienv is package that helps your to setup your environment in single line of code with all dependency and it is also include pyforest that provide single line of import all required ml libraries

Ashish Patel 55 Dec 16, 2022
An orchestration platform for the development, production, and observation of data assets.

Dagster An orchestration platform for the development, production, and observation of data assets. Dagster lets you define jobs in terms of the data f

Dagster 6.2k Jan 08, 2023
CS50 pset9: Using flask API to create a web application to exchange stocks' shares.

C$50 Finance In this guide we want to implement a website via which users can “register”, “login” “buy” and “sell” stocks, like below: Background If y

1 Jan 24, 2022
Advanced Pandas Vault — Utilities, Functions and Snippets (by @firmai).

PandasVault ⁠— Advanced Pandas Functions and Code Snippets The only Pandas utility package you would ever need. It has no exotic external dependencies

Derek Snow 374 Jan 07, 2023
Airflow ETL With EKS EFS Sagemaker

Airflow ETL With EKS EFS & Sagemaker (en desarrollo) Diagrama de la solución Imp

1 Feb 14, 2022
Data science/Analysis Health Care Portfolio

Health-Care-DS-Projects Data Science/Analysis Health Care Portfolio Consists Of 3 Projects: Mexico Covid-19 project, analyze the patient medical histo

Mohamed Abd El-Mohsen 1 Feb 13, 2022
This creates a ohlc timeseries from downloaded CSV files from NSE India website and makes a SQLite database for your research.

NSE-timeseries-form-CSV-file-creator-and-SQL-appender- This creates a ohlc timeseries from downloaded CSV files from National Stock Exchange India (NS

PILLAI, Amal 1 Oct 02, 2022
pyETT: Python library for Eleven VR Table Tennis data

pyETT: Python library for Eleven VR Table Tennis data Documentation Documentation for pyETT is located at https://pyett.readthedocs.io/. Installation

Tharsis Souza 5 Nov 19, 2022
High Dimensional Portfolio Selection with Cardinality Constraints

High-Dimensional Portfolio Selecton with Cardinality Constraints This repo contains code for perform proximal gradient descent to solve sample average

Du Jinhong 2 Mar 22, 2022
Projects that implement various aspects of Data Engineering.

DATAWAREHOUSE ON AWS The purpose of this project is to build a datawarehouse to accomodate data of active user activity for music streaming applicatio

2 Oct 14, 2021
Retentioneering 581 Jan 07, 2023
My solution to the book A Collection of Data Science Take-Home Challenges

DS-Take-Home Solution to the book "A Collection of Data Science Take-Home Challenges". Note: Please don't contact me for the dataset. This repository

Jifu Zhao 1.5k Jan 03, 2023
Churn prediction with PySpark

It is expected to develop a machine learning model that can predict customers who will leave the company.

3 Aug 13, 2021
The repo for mlbtradetrees.com. Analyze any trade in baseball history!

The repo for mlbtradetrees.com. Analyze any trade in baseball history!

7 Nov 20, 2022
Codes for the collection and predictive processing of bitcoin from the API of coinmarketcap

Codes for the collection and predictive processing of bitcoin from the API of coinmarketcap

Teo Calvo 5 Apr 26, 2022
A Python Tools to imaging the shallow seismic structure

ShallowSeismicImaging Tools to imaging the shallow seismic structure, above 10 km, based on the ZH ratio measured from the ambient seismic noise, and

Xiao Xiao 9 Aug 09, 2022
Automatic earthquake catalog building workflow: EQTransformer + Siamese EQTransformer + PickNet + REAL + HypoInverse

Automatic regional-scale earthquake catalog building workflow: EQTransformer + Siamese EQTransforme

Xiao Zhuowei 9 Nov 27, 2022
Calculate multilateral price indices in Python (with Pandas and PySpark).

IndexNumCalc Calculate multilateral price indices using the GEKS-T (CCDI), Time Product Dummy (TPD), Time Dummy Hedonic (TDH), Geary-Khamis (GK) metho

Dr. Usman Kayani 3 Apr 27, 2022
Pyspark project that able to do joins on the spark data frames.

SPARK JOINS This project is to perform inner, all outer joins and semi joins. create_df.py: load_data.py : helps to put data into Spark data frames. d

Joshua 1 Dec 14, 2021