Skip to content

Commit 18c18ae

Browse files
add top-level failure_reasons field and tags for workflow meta
1 parent 4d7e7c3 commit 18c18ae

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

emmet-core/emmet/core/neb.py

+17-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ class NebMethod(ValueEnum):
4040
class HopFailureReason(ValueEnum):
4141
"""Define failure modes for ApproxNEB calculations."""
4242

43-
ENDPOINT = "Endpoint structure relaxation failed"
43+
ENDPOINT = "Endpoint structure relaxation failed."
4444
MIN_DIST = "Linear distance traversed by working ion is below threshold."
45-
MIN_IMAGE = "Too few image calculations succeeded"
45+
MIN_IMAGE = "Too few image calculations succeeded."
46+
IMAGE_FAILURE = "No image calculation output."
4647

4748

4849
class BarrierAnalysis(BaseModel):
@@ -177,6 +178,14 @@ class NebResult(BaseModel):
177178
None, description="Analysis of the reaction barrier."
178179
)
179180

181+
failure_reasons: list[HopFailureReason] | None = Field(
182+
None, description="Reasons why the barrier calculation failed."
183+
)
184+
185+
tags: list[str] | None = Field(
186+
None, description="List of string metadata about the calculation."
187+
)
188+
180189
@model_validator(mode="after")
181190
def set_barriers(self) -> Self:
182191
"""Perform analysis on barrier if needed."""
@@ -194,6 +203,12 @@ def set_barriers(self) -> Self:
194203
)
195204
return self
196205

206+
@property
207+
def barrier_energy_range(self) -> float | None:
208+
"""The maximum computed energy minus the minimum computed energy along the path."""
209+
if self.energies:
210+
return max(self.energies) - min(self.energies)
211+
197212

198213
class NebTaskDoc(NebResult):
199214
"""Define schema for VASP NEB tasks."""

0 commit comments

Comments
 (0)