Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Commit

Permalink
Merge pull request #35 from molsturm/dev-mfh
Browse files Browse the repository at this point in the history
Bugfix: coords and atoms may be numpy arrays
  • Loading branch information
mfherbst committed Dec 2, 2017
2 parents bb20a0f + 5ef16b8 commit 8fa7431
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/interface/python/gint/Structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, atoms=[], coords=[]):
elif not isinstance(atoms, (list, tuple, np.ndarray)):
raise TypeError("atoms needs to be a list or tuple")

if atoms and not coords:
if len(atoms) > 0 and len(coords) == 0:
if len(atoms) == 1:
coords = [[0, 0, 0]]
else:
Expand All @@ -54,7 +54,7 @@ def __init__(self, atoms=[], coords=[]):
self.atom_numbers = np.array(element.to_atom_numbers(atoms))
self.coords = np.array(coords)

if coords and self.coords.shape[1] != 3:
if len(coords) > 0 and self.coords.shape[1] != 3:
raise ValueError("The coords list needs to have exactly 3 items per "
"coordinate.")

Expand Down

0 comments on commit 8fa7431

Please sign in to comment.