Skip to content

Commit

Permalink
Merge pull request #76 from SMTG-Bham/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
kavanase committed Jun 5, 2024
2 parents 7299a0a + ff209d3 commit b61e93d
Show file tree
Hide file tree
Showing 16 changed files with 703 additions and 300 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Change Log
==========

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
1 change: 0 additions & 1 deletion docs/Dev_ToDo.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
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
- 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).
Expand Down
2 changes: 1 addition & 1 deletion 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
24 changes: 10 additions & 14 deletions doped/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import contextlib
import os
import warnings
from multiprocessing import Pool, Queue, cpu_count
from multiprocessing import Pool, cpu_count
from typing import TYPE_CHECKING, Optional, Union

import numpy as np
Expand All @@ -26,7 +26,7 @@
from tqdm import tqdm

from doped import _doped_obj_properties_methods, _ignore_pmg_warnings
from doped.core import DefectEntry, _guess_and_set_oxi_states_with_timeout, _rough_oxi_state_cost_from_comp
from doped.core import DefectEntry, guess_and_set_oxi_states_with_timeout
from doped.generation import get_defect_name_from_defect, get_defect_name_from_entry, name_defect_entries
from doped.thermodynamics import DefectThermodynamics
from doped.utils.parsing import (
Expand Down Expand Up @@ -706,18 +706,14 @@ def __init__(

# try parsing the bulk oxidation states first, for later assigning defect "oxi_state"s (i.e.
# fully ionised charge states):
if _rough_oxi_state_cost_from_comp(self.bulk_vr.final_structure.composition) > 1e6:
self._bulk_oxi_states: Union[dict, bool] = False # will take very long to guess oxi_state
else:
queue: Queue = Queue()
self._bulk_oxi_states = _guess_and_set_oxi_states_with_timeout(
self.bulk_vr.final_structure, queue=queue
)
if self._bulk_oxi_states:
self.bulk_vr.final_structure = queue.get() # oxi-state decorated structure
self._bulk_oxi_states = {
el.symbol: el.oxi_state for el in self.bulk_vr.final_structure.composition.elements
}
self._bulk_oxi_states: Union[dict, bool] = False
if bulk_struct_w_oxi := guess_and_set_oxi_states_with_timeout(
self.bulk_vr.final_structure, break_early_if_expensive=True
):
self.bulk_vr.final_structure = bulk_struct_w_oxi
self._bulk_oxi_states = {
el.symbol: el.oxi_state for el in self.bulk_vr.final_structure.composition.elements # type: ignore
}

self.defect_dict = {}
self.bulk_corrections_data = { # so we only load and parse bulk data once
Expand Down
Loading

0 comments on commit b61e93d

Please sign in to comment.