Skip to content

Commit

Permalink
Clarify argument shift for SlabGenerator.get_slab (#3748)
Browse files Browse the repository at this point in the history
* put `is_symmetric/polar` next to `property`

* BREAKING: reverse `get_slab` shift direction

* clarify `shift` for single atom

* use `isclose` to determine overlap atoms

* correct tolerance unit

* Revert "put `is_symmetric/polar` next to `property`"

This reverts commit 65e3ec8.

* reapply docstring changes

* use `isclose` to check close

* fix typo in tag

* remove debug tag

* pre-commit auto-fixes

* make `center_slab` very simple

* Failed: make center_slab and get_slab_regions methods for `Slab`

* revert deprecation of `center_slab` function

* revert "overlap position check with isclose"

* revert deprecation of center_slab and get_slab_regions

* revert changes for `center_slab` function

* recover docstring

* rename slab to struct (type is Structure)

* revert adding minus sign

* fix slab type

* keep shift def consistent (need clarify)

* unify usage of shift outside Slab

* fix unit test

* add missing minus sign for single atom shift

* [need confirm] fix test for coh-interface

* add TODO tag

* clarify shift definition

* revert ALL change related to the direction of shift

* rename arg shift to termination

* tweak comments

* clarify `shift` attrib in `Slab`

* clarify magic number

* simplify doc

* reuse `center_slab` func

* remove unneeded TODO tag

* revert shift to termination rename

* remove finished TODO tag

---------

Co-authored-by: Janosh Riebesell <[email protected]>
  • Loading branch information
DanielYang59 and janosh authored Jun 3, 2024
1 parent d1fac20 commit eed8403
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 103 deletions.
8 changes: 4 additions & 4 deletions pymatgen/analysis/interfaces/coherent_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ def _find_terminations(self):
film_slabs = film_sg.get_slabs()
sub_slabs = sub_sg.get_slabs()

film_shifts = [s.shift for s in film_slabs]
film_terminations = [label_termination(s) for s in film_slabs]
film_shifts = [slab.shift for slab in film_slabs]
film_terminations = [label_termination(slab) for slab in film_slabs]

sub_shifts = [s.shift for s in sub_slabs]
sub_terminations = [label_termination(s) for s in sub_slabs]
sub_shifts = [slab.shift for slab in sub_slabs]
sub_terminations = [label_termination(slab) for slab in sub_slabs]

self._terminations = {
(film_label, sub_label): (film_shift, sub_shift)
Expand Down
Loading

0 comments on commit eed8403

Please sign in to comment.