From 6da69be5465270e0aaf2ae6f3ec59ea616fdec70 Mon Sep 17 00:00:00 2001 From: Sudarshan Vijay Date: Sun, 9 Jun 2024 20:08:52 +0200 Subject: [PATCH] structure bug with elements not being tiled --- src/py4vasp/calculation/_structure.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/py4vasp/calculation/_structure.py b/src/py4vasp/calculation/_structure.py index 81510c3d..d1a12719 100644 --- a/src/py4vasp/calculation/_structure.py +++ b/src/py4vasp/calculation/_structure.py @@ -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),