From 32df96f8970fd9b41a615f9e3a6cad3930ae0eac Mon Sep 17 00:00:00 2001 From: qzhu2017 Date: Thu, 12 Dec 2024 13:16:13 -0500 Subject: [PATCH] enable the wp as the numbers in from_spg_wps_rep --- pyxtal/__init__.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pyxtal/__init__.py b/pyxtal/__init__.py index 3804e7f..f25d293 100644 --- a/pyxtal/__init__.py +++ b/pyxtal/__init__.py @@ -3484,12 +3484,15 @@ def from_spg_wps_rep(self, spg, wps, x, elements=None): group = Group(spg) sites = [] for i, _wp in enumerate(wps): - letter = _wp[-1] - for wp in group: - if wp.letter == letter: - sites.append((elements[i], wp)) - break - self.from_1d_rep(x, sites) + if type(_wp) is int: + sites.append((elements[i], group[_wp])) + else: + letter = _wp[-1] + for wp in group: + if wp.letter == letter: + sites.append((elements[i], wp)) + break + self.from_1d_rep(x, sites, normalize) def from_1d_rep(self, x, sites, dim=3): """