3
3
from datetime import datetime
4
4
from pathlib import Path
5
5
from pydantic import BaseModel , Field
6
- from typing import Optional , Tuple , Union
6
+ from typing import Optional , Tuple , Union , Sequence
7
7
from typing_extensions import Self
8
8
9
9
from monty .os .path import zpath
@@ -37,7 +37,7 @@ class NebMethod(ValueEnum):
37
37
class NebTaskDoc (BaseModel , extra = "allow" ):
38
38
"""Define schema for VASP NEB tasks."""
39
39
40
- endpoint_structures : tuple [ Structure , Structure ] = Field (
40
+ endpoint_structures : Sequence [ Structure ] = Field (
41
41
None ,
42
42
description = "The initial and final configurations (reactants and products) of the barrier." ,
43
43
)
@@ -152,6 +152,12 @@ def from_directory(
152
152
else :
153
153
inputs ["orig_inputs" ] = OrigInputs (** vis )
154
154
155
+ neb_method = (
156
+ NebMethod .CLIMBING_IMAGE
157
+ if inputs ["inputs" ].incar .get ("LCLIMB" , False )
158
+ else NebMethod .STANDARD
159
+ )
160
+
155
161
return cls (
156
162
endpoint_structures = endpoint_structures ,
157
163
image_calculations = image_calculations ,
@@ -160,11 +166,7 @@ def from_directory(
160
166
orig_inputs = inputs ["orig_inputs" ],
161
167
inputs = inputs ["inputs" ],
162
168
image_objects = image_objects ,
163
- neb_method = (
164
- NebMethod .CLIMBING_IMAGE
165
- if inputs ["inputs" ].incar .get ("LCLIMB" )
166
- else NebMethod .STANDARD
167
- ),
169
+ neb_method = neb_method ,
168
170
state = task_state ,
169
171
image_energies = [calc .output .energy for calc in image_calculations ],
170
172
custodian = _parse_custodian (dir_name ),
0 commit comments