Skip to content

Commit

Permalink
Merge pull request #30 from SMTG-UCL/develop
Browse files Browse the repository at this point in the history
Develop

Former-commit-id: 99311c5
  • Loading branch information
kavanase authored Aug 25, 2023
2 parents 7238847 + 1f91e07 commit 42f94ae
Show file tree
Hide file tree
Showing 44 changed files with 1,118 additions and 597 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
groups:
python-packages:
patterns:
- "*"
open-pull-requests-limit: 2
allow:
- dependency-type: direct
- dependency-type: indirect
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
- name: Test
run: |
pytest --ignore local_doped_testing -vv # test everything
pytest tests -vv # test everything
2 changes: 1 addition & 1 deletion .github/workflows/pip_install_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
- name: Test
run: |
pytest --ignore local_doped_testing -vv # test everything
pytest tests -vv # test everything
16 changes: 7 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Release and publish

on:
push:
branches:
- master
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:

workflow_run:
workflows: [ "Build and test package" ]
branches: [ master ]
types:
- completed # only release when tests have passed

jobs:
release:
Expand All @@ -26,10 +28,6 @@ jobs:
pip install -e .
pip install -e .[tests]
# - name: Test # To be added later
# run: |
# pytest --ignore local_doped_testing # test everything

- name: Build packages
run: |
python3 -m pip install --upgrade build
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exclude: ^(docs|examples|.github|doped/pycdt/test_files|tests/data)
exclude: ^(docs|examples|.github|tests/data)
repos:
# Lint and format, isort, docstrings...
- repo: https://github.com/charliermarsh/ruff-pre-commit
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Change Log
==========

v.2.0.1
----------
- Update naming handling in ``DefectPhaseDiagram`` to be more robust/flexible, following failure case
noted by @utf 🙌
- Ensure package data files are correctly included in the package distribution, again noted by @utf 🙌
- Updates to chemical potentials code.
- Refactoring of site-matching code.
- Tests updates and code cleanup.

v.2.0.0
----------
- Major overhaul to rebase onto the new `pymatgen` defects code (`>v2022.7.25`).
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/doped.svg)](https://anaconda.org/conda-forge/doped)
[![Downloads](https://img.shields.io/pypi/dm/doped)](https://pypi.org/project/doped)

<img align="right" width="275" src="docs/doped_v2_logo.png">`doped` is a python package for
<a href="https://doped.readthedocs.io/en/latest/"><img align="right" width="275" src="https://raw.githubusercontent.com/SMTG-UCL/doped/master/docs/doped_v2_logo.png"></a>`doped` is a python package for
managing solid-state defect calculations, with functionality to
generate defect structures and relevant competing phases (for chemical potentials), interface with
[`ShakeNBreak`](https://shakenbreak.readthedocs.io) for
Expand All @@ -16,7 +16,7 @@ Tutorials showing the code functionality and usage are provided on the [docs](ht
### Example Outputs:
Chemical potential/stability region plots and defect formation energy (a.k.a. transition level) diagrams:

<img align="left" src="docs/doped_chempot_plotting.png" width="365"> <img src="docs/doped_TLD_plot.png" width="385" align="right">
<a href="https://doped.readthedocs.io/en/latest/dope_chemical_potentials.html#analysing-and-visualising-the-chemical-potential-limits"><img align="left" width="365" src="https://raw.githubusercontent.com/SMTG-UCL/doped/master/docs/doped_chempot_plotting.png"></a> <a href="https://doped.readthedocs.io/en/latest/dope_parsing_example.html#defect-formation-energy-transition-level-diagrams"><img align="right" width="385" src="https://raw.githubusercontent.com/SMTG-UCL/doped/master/docs/doped_TLD_plot.png"></a>
<br><br><br><br><br><br><br><br><br><br><br>


Expand All @@ -40,10 +40,10 @@ See the docs [Installation](https://doped.readthedocs.io/en/latest/Installation.
As shown in the example notebook, it is highly recommended to use the [`ShakeNBreak`](https://shakenbreak.readthedocs.io/en/latest/) approach when calculating point defects in solids, to ensure you have identified the groundstate structures of your defects. As detailed in the [theory paper](https://arxiv.org/abs/2207.09862), skipping this step can result in drastically incorrect formation energies, transition levels, carrier capture (basically any property associated with defects). This approach is followed in the [doped example notebook](https://github.com/SMTG-UCL/doped/blob/master/dope_workflow_example.ipynb), with a more in-depth explanation and tutorial given on the [ShakeNBreak](https://shakenbreak.readthedocs.io/en/latest/) website.

Summary GIF:
![ShakeNBreak Summary](docs/SnB_Supercell_Schematic_PES_2sec_Compressed.gif)
![ShakeNBreak Summary](https://raw.githubusercontent.com/SMTG-UCL/ShakeNBreak/main/docs/SnB_Supercell_Schematic_PES_2sec_Compressed.gif)

`SnB` CLI Usage:
![ShakeNBreak CLI](docs/SnB_CLI.gif)
![ShakeNBreak CLI](https://raw.githubusercontent.com/SMTG-UCL/ShakeNBreak/main/docs/SnB_CLI.gif)


## Acknowledgments
Expand Down
13 changes: 5 additions & 8 deletions ToDo.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# `doped` WishList
## Defect calculations set up
- See SK Remarkable notes
- CLI Functionality for core functions.
- Could also use some of the `snb` functions to add some convenience commands which `cp CONTCAR
POSCAR` for unconverged `vasp_gam`/`vasp_nkred_std`/`vasp_std` calculations, and copies `CONTCAR`s
Expand Down Expand Up @@ -32,8 +33,6 @@
- Once happy all required functionality is in the new `chemical_potentials.py` code (need more rigorous tests, see original pycdt tests for this and make sure all works with new code), showcase all functionality in the example notebook, remove the old modified-pycdt `_chemical_potentials.py` code.

## Post-processing / analysis / plotting
- Will need to subclass `DefectEntry` to have it working as desired (when it comes to parsing, plotting
etc.). Need parameter attributes which aren't removed when saving to json.
- Automatically check the 'bulk' and 'defect' calculations used the same INCAR tags, KPOINTS and POTCAR
settings, and warn user if not. Should auto-check the magnetisation output; if it comes to around
zero for an odd-electron defect, suggests getting spurious shallow defect behaviour!
Expand Down Expand Up @@ -98,7 +97,6 @@
- Related: Add warning for bandfilling correction based off energy range of the CBM/VBM occupation? (In
addition to `num_hole` and `num_electron`)
- Currently the `PointDefectComparator` object from `pymatgen.analysis.defects.thermodynamics` is used to group defect charge states for the transition level plot / transition level map outputs. For interstitials, if the closest Voronoi site from the relaxed structure thus differs significantly between charge states, this will give separate lines for each charge state. This is kind of ok, because they _are_ actually different defect sites, but should have intelligent defaults for dealing with this (see `TODO` in `dpd_from_defect_dict` in `analysis.py`; at least similar colours for similar defect types, an option to just show amalgamated lowest energy charge states for each _defect type_). NaP is an example for this – should have a test built for however we want to handle cases like this. See Ke's example case too with different interstitial sites.
- PR to pymatgen: Update entry.calculation_metadata["kumagai_meta"] = (dict(self.metadata)) to entry.calculation_metadata["kumagai_meta"].update(dict(self.metadata)) in KumagaiCorrection.get_correction() in pymatgen/analysis/defects/corrections.py so pymatgen doesn't remove the other relevant kumagai_meta (kumagai_electrostatic etc.) when we run KumagaiCorrection.get_correction(defect_entry) (via finite_size_charge_correction.get_correction_kumagai(defect_entry...)) – see https://github.com/materialsproject/pymatgen-analysis-defects/issues/47 – code now gone, so can we add a workaround to `corrections.get_correction_kumagai()` for this?
- GitHub issue related to `DefectPhaseDiagram`: https://github.com/SMTG-UCL/doped/issues/3
- Note that if you edit the entries in a DefectPhaseDiagram after creating it, you need to `dpd.find_stable_charges()` to update the transition level map etc.
- Should tag parsed defects with `is_shallow` (or similar), and then omit these from plotting/analysis
Expand Down Expand Up @@ -144,7 +142,7 @@

## Housekeeping
- Clean `README` with bullet-point summary of key features, and sidebar like `SnB`.
- Update to be compatible with new `pymatgen`
- `ShakeNBreak` related updates:
- Update to use the `ShakeNBreak` voronoi node-finding functions, as this has been made to be more
efficient than the `doped` version (which is already far more efficient than the original...) and
isn't available in current `pymatgen`.
Expand All @@ -158,15 +156,14 @@
- Add type hints for all functions.
- Check code for each function is relatively lean & efficient, can check with ChatGPT for any gnarly
ones.
- Run `pre-commit run --all-files` to check all files.
- Generate docs.
- Need a `docs_requirements.txt` file like `SnB`.

- Docs:
- Create GGA practice workflow, for people to learn how to work with doped and defect calculations
- Add note about `NUPDOWN` for triplet states (bipolarons).
- Add our recommended workflow (gam, NKRED, std, ncl). Cite
- https://iopscience.iop.org/article/10.1088/1361-648X/acd3cf for validation of Voronoi tessellation
approach for interstitials, but note user can use charge-density based approach if needing to be
super-lean for some reason.
super-lean for some reason. Can use SMTG wiki stuff for this.
- Regarding competing phases with many low-energy polymorphs from the Materials Project; will build
in a warning when many entries for the same composition, say which have database IDs, warn the user
and direct to relevant section on the docs -> Give some general foolproof advice for how best to deal
Expand Down
4 changes: 2 additions & 2 deletions docs/Installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ for charged defects, your ``POTCAR`` directory needs to be setup to work with ``

Developer Installation
-----------------------
If you want to use the example files from the tutorials, you will need to clone the ``doped`` GitHub
repository:
If you want to use the example files from the tutorials or run the package tests, you will need to clone
the ``doped`` GitHub repository:

#. Download the ``doped`` source code using the command:

Expand Down
Binary file removed docs/SnB_CLI.gif
Binary file not shown.

This file was deleted.

Binary file added docs/Te_i_0_NEB_Relaxation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
author = 'Seán R. Kavanagh'

# The full version, including alpha/beta/rc tags
release = '2.0.0'
release = '2.0.1'


# -- General configuration ---------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ the

Summary GIF:

.. image:: SnB_Supercell_Schematic_PES_2sec_Compressed.gif
.. image:: https://raw.githubusercontent.com/SMTG-UCL/ShakeNBreak/main/docs/SnB_Supercell_Schematic_PES_2sec_Compressed.gif

``SnB`` CLI Usage:

.. image:: SnB_CLI.gif
.. image:: https://raw.githubusercontent.com/SMTG-UCL/ShakeNBreak/main/docs/SnB_CLI.gif

.. raw:: html

Expand Down
Loading

0 comments on commit 42f94ae

Please sign in to comment.