Skip to content

Commit

Permalink
Merge branch 'master' into development(calysta)
Browse files Browse the repository at this point in the history
  • Loading branch information
ireaml committed Sep 13, 2023
2 parents 0353ac0 + de943ed commit 6d4b62e
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 65 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ jobs:
matrix:
python-version: ["3.8","3.9","3.10","3.11"]
os: [ubuntu-latest,]

runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -44,21 +44,20 @@ jobs:
pip install pytest-cov
pip install pytest-mpl
pip install -e .
- name: Check package versions
run: |
pip show -V pytest
pip show -V ase
pip show -V matplotlib
- name: Run tests
run: pytest --cov=macrodensity --mpl tests/unit_tests.py --cov-report=xml -v

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
files: ./coverage.xml

56 changes: 56 additions & 0 deletions .github/workflows/release_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release and publish

on:
workflow_run:
workflows: [ "MacroDensity CI" ]
branches: [ main ]
types:
- completed # only release when tests have passed

workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') }}
# only run when tests have passed (or manually triggered)

steps:
- uses: actions/checkout@v1

- uses: actions/setup-python@v1
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools setuptools_scm wheel
pip install -e .[tests]
- name: Build packages
run: |
python setup.py sdist bdist_wheel
- name: Publish
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TWINE_PASSWORD }}

- name: Generate release info
run: |
awk 'BEGIN {p = 0} {a = 0 }; /^v\d*.\d*.\d*./ { p += 1; a = 1}; p + a == 1 { print } ' CHANGELOG.rst | sed -e '1,1d' | sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' > release_info.txt
echo "version=$(grep version setup.py | awk -F\" '{print $2}')" >> $GITHUB_ENV
- name: Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
tag_name: v${{ env.version }}
release_name: ${{ env.version }}
body_path: release_info.txt
draft: false
prerelease: false
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

39 changes: 18 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
MacroDensity
====================
![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.884521.svg)
# Welcome to MacroDensity

A set of Python scripts to read in a electrostatic potentials and electron densities from electronic structure calculations and plot in a number of ways, including:
``MacroDensity`` is a Python package to post-process electrostatic potential and
electron density files from electronic structure calculations and plot in a number of ways, including:

* Planar average
* Spherical average
* Atom centred average
1. Planar average
2. Spherical average
3. Atom centred average

# Statement of Need

To assess the potential utility of novel semiconducting devices (like p-n junctions, heterostructures, surface terminations), it is key to understand how the electrostatic potential and electron density change across the system. However, extraction and useful presentation of this data from the raw output of the simulation can prove cumbersome and often requires the use of visualisation software followed by manual data extraction. This can result in bottlenecks in high throughput screening projects, where the same data extraction procedure is repeatedly applied to large databases of candidate structures.
To assess the potential utility of novel semiconducting devices (like p-n junctions, heterostructures, surface terminations),
it is key to understand how the electrostatic potential and electron density change across the system.
However, extraction and useful presentation of this data from the raw output of the simulation can prove cumbersome and often requires the use of visualisation software followed by manual data extraction.
This can result in bottlenecks in high throughput screening projects, where the same data extraction procedure is repeatedly applied to large databases of candidate structures.

To address this, the Macrodensity package has been developed to post-process the output of ab-initio codes like `VASP`, `FHI-AIMS` and `GULP`. The package contains functions that enable the user to format the data from the `VASP LOCPOT` and `CHGCAR` files, the `FHI-AIMS *.cube` file, and `GULP *.out` file into physically meaningful quantities, which can then be plotted for user interpretation.
To address this, the Macrodensity package has been developed to post-process the output of ab-initio codes like ``VASP``, ``FHI-AIMS`` and ``GULP``.
The package contains functions that enable the user to format the data from the ``VASP`` ``LOCPOT`` and ``CHGCAR`` files, the ``FHI-AIMS`` ``*.cube`` file,
and ``GULP`` ``*.out`` file into physically meaningful quantities, which can then be plotted for user interpretation.

# Requirements

* [Python](https://www.python.org)
* [Matplotlib](http://matplotlib.org) (to plot results on the fly)
* [ASE](https://wiki.fysik.dtu.dk/ase/) (for atom centred functionality)
* [Pandas](https://pandas.pydata.org/) (optional - for quicker reading speeds; requires pandas 1.2.0 or newer)
* [Jupyter](https://jupyter.org/) (optional - for `.ipynb` notebooks in the [tutorials](https://github.com/WMD-group/MacroDensity/tree/V3.1.0/tutorials))

# Installation

Expand All @@ -33,6 +30,7 @@ pip install macrodensity
```

## Developer installation

For development of MacroDensity, you can install a copy of the package from the source directory:

```
Expand All @@ -42,17 +40,17 @@ pip install -e .
```


Literature
========================
# Literature

For more information on the theory behind the package, please see the following references:

- General Approach: Butler, K. T., Hendon, C. H., & Walsh, A. [Electronic chemical potentials of porous Metal–Organic frameworks](https://doi.org/10.1021/ja4110073). *Journal of the American Chemical Society*, 136(7), 2703–2706, 2014
- Theoretical Background:
- Theoretical Background:
* Politzer, P., & Murray, J. S. [The fundamental nature and role of the electrostatic potential in atoms and molecules](https://link.springer.com/article/10.1007/s00214-002-0363-9). *Theoretical Chemistry Accounts*, 108(3), 134–142, 2002
* Peressi, M., Binggeli, N. & Baldereschi, A. [Band engineering at interfaces: theory and numerical experiments](https://iopscience.iop.org/article/10.1088/0022-3727/31/11/002/meta). *Journal of Physics D: Applied Physics*,31(11), 1273, 1998
- Application to MOFs:
* Butler, K. T., Hendon, C. H. & Aron Walsh, A. [Electronic Chemical Potentials of Porous Metal–Organic Frameworks](https://doi.org/10.1021/ja4110073). *Journal of the American Chemical Society*, 136(7), 2703–2706, 2014



# Contributing
Expand Down Expand Up @@ -81,4 +79,3 @@ MacroDensity is made available under the MIT License.
If you use it in your research, please cite:

* Method: Harnett-Caulfield, L., & Walsh, A. [*Journal of Chemical Physics*](https://doi.org/10.1063/5.0044866) 2021

37 changes: 0 additions & 37 deletions TODO.md

This file was deleted.

0 comments on commit 6d4b62e

Please sign in to comment.