Skip to content

Commit 511c90f

Browse files
committed
fix StandardTransmuter.append_transformation promising list[bool] but returning nothing
fix brittle TestQuasiHarmonicDebyeApprox.test_gruneisen_parameter from tight assert_allclose abs tol
1 parent 4a1522c commit 511c90f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/pymatgen/alchemy/transmuters.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def redo_next_change(self) -> None:
103103
for ts in self.transformed_structures:
104104
ts.redo_next_change()
105105

106-
def append_transformation(self, transformation, extend_collection=False, clear_redo=True):
106+
def append_transformation(self, transformation, extend_collection=False, clear_redo=True) -> list[bool]:
107107
"""Append a transformation to all TransformedStructures.
108108
109109
Args:
@@ -117,8 +117,8 @@ def append_transformation(self, transformation, extend_collection=False, clear_r
117117
redo, the redo list should not be cleared to allow multiple redos.
118118
119119
Returns:
120-
list[bool]: corresponding to initial transformed structures each boolean
121-
describes whether the transformation altered the structure
120+
list[bool]: Each list item is True if the transformation altered the structure
121+
with the corresponding index.
122122
"""
123123
if self.ncores and transformation.use_multiprocessing:
124124
with Pool(self.ncores) as pool:
@@ -136,6 +136,9 @@ def append_transformation(self, transformation, extend_collection=False, clear_r
136136
new_structures += new
137137
self.transformed_structures += new_structures
138138

139+
# len(ts) > 1 checks if the structure has history
140+
return [len(ts) > 1 for ts in self.transformed_structures]
141+
139142
def extend_transformations(self, transformations):
140143
"""Extend a sequence of transformations to the TransformedStructure.
141144

tests/analysis/test_quasi_harmonic_debye_approx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def test_debye_temperature(self):
193193

194194
def test_gruneisen_parameter(self):
195195
gamma = self.qhda.gruneisen_parameter(0, self.qhda.ev_eos_fit.v0)
196-
assert_allclose(gamma, 2.188302, atol=1e-3)
196+
assert_allclose(gamma, 2.188302, atol=1e-2)
197197

198198
def test_thermal_conductivity(self):
199199
kappa = self.qhda.thermal_conductivity(self.T, self.opt_vol)

0 commit comments

Comments
 (0)