Skip to content

Commit

Permalink
structure bug with elements not being tiled
Browse files Browse the repository at this point in the history
  • Loading branch information
sudarshanv01 committed Jun 9, 2024
1 parent cf67225 commit 6da69be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/py4vasp/calculation/_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@ def to_view(self, supercell=None):
{examples}
"""
make_3d = lambda array: array if array.ndim == 3 else array[np.newaxis]
number_steps = len(self.positions())
elements = np.tile(self._topology().elements(), (number_steps, 1))
return view.View(
elements=np.atleast_2d(self._topology().elements()),
elements=np.atleast_2d(elements),
lattice_vectors=make_3d(self.lattice_vectors()),
positions=make_3d(self.positions()),
supercell=self._parse_supercell(supercell),
Expand Down

0 comments on commit 6da69be

Please sign in to comment.