Skip to content

Commit

Permalink
Merge pull request #34 from SMTG-UCL/develop
Browse files Browse the repository at this point in the history
Merging as tests have passed
  • Loading branch information
kavanase authored Nov 17, 2022
2 parents 5827e4a + 1e78af6 commit 1a8e853
Show file tree
Hide file tree
Showing 73 changed files with 6,360 additions and 6,915 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
Change Log
==========

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
defects
- Make :code:`ShakeNBreak` compatible with most recent :code:`pymatgen` and :code:`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.
- A lot of additional warning and error catches.
- Miscellaneous warnings and docs updates.


v22.11.7
--------

Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ If using `VASP`, in order for `ShakeNBreak` to automatically generate the pseudo
```
Within your `VASP` pseudopotential top directory, you should have a folder named `POT_GGA_PAW_PBE` which contains the `POTCAR.X(.gz)` files (in this case for PBE `POTCAR`s). More details given [here](https://pymatgen.org/installation.html#potcar-setup).

The font Montserrat ([Open Font License](https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL)) will be installed with the package, and will be used by default for plotting.

### Developer installation
For development work, ShakeNBreak can also be installed from a copy of the source directory:

Expand Down Expand Up @@ -77,12 +79,19 @@ More information about each function and its inputs/outputs are available from t
We recommend at least looking through the [tutorials](https://shakenbreak.readthedocs.io/en/latest/Tutorials.html) when first starting to use `ShakeNBreak`, to familiarise yourself with the full functionality and workflow.

## Code Compatibility
`ShakeNBreak` is built to natively function using `pymatgen` `Defect` objects ([docs available here](https://materialsproject.github.io/pymatgen-analysis-defects/)) and be compatible with the most recent version of `pymatgen`. If you are receiving `pymatgen`-related errors when using `ShakeNBreak`, you may need to update `pymatgen` and/or `ShakeNBreak`, which can be done with:
`ShakeNBreak` is built to natively function using `pymatgen` `Defect` objects ([docs available here](https://materialsproject.github.io/pymatgen-analysis-defects/)) and be compatible with the most recent version of `pymatgen`.
If you are receiving `pymatgen`-related errors when using `ShakeNBreak`, you may need to update `pymatgen` and/or `ShakeNBreak`, which can be done with:
```bash
pip install --upgrade pymatgen shakenbreak
```

`ShakeNBreak` can take `pymatgen` `Defect` objects as input (to then generate the trial distorted structures), **_but also_** can take in `pymatgen` `Structure` objects, `doped` defect dictionaries or structure files (e.g. `POSCAR`s for `VASP`) as inputs. As such, it should be compatible with any defect code (such as `doped`, `DASP`, `PyLada`, `PyCDT`, `Spinney`, `DefAP`, `PyDEF`, `pydefect`...) that generates these files.
`ShakeNBreak` can take `pymatgen` `Defect` objects as input (to then generate the trial distorted structures),
**_but also_** can take in `pymatgen` `Structure` objects, `doped` defect dictionaries or structure files
(e.g. `POSCAR`s for `VASP`) as inputs. As such, it should be compatible with any defect code
(such as [`doped`](https://github.com/SMTG-UCL/doped), [`pydefect`](https://github.com/kumagai-group/pydefect),
[`PyCDT`](https://github.com/mbkumar/pycdt), [`PyLada`](https://github.com/pylada/pylada-defects),
[`DASP`](http://hzwtech.com/files/software/DASP/htmlEnglish/index.html), [`Spinney`](https://gitlab.com/Marrigoni/spinney/-/tree/master),
[`DefAP`](https://github.com/DefAP/defap), [`PyDEF`](https://github.com/PyDEF2/PyDEF-2.0)...) that generates these files.
Please let us know if you have any issues with compatibility, or if you would like to see any additional features added to `ShakeNBreak` to make it more compatible with your code.

## Contributing
Expand Down
24 changes: 12 additions & 12 deletions docs/Analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Alternatively, we can run from a different directory and specify the defect to p

.. code:: bash
$ snb-parse --defect vac_1_Cd_0 --path defects_folder --code FHI-aims
$ snb-parse --defect v_Cd_s0_0 --path defects_folder --code FHI-aims
Where ``defects_folder`` is the path to the top level directory containing the defect folder, and is only required if
different from the current directory.
Expand All @@ -32,7 +32,7 @@ in a given/current directory using the ``-a``/``--all`` flag:
This generates a ``yaml`` file for each defect, mapping each distortion to the
final energy of the relaxed structures (in eV). These files are saved to the
corresponding defect directory (e.g. ``defects_folder/vac_1_Cd_0/vac_1_Cd_0.yaml``).
corresponding defect directory (e.g. ``defects_folder/v_Cd_s0_0/v_Cd_s0_0.yaml``).

.. code:: yaml
Expand Down Expand Up @@ -61,7 +61,7 @@ was used (if not :code:`VASP`) and which reference structure to use (default = `

.. code:: bash
$ snb-analyse --defect vac_1_Cd_0 --code FHI-aims --path defects_folder --ref_struct -0.4 --verbose
$ snb-analyse --defect v_Cd_s0_0 --code FHI-aims --path defects_folder --ref_struct -0.4 --verbose
Again if we want to analyse the results for **all** defects present in a given/current directory, we can use the
``-a``/``--all`` flag:
Expand Down Expand Up @@ -90,7 +90,7 @@ the defect directory:
which will generate a figure like the one below:

.. image:: ./vac_1_Cd_0.svg
.. image:: ./v_Cd_s0_0.svg
:width: 400px

..
Expand All @@ -103,7 +103,7 @@ structures, using the ``-cb``/``--colorbar`` flag:
$ snb-plot -cb
.. image:: ./vac_1_Cd_0_colorbar.svg
.. image:: ./v_Cd_s0_0_colorbar.svg
:width: 450px

..
Expand All @@ -114,7 +114,7 @@ was used (if not :code:`VASP`) and other options (what ``metric`` to use for col

.. code:: bash
$ snb-plot --defect vac_1_Cd_0 --code FHI-aims --path defects_folder --colorbar -0.4 --metric disp --units meV --verbose
$ snb-plot --defect v_Cd_s0_0 --code FHI-aims --path defects_folder --colorbar -0.4 --metric disp --units meV --verbose
Again if we want to plot the results for **all** defects present in a given/current directory, we can use the
``-a``/``--all`` flag:
Expand Down Expand Up @@ -143,15 +143,15 @@ For example, if we have the following directory structure
.. code:: bash
./
|--- vac_1_Cd_0/ <-- Neutral Cd vacancy
|--- v_Cd_s0_0/ <-- Neutral Cd vacancy
| |--- Unperturbed
| |
| |--- Bond_Distortion_-30.0% <-- Favourable distortion
| |
| |--- Bond_Distortion_30.0%
| | ...
|
|--- vac_1_Cd_-1/ <-- Negatively charged Cd vacancy
|--- v_Cd_s0_-1/ <-- Negatively charged Cd vacancy
|--- Unperturbed
| ...
|--- Bond_Distortion_50% <-- Favourable distortion
Expand All @@ -171,7 +171,7 @@ for the code specified with the flag ``--code`` (default = :code:`VASP`).
.. code:: bash
./
|--- vac_1_Cd_0/
|--- v_Cd_s0_0/
| |--- Unperturbed
| |
| |--- Bond_Distortion_-30.0% <-- Favourable distortion
Expand All @@ -180,7 +180,7 @@ for the code specified with the flag ``--code`` (default = :code:`VASP`).
| | ...
| |--- Bond_Distortion_50.0%_from_-1 <-- Distortion from the -1 charge state
|
|--- vac_1_Cd_-1/
|--- v_Cd_s0_-1/
|--- Unperturbed
| ...
|--- Bond_Distortion_50% <-- Favourable distortion
Expand Down Expand Up @@ -214,7 +214,7 @@ This command will generate a ``Groundstate`` directory within each defect folder
.. code:: bash
./
|--- vac_1_Cd_0/
|--- v_Cd_s0_0/
| |--- Unperturbed
| |
| |--- Bond_Distortion_-30.0%
Expand All @@ -224,7 +224,7 @@ This command will generate a ``Groundstate`` directory within each defect folder
| |--- Groundstate
| |--- POSCAR <-- Ground state structure
|
|--- vac_1_Cd_-1/
|--- v_Cd_s0_-1/
|--- Unperturbed
| ...
|--- Bond_Distortion_50%
Expand Down
17 changes: 14 additions & 3 deletions docs/Code_Compatibility.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
Code Compatibility
========================

:code:`ShakeNBreak` is built to natively function using :code:`pymatgen` :code:`Defect` objects (`docs available here <https://materialsproject.github.io/pymatgen-analysis-defects/>`_) and be compatible with the most recent version of :code:`pymatgen`. If you are receiving :code:`pymatgen`-related errors when using :code:`ShakeNBreak`, you may need to update :code:`pymatgen` and/or :code:`ShakeNBreak`, which can be done with:
:code:`ShakeNBreak` is built to natively function using :code:`pymatgen` :code:`Defect` objects
(`docs available here <https://materialsproject.github.io/pymatgen-analysis-defects/>`_) and be compatible with the
most recent version of :code:`pymatgen`. If you are receiving :code:`pymatgen`-related errors when using
:code:`ShakeNBreak`, you may need to update :code:`pymatgen` and/or :code:`ShakeNBreak`, which can be done with:

.. code:: bash
pip install --upgrade pymatgen shakenbreak
:code:`ShakeNBreak` can take :code:`pymatgen` :code:`Defect` objects as input (to then generate the trial distorted structures), **but also** can take in :code:`pymatgen` :code:`Structure` objects, :code:`doped` defect dictionaries or structure files (e.g. :code:`POSCAR`\s for :code:`VASP`) as inputs. As such, it should be compatible with any defect code (such as :code:`doped`, :code:`DASP`, :code:`PyLada`, :code:`PyCDT`, :code:`Spinney`, :code:`DefAP`, :code:`PyDEF`, :code:`pydefect`...) that generates these files.
Please let us know if you have any issues with compatibility, or if you would like to see any additional features added to :code:`ShakeNBreak` to make it more compatible with your code.
:code:`ShakeNBreak` can take :code:`pymatgen` :code:`Defect` objects as input (to then generate the trial distorted
structures), **but also** can take in :code:`pymatgen` :code:`Structure` objects, :code:`doped` defect dictionaries or
structure files (e.g. :code:`POSCAR`\s for :code:`VASP`) as inputs. As such, it should be compatible with any defect code
(such as `doped <https://github.com/SMTG-UCL/doped>`_, `pydefect <https://github.com/kumagai-group/pydefect>`_,
`PyCDT <https://github.com/mbkumar/pycdt>`_, `PyLada <https://github.com/pylada/pylada-defects>`_,
`DASP <http://hzwtech.com/files/software/DASP/htmlEnglish/index.html>`_, `Spinney <https://gitlab.com/Marrigoni/spinney/-/tree/master>`_,
`DefAP <https://github.com/DefAP/defap>`_, `PyDEF <https://github.com/PyDEF2/PyDEF-2.0>`_...) that generates these files.

Please let us know if you have any issues with compatibility, or if you would like to see any additional features added
to :code:`ShakeNBreak` to make it more compatible with your code.
6 changes: 6 additions & 0 deletions docs/Installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ Within your ``VASP`` pseudopotential top directory, you should have a folder nam
which contains the ``POTCAR.X(.gz)`` files (in this case for PBE ``POTCARs``). More details given
`here <https://pymatgen.org/installation.html#potcar-setup>`_.

.. NOTE::
The font `Montserrat <https://fonts.google.com/specimen/Montserrat/about>`
(`Open Font License <https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL>`_)
will be installed with the package, and will be used by default for plotting. If you prefer to use a different
font, you can change the font in the ``matplotlib`` style sheet (in ``shakenbreak/shakenbreak.mplstyle``).

Developer's installation (*optional*)
-----------------------------------------

Expand Down
Loading

0 comments on commit 1a8e853

Please sign in to comment.