Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsquires committed Jul 30, 2024
2 parents 81144a9 + 8d7723a commit 761dab5
Show file tree
Hide file tree
Showing 704 changed files with 4,647 additions and 3,106 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/pip_install_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,17 @@ jobs:
sleep 360 # wait 10 minutes for PyPI to update with the new release
python -m pip install --upgrade pip
pip install doped[tests] # install only from PyPI
- name: Install spglib on macOS
if: matrix.os == 'macos-14'
run: |
pip install git+https://github.com/spglib/spglib --config-settings=cmake.define.SPGLIB_SHARED_LIBS=OFF # avoid spglib warnings
- name: Install spglib on ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
conda install -c conda-forge spglib # avoid spglib warnings
- name: Test
run: |
pytest -vv -m "not mpl_image_compare" tests # all non-plotting tests
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,17 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
- name: Install spglib on macOS
if: matrix.os == 'macos-14'
run: |
pip install git+https://github.com/spglib/spglib --config-settings=cmake.define.SPGLIB_SHARED_LIBS=OFF # avoid spglib warnings
- name: Install spglib on ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
conda install -c conda-forge spglib # avoid spglib warnings
- name: Test
run: |
pytest -vv -m "not mpl_image_compare" tests # all non-plotting tests
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
Change Log
==========

v.2.4.7
----------
- Update doping/carrier concentration functions to be more accurate and robust (following logic discussed
here: https://github.com/materialsproject/pymatgen/pull/3879).
- Improve reverse-supercell-matrix determination for `generate_supercell=False`
- Refactor `bulk_band_gap_path` to `bulk_band_gap_vr` in `DefectsParser`/`DefectParser`,
- Update docstrings to reiterate that bulk supercell VBM is used as VBM reference point for the Fermi level
by default, unless alternative `bulk_band_gap_vr` provided.

v.2.4.6
----------
- Update ``Defect``, ``DefectEntry`` and ``DefectThermodynamics`` properties/methods to be even more
efficient with calculations of formation energies and concentrations. Gives ~10x speedup in Fermi
solving and concentration calculations (e.g. from 2 hours to 12 minutes for 2D chempot vs temp CdTe grid
in thermodynamics tutorial).
- Avoid unnecessary ``DeprecationWarning``s from latest ``spglib`` release.

v.2.4.5
----------
- Enforce ``shakenbreak>=2.3.4`` requirement.

v.2.4.4
----------
- Make oxidation state guessing more efficient, semi-significant speed up in generation/parsing for tough cases.
- Add `bulk_site_concentration` property to `DefectEntry`, giving the concentration of the corresponding lattice site of that defect in the pristine bulk.
- Minor updates to ensure compatibility with recent ``pymatgen`` and ``ASE`` releases.

v.2.4.3
----------
- Remove ``spglib<=2.0.2`` dependency (set to avoid unnecessary warnings), and update installation instructions accordingly.
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,20 @@ As shown in the `doped` tutorials, it is highly recommended to use the [`ShakeNB

## Studies using `doped`, so far

<!--
Not currently cited but should be for chempot plot:
- Quadir et al. **_Low-Temperature Synthesis of Stable CaZn<sub>2</sub>P<sub>2</sub> Zintl Phosphide Thin Films as Candidate Top Absorbers_** [_arXiv_](https://arxiv.org/abs/2406.15637) 2024
-->
- Z. Yuan & G. Hautier **_First-principles study of defects and doping limits in CaO_** [_Applied Physics Letters_](https://doi.org/10.1063/5.0211707) 2024
- B. E. Murdock et al. **_Li-Site Defects Induce Formation of Li-Rich Impurity Phases: Implications for Charge Distribution and Performance of LiNi<sub>0.5-x</sub>M<sub>x</sub>Mn<sub>1.5</sub>O<sub>4</sub> Cathodes (M = Fe and Mg; x = 0.05–0.2)_** [_Advanced Materials_](https://doi.org/10.1002/adma.202400343) 2024
- A. G. Squires et al. **_Oxygen dimerization as a defect-driven process in bulk LiNiO2<sub>2</sub>_** [_ChemRxiv_](https://doi.org/10.26434/chemrxiv-2024-lcmkj) 2024
- X. Wang et al. **_Upper efficiency limit of Sb<sub>2</sub>Se<sub>3</sub> solar cells_** [_arXiv_](https://arxiv.org/abs/2402.04434) 2024
- I. Mosquera-Lois et al. **_Machine-learning structural reconstructions for accelerated point defect calculations_** [_arXiv_](https://doi.org/10.48550/arXiv.2401.12127) 2024
- W. Dou et al. **_Giant Band Degeneracy via Orbital Engineering Enhances Thermoelectric Performance from Sb<sub>2</sub>Si<sub>2</sub>Te<sub>6</sub> to Sc<sub>2</sub>Si<sub>2</sub>Te<sub>6</sub>_** [_ChemRxiv_](https://doi.org/10.26434/chemrxiv-2024-hm6vh) 2024
- Y. Fu & H. Lohan et al. **_Factors Enabling Delocalized Charge-Carriers in Pnictogen-Based
Solar Absorbers: In-depth Investigation into CuSbSe<sub>2</sub>_** [_arXiv_](https://doi.org/10.48550/arXiv.2401.02257) 2024
- S. Hachmioune et al. **_Exploring the Thermoelectric Potential of MgB4: Electronic Band Structure, Transport Properties, and Defect Chemistry_** [_Chemistry of Materials_](https://doi.org/10.1021/acs.chemmater.4c00584) 2024
- J. Hu et al. **_Enabling ionic transport in Li3AlP2 the roles of defects and disorder_** [_ChemRxiv_](https://doi.org/10.26434/chemrxiv-2024-3s0kh) 2024
- X. Wang et al. **_Upper efficiency limit of Sb<sub>2</sub>Se<sub>3</sub> solar cells_** [_Joule_](https://doi.org/10.1016/j.joule.2024.05.004) 2024
- I. Mosquera-Lois et al. **_Machine-learning structural reconstructions for accelerated point defect calculations_** [_npj Computational Materials_](https://doi.org/10.1038/s41524-024-01303-9) 2024
- W. Dou et al. **_Band Degeneracy and Anisotropy Enhances Thermoelectric Performance from Sb<sub>2</sub>Si<sub>2</sub>Te<sub>6</sub> to Sc<sub>2</sub>Si<sub>2</sub>Te<sub>6</sub>_** [_Journal of the American Chemical Society_](https://doi.org/10.1021/jacs.4c01838) 2024
- K. Li et al. **_Computational Prediction of an Antimony-based n-type Transparent Conducting Oxide: F-doped Sb<sub>2</sub>O<sub>5</sub>_** [_Chemistry of Materials_](https://doi.org/10.1021/acs.chemmater.3c03257) 2023
- X. Wang et al. **_Four-electron negative-U vacancy defects in antimony selenide_** [_Physical Review B_](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.108.134102) 2023
- Y. Kumagai et al. **_Alkali Mono-Pnictides: A New Class of Photovoltaic Materials by Element Mutation_** [_PRX Energy_](http://dx.doi.org/10.1103/PRXEnergy.2.043002) 2023
Expand Down
4 changes: 1 addition & 3 deletions docs/Dev_ToDo.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
## Chemical potential
- Check through chemical potential TO-DOs. Need to recheck validity of approximations used for extrinsic competing phases (and code for this). Proper `vasp_std` setup (with `NKRED` folders like for defect calcs) and `vasp_ncl` generation.
- Efficient generation of competing phases for which there are many polymorphs? See SK notes from CdTe competing phases.
- Update chemical potential tools to work with new Materials Project API. Currently, supplying an API key for the new Materials Project API returns entries which do not have `e_above_hull` as a property, and so crashes. Ideally would be good to be compatible with both the legacy and new API, which should be fairly straightforward (try importing MPRester from mp_api client except ImportError import from pmg then will need to make a whole separate query/search because `band_gap` and `total_magnetisation` no longer accessible from `get_entries`). See https://docs.materialsproject.org/downloading-data/using-the-api
- Publication ready chemical potential diagram plotting tool as in Adam Jackson's `plot-cplap-ternary` (3D) and Sungyhun's `cplapy` (4D) (see `doped_chempot_plotting_example.ipynb`; code there, just needs to be implemented in module functions). `ChemicalPotentialGrid` in `py-sc-fermi` interface could be quite useful for this? (Worth moving that part of code out of `interface` subpackage?) Also can see https://github.com/materialsproject/pymatgen-analysis-defects/blob/main/pymatgen/analysis/defects/plotting/phases.py for 2D chempot plotting.
- Also see `Cs2SnTiI6` notebooks for template code for this.
- Note in tutorial that LaTeX table generator website can also be used with the `to_csv()` function to generate LaTeX tables for the competing phases.

## Post-processing / analysis / plotting
- Better automatic defect formation energy plot colour handling (auto-change colormap based on number of defects, set similar colours for similar defects (types and inequivalent sites)) – and more customisable?
Expand Down Expand Up @@ -87,8 +85,8 @@
there's any useful functionality we want to add!

## SK To-Do for next update:
- Remove `typing-extensions` requirement from `pyproject.toml`, once new `pymatgen-analysis-defects` released.
- `doped` repo/docs cleanup `TODO`s above
- Note in chempots tutorial that LaTeX table generator website can also be used with the `to_csv()` function to generate LaTeX tables for the competing phases.
- Quick-start tutorial suggested by Alex G
- Add chempot grid plotting tool, shown in `JOSS_plots` using Alex's chemical potential grid, and test (and remove TODO from JOSS plots notebook).
- `dist_tol` should also group defects for the concentration etc functions, currently doesn't (e.g. `CdTe_thermo.get_equilibrium_concentrations(limit="Te-rich", per_charge=False, fermi_level=0.5)` and `CdTe_thermo.dist_tol=10; CdTe_thermo.get_equilibrium_concentrations(limit="Te-rich", per_charge=False, fermi_level=0.5)`, same output)
Expand Down
3 changes: 3 additions & 0 deletions docs/Installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ by running the following in Python, and confirming that the same version numbers
print(spglib.__version__)
print(spglib.spg_get_version_full())
In some cases, you might need to first uninstall ``spglib`` with both ``conda uninstall spglib`` and
``pip uninstall spglib`` (to ensure no duplicate installations), before reinstalling.

Alternatively if desired, ``doped`` can also be installed from ``conda`` with:

.. code-block:: bash
Expand Down
8 changes: 4 additions & 4 deletions docs/Tips.rst
Original file line number Diff line number Diff line change
Expand Up @@ -465,21 +465,21 @@ various stages in the tutorials, this can be achieved using the ``dumpfn``/``loa
.. code-block:: python
# save a DefectThermodynamics object to a JSON file
defect_thermo.to_json("MgO_DefectThermodynamics.json")
defect_thermo.to_json("MgO_DefectThermodynamics.json.gz")
# then later in a different python session or notebook, we can reload the
# DefectThermodynamics object from the JSON file, containing all the associated info
from doped.thermodynamics import DefectThermodynamics
defect_thermodynamics = DefectThermodynamics.from_json("MgO_DefectThermodynamics.json")
defect_thermodynamics = DefectThermodynamics.from_json("MgO_DefectThermodynamics.json.gz")
# alternatively, we can directly use the monty dumpfn/loadfn functions
# directly on any doped object, e.g. with our ``DefectsSet`` object
# containing all the info on the generated VASP input files:
from monty.serialization import dumpfn, loadfn
dumpfn(obj=defects_set, fn="MgO_DefectsSet.json")
dumpfn(obj=defects_set, fn="MgO_DefectsSet.json.gz")
# and again later reload the object from the JSON file
defects_set = loadfn("MgO_DefectsSet.json")
defects_set = loadfn("MgO_DefectsSet.json.gz")
.. note::

Expand Down
4 changes: 2 additions & 2 deletions docs/Troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ message about the origin of the problem, it is likely to be an issue with your v

.. code:: bash
pip install pymatgen pymatgen-analysis-defects --upgrade
pip install pymatgen pymatgen-analysis-defects monty --upgrade
pip install doped --upgrade
If this does not solve your issue, please check the specific cases noted below. If your issue still isn't
Expand Down Expand Up @@ -139,4 +139,4 @@ If you do not use the ``if __name__ == '__main__':...`` syntax, you may encounte

.. NOTE::
If you run into any issues using ``doped`` that aren't addressed above, please contact the developers
through the ``GitHub`` `Issues <https://github.com/SMTG-Bham/doped/issues>`_ page, or by email.
through the ``GitHub`` `Issues <https://github.com/SMTG-Bham/doped/issues>`_ page.
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.4.3'
release = '2.4.7'


# -- General configuration ---------------------------------------------------
Expand Down
13 changes: 10 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,18 @@ the
Studies using ``doped``, so far
===============================

.. Not currently cited but should be for chempot plot:
Quadir et al. **_Low-Temperature Synthesis of Stable CaZn<sub>2</sub>P<sub>2</sub> Zintl Phosphide Thin Films as Candidate Top Absorbers_** [_arXiv_](https://arxiv.org/abs/2406.15637) 2024
- Z\. Yuan & G. Hautier **First-principles study of defects and doping limits in CaO** `Applied Physics Letters <https://doi.org/10.1063/5.0211707>`_ 2024
- B\. E. Murdock et al. **Li-Site Defects Induce Formation of Li-Rich Impurity Phases: Implications for Charge Distribution and Performance of LiNi** :sub:`0.5-x` **M** :sub:`x` **Mn** :sub:`1.5` **O** :sub:`4` **Cathodes (M = Fe and Mg; x = 0.05–0.2)** `Advanced Materials <https://doi.org/10.1002/adma.202400343>`_ 2024
- A\. G. Squires et al. **Oxygen dimerization as a defect-driven process in bulk LiNiO₂** `ChemRxiv <https://doi.org/10.26434/chemrxiv-2024-lcmkj>`_ 2024
- X\. Wang et al. **Upper efficiency limit of Sb₂Se₃ solar cells** `arXiv <https://arxiv.org/abs/2402.04434>`_ 2024
- I\. Mosquera-Lois et al. **Machine-learning structural reconstructions for accelerated point defect calculations** `arXiv <https://doi.org/10.48550/arXiv.2401.12127>`_ 2024
- W\. Dou et al. **Giant Band Degeneracy via Orbital Engineering Enhances Thermoelectric Performance from Sb₂Si₂Te₆ to Sc₂Si₂Te₆** `ChemRxiv <https://doi.org/10.26434/chemrxiv-2024-hm6vh>`_ 2024
- Y\. Fu & H. Lohan et al. **Factors Enabling Delocalized Charge-Carriers in Pnictogen-Based Solar Absorbers: In-depth Investigation into CuSbSe<sub>2</sub>** `arXiv <https://doi.org/10.48550/arXiv.2401.02257>`_ 2024
- S\. Hachmioune et al. **Exploring the Thermoelectric Potential of MgB4: Electronic Band Structure, Transport Properties, and Defect Chemistry** `Chemistry of Materials <https://doi.org/10.1021/acs.chemmater.4c00584>`_ 2024
- J\. Hu et al. **Enabling ionic transport in Li3AlP2 the roles of defects and disorder** `ChemRxiv <https://doi.org/10.26434/chemrxiv-2024-3s0kh>`_ 2024
- X\. Wang et al. **Upper efficiency limit of Sb₂Se₃ solar cells** `Joule <https://doi.org/10.1016/j.joule.2024.05.004>`_ 2024
- I\. Mosquera-Lois et al. **Machine-learning structural reconstructions for accelerated point defect calculations** `npj Computational Materials <https://doi.org/10.1038/s41524-024-01303-9>`_ 2024
- W\. Dou et al. **Band Degeneracy and Anisotropy Enhances Thermoelectric Performance from Sb₂Si₂Te₆ to Sc₂Si₂Te₆** `Journal of the American Chemical Society <https://doi.org/10.1021/jacs.4c01838>`_ 2024
- K\. Li et al. **Computational Prediction of an Antimony-based n-type Transparent Conducting Oxide: F-doped Sb₂O₅** `Chemistry of Materials <https://doi.org/10.1021/acs.chemmater.3c03257>`_ 2024
- X\. Wang et al. **Four-electron negative-U vacancy defects in antimony selenide** `Physical Review B <https://journals.aps.org/prb/abstract/10.1103/PhysRevB.108.134102>`_ 2023
- Y\. Kumagai et al. **Alkali Mono-Pnictides: A New Class of Photovoltaic Materials by Element Mutation** `PRX Energy <http://dx.doi.org/10.1103/PRXEnergy.2.043002>`__ 2023
Expand Down
2 changes: 1 addition & 1 deletion doped/VASP_sets/DefectSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ INCAR:
# Notes:
# KPAR is set to 2 for `vasp_std` calculations (multiple kpoints)
# NUPDOWN is set to 0 (singlet) or 1 (doublet) depending on the number of electrons
# (even or odd, respectively) see https://doped.readthedocs.io/en/latest/Tips.html#spin-polarisation
# (even or odd, respectively) -- see https://doped.readthedocs.io/en/latest/Tips.html#spin-polarisation
# Note that even-electron defects with multiple spin-polarised states (e.g. bipolarons;
# Fig. 2c in doi.org/10.1021/acsenergylett.1c00380) could also have triplet spin states
# (NUPDOWN=2), but the energy difference is likely to be small.
7 changes: 3 additions & 4 deletions doped/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,16 @@ def _ignore_pmg_warnings():
warnings.filterwarnings("ignore", message="Use get_magnetic_symmetry()")
warnings.filterwarnings("ignore", message="Use of properties is now deprecated")

warnings.filterwarnings("ignore", message="get_vasp_input") # deprecation warning introduced
# in pymatgen>2024.1.6, fixed in our PR: https://github.com/materialsproject/pymatgen/pull/3601
# (now merged) -- delete later if pymatgen requirement is updated beyond this

# avoid warning about selective_dynamics properties (can happen if user explicitly set "T T T" (or
# otherwise) for the bulk):
warnings.filterwarnings("ignore", message="Not all sites have property")

# ignore warning about structure charge that appears when getting Vasprun.as_dict():
warnings.filterwarnings("ignore", message="Structure charge")

# SpglibDataset warning introduced in v2.4.1
warnings.filterwarnings("ignore", message="dict interface")


_ignore_pmg_warnings()

Expand Down
Loading

0 comments on commit 761dab5

Please sign in to comment.