Skip to content

Commit c6031ff

Browse files
authored
fix Molecule.get_boxed_structure when reorder=False (#4419)
1 parent 55f70b2 commit c6031ff

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/pymatgen/core/structure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3959,7 +3959,7 @@ def get_boxed_structure(
39593959
return cls(
39603960
lattice,
39613961
self.species * nimages,
3962-
coords,
3962+
all_coords,
39633963
coords_are_cartesian=True,
39643964
site_properties=site_props,
39653965
labels=self.labels * nimages,

tests/core/test_structure.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,6 +2237,7 @@ def test_get_boxed_structure(self):
22372237
no_reorder = self.mol.get_boxed_structure(10, 10, 10, reorder=False)
22382238
assert str(s3[0].specie) == "H"
22392239
assert str(no_reorder[0].specie) == "C"
2240+
assert_allclose(no_reorder[2].frac_coords, [0.60267191, 0.5, 0.4637])
22402241

22412242
def test_get_distance(self):
22422243
assert self.mol.get_distance(0, 1) == approx(1.089)

0 commit comments

Comments
 (0)