Skip to content

Commit 2a3a5fa

Browse files
fix sqs job / schemas
1 parent 396435a commit 2a3a5fa

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

src/atomate2/common/jobs/transform.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,20 +174,18 @@ def make( # type: ignore[override]
174174
if len(list(os.scandir(mcsqs_dir))) == 0:
175175
mcsqs_dir.unlink()
176176

177-
return SQSTask.from_structure(
177+
sqs_structures = None
178+
sqs_scores = None
179+
if isinstance(sqs_structs, list) and len(sqs_structs) > 1:
180+
sqs_structures = [entry["structure"] for entry in sqs_structs[1:]]
181+
sqs_scores = [entry["objective_function"] for entry in sqs_structs[1:]]
182+
183+
return SQSTask(
178184
transformation=self.transformation,
179185
input_structure=structure,
180186
final_structure=best_sqs,
181187
final_objective=best_objective,
182-
sqs_structures=(
183-
[entry["structure"] for entry in sqs_structs[1:]]
184-
if len(sqs_structs) > 1
185-
else None
186-
),
187-
sqs_scores=(
188-
[entry["objective_function"] for entry in sqs_structs[1:]]
189-
if len(sqs_structs) > 1
190-
else None
191-
),
188+
sqs_structures=sqs_structures,
189+
sqs_scores=sqs_scores,
192190
sqs_method=self.transformation.sqs_method,
193191
)

src/atomate2/common/schemas/transform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TransformTask(BaseModel):
2626
description="The transformation applied to a structure."
2727
)
2828

29-
final_strcture: Structure = Field(
29+
final_structure: Structure = Field(
3030
description="The structure after the transformation."
3131
)
3232

0 commit comments

Comments
 (0)