Skip to content

Commit

Permalink
Ensure _get_element_min_max_bond_length_dict works even for single-…
Browse files Browse the repository at this point in the history
…site structures
  • Loading branch information
kavanase committed Nov 20, 2024
1 parent 6920c44 commit 1a28d56
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doped/utils/configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ def _get_symbol(element: Union[Element, Species]):
return element.element.symbol
return str(element)

if len(structure) == 1:
structure = structure * 2 # need at least two sites to calculate bond lengths

element_idx_dict = { # distance matrix broken down by species
_get_symbol(element): [
i for i, site in enumerate(structure) if _get_symbol(site.specie) == _get_symbol(element)
Expand Down

0 comments on commit 1a28d56

Please sign in to comment.