Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShakeNBreak v3.4 #81

Merged
merged 70 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
361fc63
Unzip `OUTCAR.gz` if present (and warn), for checking relaxation outputs
kavanase Aug 23, 2024
b054a54
Extend tests to `python=3.12`
kavanase Sep 10, 2024
3aef77c
Merge branch 'main' into develop
kavanase Sep 10, 2024
da9da38
Clean up paper list
kavanase Sep 22, 2024
d3662e7
Refactor plotting functions to reduce redundancy, and group together …
kavanase Sep 24, 2024
9b5d8ec
Update tests
kavanase Sep 24, 2024
123cb4c
Update all `snb-xxx` functions to auto detect if running in a defect …
kavanase Sep 24, 2024
c1605cb
Minor updates
kavanase Sep 24, 2024
b7d2c36
Minor updates
kavanase Sep 24, 2024
d04dfbe
Update comments
kavanase Oct 8, 2024
4933776
Minor updates to make some functions more robust with custom use, and…
kavanase Oct 9, 2024
6254faa
Update paper list
kavanase Oct 11, 2024
dcd4f1a
Use caching with structure matching to boost efficiency (>2x) with la…
kavanase Oct 11, 2024
a607542
Use efficient Voronoi analyzer from `doped` and update IO functions
kavanase Oct 11, 2024
3303661
Don't warn about unconverged structure if High_Energy folder present
kavanase Oct 11, 2024
9fc1e58
Update tests
kavanase Oct 11, 2024
a750d1a
Allow medium-level verbosity with default `verbose=None` (then high/l…
kavanase Oct 11, 2024
72b718d
Use more doped efficiency functions for fast structure matching
kavanase Oct 13, 2024
c0eaf3b
Add notes on `phonopy` installation issues with old `gcc`
kavanase Oct 14, 2024
267330d
Add note for people to please check previous GH Issues before asking …
kavanase Oct 19, 2024
abb1ad9
Add paper to list
kavanase Oct 19, 2024
d88b00f
Refactor `SnB_input_files`
kavanase Oct 20, 2024
702efb4
Add note to `incar.yaml`
kavanase Oct 20, 2024
080989d
Minor `snb-run` touchup
kavanase Oct 30, 2024
e3cce49
Use `doped` structure matching (~2 order of magnitude speed increase)
kavanase Nov 2, 2024
22f5521
Format `snb-run` info messages
kavanase Nov 3, 2024
36acd8f
Add paper to list
kavanase Dec 11, 2024
f4837a6
Update paper list
kavanase Dec 31, 2024
7aeb2f6
Update paper list
kavanase Jan 6, 2025
8c870e5
add "Dimer" to default distortion grid for vacancies and update input…
ireaml Jan 14, 2025
fa6ce5e
add verbose option to `apply_dimer_distortion`
ireaml Jan 14, 2025
c82be60
update type annotations for Tuple to be compatible with breaking chan…
ireaml Jan 14, 2025
f2a5e10
ignore tuple rule for ruff linting
ireaml Jan 14, 2025
4e25df5
fix annoying python 3.9 changes
ireaml Jan 14, 2025
56e2200
ignore linting rule "UP035"
ireaml Jan 14, 2025
e8c4239
to avoid issue with rule UP036
ireaml Jan 14, 2025
191bd12
replace + concatenator with unpacking operator for efficiency (RUF005)
ireaml Jan 14, 2025
10e009f
Merge remote-tracking branch 'origin/develop' into develop
kavanase Jan 14, 2025
8507eb4
Fix small typo
kavanase Jan 14, 2025
435302e
Use base python `tuple` class for typing
kavanase Jan 14, 2025
1666828
Minor updates from `CodeRabbit` suggestions
kavanase Jan 14, 2025
76d8a62
Update Cp2k file tests for latest `pymatgen`
kavanase Jan 17, 2025
58fae1e
Update Cp2k output energies for latest `pymatgen`
kavanase Jan 17, 2025
4a48383
Update paper list
kavanase Jan 17, 2025
f5f7c97
Update tests for new Dimer default
kavanase Jan 17, 2025
f1882c5
Update paper list
kavanase Jan 19, 2025
10c8d00
Update tests for Dimer
kavanase Jan 23, 2025
a2faff9
CHANGELOG rst formatting
kavanase Jan 24, 2025
56aac6e
`pre-commit` formatting
kavanase Jan 24, 2025
4c80375
Bump version number and changelog for release
kavanase Jan 24, 2025
75a35cb
Remove python=3.9 from linux tests
kavanase Jan 26, 2025
34e8a6b
CodeRabbit suggestions
kavanase Jan 26, 2025
40c06a4
Linting
kavanase Jan 26, 2025
25c42f7
Revert `test_input` debugging changes
kavanase Jan 26, 2025
a38ae2a
Correct type check
kavanase Jan 27, 2025
1f3eb14
Update paper list
kavanase Jan 28, 2025
bb4d36b
Ensure deterministic choice of NNs to distort (in cases of distance d…
kavanase Jan 30, 2025
c4b6793
Ensure deterministic choice of NNs to distort (in cases of distance d…
kavanase Jan 30, 2025
565dc4a
Add `test_distort_degenerate_case`
kavanase Jan 30, 2025
13ab0be
Update distortions tests
kavanase Jan 30, 2025
f12a255
Update input and analysis tests
kavanase Jan 30, 2025
cb26dea
Update handling of multiple `distorted_element`s
kavanase Jan 30, 2025
df845b1
Update Changelog
kavanase Jan 30, 2025
a862387
Update `test_input`
kavanase Jan 30, 2025
bbbde28
API docs formatting
kavanase Jan 30, 2025
7f08428
Add `_compare_dist_dicts` to avoid sensitivity to tiny Linux/MacOS ro…
kavanase Jan 30, 2025
1822e4d
Update test cleanup
kavanase Jan 30, 2025
3a62c33
Sort sites in Dimer generation for deterministic behaviour (irrespect…
kavanase Jan 30, 2025
53e1f41
More docstring formatting
kavanase Jan 30, 2025
78e9997
More docstring formatting
kavanase Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
max-parallel: 1

matrix:
python-version: ['3.11']
python-version: ['3.12']

name: Python ${{ matrix.python-version }} Test Pop

Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/pip_install_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ jobs:

matrix:
os: [ ubuntu-latest, macos-14 ]
python-version: [ '3.9', '3.10', '3.11' ]
exclude:
- os: macos-14
python-version: '3.9' # Exclude Python 3.9 on macOS, not supported for macOS-14 tests
# macos-latest should be 14 according to link below, but currently doesn't?
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
python-version: [ '3.10', '3.11', '3.12' ]

runs-on: ${{matrix.os}}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install dependencies
run: |
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ jobs:

matrix:
os: [ ubuntu-latest, macos-14 ]
python-version: [ '3.9', '3.10', '3.11' ]
exclude:
- os: macos-14
python-version: '3.9' # Exclude Python 3.9 on macOS, not supported for macOS-14 tests
# macos-latest should be 14 according to link below, but currently doesn't?
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
python-version: [ '3.10', '3.11', '3.12' ]

runs-on: ${{matrix.os}}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: ^(docs|tests|SnB_input_files|.github|shakenbreak/scripts|CITATION*|MANIFEST*)
exclude: ^(docs|tests|shakenbreak/SnB_input_files|.github|CITATION*|MANIFEST*)
repos:
# Lint and format, isort, docstrings...
- repo: https://github.com/charliermarsh/ruff-pre-commit
Expand Down
155 changes: 78 additions & 77 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
Change Log
==========

v3.4.0
----------
- Major efficiency updates:
- Uses ``_scan_sm_stol_till_match`` and turbo-charged ``StructureMatcher`` methods from ``doped``
``v3``, speeding up structure matching (e.g. in ``snb-regenerate`` for identifying distinct defect
geometries) by >~3 orders of magnitude.
- Uses caching in atomic displacement calculations (for ``"disp"``/``"max_dist"`` metrics)
- Use efficient Voronoi analyzer from ``doped`` ``v3`` for multiplicity determination.
- More efficient (and cleaner) plotting with many defects/distortions
- Add ``Dimer`` to default distortions grid output for vacancies, following discussions and testing for
cation vacancies in oxides.
- Miscellaneous:
- All ``snb-xxx`` functions now auto-detect if running within a defect folder or in a top-level
directory (i.e. auto ``--all`` behaviour).
- Handling of gzipped ``OUTCAR.gz`` files for energy parsing.
- Greater verbosity control
- Some code cleanup and formatting, and robustness updates

v3.3.6
----------
- Add `py.typed` to properly detect type hints by @Andrew-S-Rosen
- `snb-run` updates to improve efficiency
- Add ``py.typed`` to properly detect type hints by @Andrew-S-Rosen
- ``snb-run`` updates to improve efficiency

v3.3.5
----------
Expand Down Expand Up @@ -36,9 +54,9 @@ v3.3.1
----------
- ``distortion_metadata.json`` for each defect now saved to the individual defect folders (as well as the
combined total distortion metadata in the top level folder) – more likely to be retained by the user
when ``scp``ing around etc.
when ``scp``\ing around etc.
- Minor updates:
- Refactor ``_format_defect_name`` to ``format_defect_name`` from `doped` (now a public function)
- Refactor ``_format_defect_name`` to ``format_defect_name`` from ``doped`` (now a public function)
- Update ``snb-run`` to avoid possible 'file exists' warning
- Update tutorials/notebooks to specify ``vasp_nkred_std`` to streamline workflow
- Remove unnecessary ``tutorials`` folder with duplicate tutorial notebook (to reduce workload).
Expand All @@ -56,26 +74,26 @@ v3.3.1
v3.3.0
----------
- Add Dimer distortion as a targeted distortion for dimer reconstructions. It pushes two of the defect NN
to a distance of 2 A.
- Add option `distorted_atoms` to the `Distortion` class to allow users to specify the indexes of the
to a distance of 2 .
- Add option ``distorted_atoms`` to the ``Distortion`` class to allow users to specify the indexes of the
atoms to distort.
- Update tests to check the new functionality.
- Update `get_homoionic_bonds` to detect homoionic bonds between different cations/anions (rather than
- Update ``get_homoionic_bonds`` to detect homoionic bonds between different cations/anions (rather than
just bonds between the same element)
- Fix issue with `snb-generate` when no defect name was specified (by adding `unrelaxed=True` when
calling `get_defect_name_from_entry`)
- Update functions that read `OUTCARs` to be able to read `OUTCAR.gz` files too
- Fix issue with ``snb-generate`` when no defect name was specified (by adding ``unrelaxed=True`` when
calling ``get_defect_name_from_entry``)
- Update functions that read ``OUTCARs`` to be able to read ``OUTCAR.gz`` files too
- Update energies parsing to still work when all distortions are high energy, but warn
the user about this (i.e. only `Unperturbed`)
- Update `snb-run` to add early-on detection of distortions that are stuck in high energy basins and
the user about this (i.e. only ``Unperturbed``)
- Update ``snb-run`` to add early-on detection of distortions that are stuck in high energy basins and
rename them to "High_Energy" to avoid continuing their relaxation
- Miscellaneous efficiency improvements and bug fixes

v3.2.3
----------
- Ensure the sorted `pymatgen` `Structure` is created for the VASP input (fixes a rare bug in `v3.2.1`
and `v3.2.2` where for certain structures the order of elements in the POSCAR was not properly sorted,
which is usually fine, but messed with the `ROPT` `INCAR` setting).
- Ensure the sorted ``pymatgen`` ``Structure`` is created for the VASP input (fixes a rare bug in ``v3.2.1``
and ``v3.2.2`` where for certain structures the order of elements in the POSCAR was not properly sorted,
which is usually fine, but messed with the ``ROPT`` ``INCAR`` setting).
- Plotting format updates (make legend frame more transparent to make datapoints behind it easier to see).
- Update tests
- Update docs (note about handling AFM systems)
Expand All @@ -89,78 +107,78 @@ v3.2.2
v3.2.1
----------
- Update CLI config handling.
- Remove `shakenbreak.vasp` module and use `doped` VASP file writing functions directly.
- Add INCAR/KPOINTS/POTCAR file writing tests. `test_local.py` now deleted as these tests are now
automatically run in `test_input.py`/`test_cli.py` if `POTCAR`s available.
- Remove ``shakenbreak.vasp`` module and use ``doped`` VASP file writing functions directly.
- Add INCAR/KPOINTS/POTCAR file writing tests. ``test_local.py`` now deleted as these tests are now
automatically run in ``test_input.py``/``test_cli.py`` if ``POTCAR``\s available.

v3.2.0
----------
- Following the major release of `doped` `v2.0`, now compatible with the new `pymatgen`
defects code (`pymatgen>2022.7.25`), this update:
- Allows input of `doped` `DefectsGenerator` object to `Distortions`
- Following the major release of ``doped`` ``v2.0``, now compatible with the new ``pymatgen``
defects code (``pymatgen>2022.7.25``), this update:
- Allows input of ``doped`` ``DefectsGenerator`` object to ``Distortions``
- Updates the tutorials to reflect the current recommended workflow of generating defects
with `doped` and then applying `ShakeNBreak`, no longer requiring separate virtual environments 🎉
with ``doped`` and then applying ``ShakeNBreak``, no longer requiring separate virtual environments 🎉

v3.1.0
----------
- Update dependencies, as `hiphive=1.2` has been released, making `ShakeNBreak` compatible with
`python=3.11`🎉
- Update dependencies, as ``hiphive=1.2`` has been released, making ``ShakeNBreak`` compatible with
``python=3.11`` 🎉

v3.0.0
----------
- Switch to semantic versioning
- Update rattling functions to handle primitive bulk materials as well as supercells.
- Add check to `snb-run` if there are multiple `OUTCAR`s present with one or less ionic steps, and if
- Add check to ``snb-run`` if there are multiple ``OUTCAR``\s present with one or less ionic steps, and if
this is also the case for the current run -> warn the user.
- Small fixes, formatting and docs updates.

v23.06.23
----------
- Add `snb-mag` function, and automatically check the magnetisation from `ISPIN = 2` `OUTCAR` files when continuing
relaxations with `snb-run` (and change to `ISPIN = 1` if magnetisation is negligible).
- Add ``snb-mag`` function, and automatically check the magnetisation from ``ISPIN = 2`` ``OUTCAR`` files when continuing
relaxations with ``snb-run`` (and change to ``ISPIN = 1`` if magnetisation is negligible).
- Update handling of minimum distances and oxidation states, to deal with single-atom primitive unit cells and
systems where `pymatgen` cannot guess the oxidation state (e.g. single-elements, intermetallics etc).
systems where ``pymatgen`` cannot guess the oxidation state (e.g. single-elements, intermetallics etc).
- Docs updates

v23.06.03
----------
- Make parsing of `DefectEntry`s more robust.
- Update dependencies (now supporting `python=3.10` due to `numba` updates)
- Refactor `CITATION.cff` to `CITATIONS.md`
- Make parsing of ``DefectEntry``\s more robust.
- Update dependencies (now supporting ``python=3.10`` due to ``numba`` updates)
- Refactor ``CITATION.cff`` to ``CITATIONS.md``
- Update docs, formatting and cleanup.

v23.04.27
----------
- Update `numpy` requirement to `numpy>=1.21.2` to fix `numpy.typing.NDArray` import error.
- Update ``numpy`` requirement to ``numpy>=1.21.2`` to fix ``numpy.typing.NDArray`` import error.
- Add News & Views free-to-read link to docs

v23.04.26
----------
- Updates to `snb-run` (copy `job` from parent directory if present, switch to `ALGO = All` if poor electronic convergence...)
- Make `format_defect_name()` more robust
- Update docs and `README.md` with published article links
- Updates to ``snb-run`` (copy ``job`` from parent directory if present, switch to ``ALGO = All`` if poor electronic convergence...)
- Make ``format_defect_name()`` more robust
- Update docs and ``README.md`` with published article links
- Formatting and cleanup
- Make oxidation state guessing more efficient (previously was causing bottleneck with large cells)
- Fix oxidation state guessing for rare elements
- Add note to `Tips` docs page about bulk phase transformation behaviour
- Refactor to `json` rather than `pickle`
- Add note to ``Tips`` docs page about bulk phase transformation behaviour
- Refactor to ``json`` rather than ``pickle``

v23.02.08
----------
- Change `numpy` version requirement in `docs/requirements.txt` to `numpy>=1.21` to work with `numpy.typing.NDArray`.
- Change ``numpy`` version requirement in ``docs/requirements.txt`` to ``numpy>=1.21`` to work with ``numpy.typing.NDArray``.

v23.02.02
----------
- Refactor Distortions() class to take in DefectEntry objects as input, rather than Defect objects, to be
compatible with `pymatgen-analysis-defects`.
compatible with ``pymatgen-analysis-defects``.
- Fix ticks and ticklabels in plots


v23.01.25
--------

- Specify `pandas` version in requirements.txt to equal or higher than 1.1.0
- Refactor `snb-regenerate` to execute when no arguments are specified (rather than showing help message)
- Specify ``pandas`` version in requirements.txt to equal or higher than 1.1.0
- Refactor ``snb-regenerate`` to execute when no arguments are specified (rather than showing help message)

v23.01.7
--------
Expand All @@ -183,7 +201,6 @@ v22.12.1
v22.11.29
--------

Main changes:
- Add example notebook showing how to generate interstitials and apply SnB to them.
- Fix typo in example notebook and docs.
- Add comment about font installation to Installation guide.
Expand All @@ -205,78 +222,66 @@ Docs tutorial update.
v22.11.17
--------

Main changes:

- Refactor :code:`Distortions()` to a list or simple-format dict of :code:`Defect` objects as input.
Same for :code:`Distortions.from_structures()`
- Update defect naming to :code:`{Defect.name}_s{Defect.defect_site_index}` for vacancies/substitutions and
:code:`{Defect.name}_m{Defect.multiplicity}` for interstitials. Append "a", "b", "c" etc in cases of inequivalent
- Refactor ``Distortions()`` to a list or simple-format dict of ``Defect`` objects as input.
Same for ``Distortions.from_structures()``
- Update defect naming to ``{Defect.name}_s{Defect.defect_site_index}`` for vacancies/substitutions and
``{Defect.name}_m{Defect.multiplicity}`` for interstitials. Append "a", "b", "c" etc in cases of inequivalent
defects
- Make :code:`ShakeNBreak` compatible with most recent :code:`pymatgen` and :code:`pymatgen-analysis-defects` packages.
- Make ``ShakeNBreak`` compatible with most recent ``pymatgen`` and ``pymatgen-analysis-defects`` packages.
- Update legend format in plots and site index/multiplicity labelling, make default format png.
- Update default charge state setting to match :code:`pymatgen-analysis-defects` oxi state + padding approach.
- Update default charge state setting to match ``pymatgen-analysis-defects`` oxi state + padding approach.
- A lot of additional warning and error catches.
- Miscellaneous warnings and docs updates.


v22.11.7
--------

Main changes:

- Refactor ShakeNBreak to make it compatible with `pymatgen>=2022.8.23`. Now `Distortions` takes in
`pymatgen.analysis.defects.core.Defect` objects.
- Add `Distortions.from_dict()` and `Distortions.from_structures()` to generate defect distortions from a
- Refactor ShakeNBreak to make it compatible with ``pymatgen>=2022.8.23``. Now ``Distortions`` takes in
``pymatgen.analysis.defects.core.Defect`` objects.
- Add ``Distortions.from_dict()`` and ``Distortions.from_structures()`` to generate defect distortions from a
dictionary of defects (in doped format) or from a list of defect structures, respectively.

v22.11.1
--------

Main changes:

- Update rattling procedure; :code:`stdev` be automatically set to 10% bulk bond length and :code:`seed` alternated for different
- Update rattling procedure; ``stdev`` be automatically set to 10% bulk bond length and ``seed`` alternated for different
distortions (set to 100*distortion_factor) to avoid rare 'stuck rattle' occurrences.
- Refactor :code:`pickle` usages to :code:`JSON` serialisation to be more robust to package (i.e. pymatgen) updates.
- Update :code:`snb-regenerate` to be more robust, can be continually rerun without generating duplicate calculations.
- Update :code:`snb-run` to consider calculations with >50 ionic steps and <2 meV energy change as converged.
- Refactor ``pickle`` usages to ``JSON`` serialisation to be more robust to package (i.e. pymatgen) updates.
- Update ``snb-regenerate`` to be more robust, can be continually rerun without generating duplicate calculations.
- Update ``snb-run`` to consider calculations with >50 ionic steps and <2 meV energy change as converged.
- Minor changes, efficiency improvements and bug fixes.


v22.10.14
--------

Just bumping version number to test updated GH Actions pip-install-test workflow.
Just bumping version number to test updated GH Actions ``pip-install-test`` workflow.

v22.10.13
--------

Main changes:

- Updated defect name handling to work for all conventions
- More robust `snb-generate` and plotting behaviour
- More robust ``snb-generate`` and plotting behaviour
- Add CLI summary GIF to docs and README
- Updated `snb-run` behaviour to catch high-energies and forces error to improve efficiency
- Updated ``snb-run`` behaviour to catch high-energies and forces error to improve efficiency
- Many miscellaneous tests and fixes
- Docs updates

v22.9.21
--------

Main changes:

- Fonts now included in `package_data` so can be installed with `pip` from `PyPI`
- Refactoring `distortion_plots` plot saving to saving to defect directories, and preventing overwriting of previous plots
- Fonts now included in ``package_data`` so can be installed with ``pip`` from ``PyPI``
- Refactoring ``distortion_plots`` plot saving to saving to defect directories, and preventing overwriting of previous plots
- Miscellaneous tests and fixes
- Add summary GIF to docs and README
- Handling for partial oxidation state input
- Setting `EDIFFG = -0.01` and `local_rattle = False` as default
- Setting ``EDIFFG = -0.01`` and ``local_rattle = False`` as default


v22.9.2
--------

Main changes:

- Update CLI commands (snb-parse, analyse, plot and groundstate can all now be run with no arguments within a defect folder)
- Update custom font
- Update groundstate() tests
Expand All @@ -286,8 +291,6 @@ Main changes:
v22.9.1
--------

Main changes:

- Test for pip install
- Automatic release and upload to pypi
- Add ShakeNBreak custom font, and automatise its installation
Expand All @@ -297,8 +300,6 @@ Main changes:
v1.0.1
------

Main changes:

- Docs formatting
- Update pymatgen version to v2022.7.25, while refactoring to be compatible with v2022.8.23 takes place.

Expand Down
Loading
Loading