@@ -112,29 +112,24 @@ def make(
112
112
* self .initial_strain , self .postprocessor .min_data_points
113
113
)
114
114
working_outputs = {
115
- "relax" : {
116
- key : [] for key in ("energies" , "volume" , "stress" , "pressure" )
117
- }
115
+ "relax" : {key : [] for key in ("energy" , "volume" , "stress" , "pressure" )}
118
116
}
119
117
120
118
else :
121
119
# Fit EOS to running list of energies and volumes
122
120
self .postprocessor .fit (working_outputs )
123
121
working_outputs = dict (self .postprocessor .results )
124
122
flow_output = {"working_outputs" : working_outputs .copy (), "structure" : None }
125
- for k in ("pressure" , "energy" ):
123
+ for k in ("pressure" ,):
126
124
working_outputs ["relax" ].pop (k , None )
127
125
128
126
# Stop flow here if EOS cannot be fit
129
127
if (v0 := working_outputs .get ("V0" )) is None :
130
128
return Response (output = flow_output , stop_children = True )
131
129
132
130
# Check if equilibrium volume is in range of attempted volumes
133
- v0_in_range = (
134
- (vmin := working_outputs .get ("Vmin" ))
135
- <= v0
136
- <= (vmax := working_outputs .get ("Vmax" ))
137
- )
131
+ vmin = working_outputs .get ("Vmin" )
132
+ vmax = working_outputs .get ("Vmax" )
138
133
139
134
# Check if maximum number of refinement NVT runs is set,
140
135
# and if so, if that limit has been reached
@@ -143,7 +138,7 @@ def make(
143
138
)
144
139
145
140
# Successful fit: return structure at estimated equilibrium volume
146
- if v0_in_range or max_attempts_reached :
141
+ if ( vmin <= v0 <= vmax ) or max_attempts_reached :
147
142
flow_output ["structure" ] = structure .copy ()
148
143
flow_output ["structure" ].scale_lattice (v0 ) # type: ignore[attr-defined]
149
144
return flow_output
@@ -162,19 +157,19 @@ def make(
162
157
eos_jobs = []
163
158
for index in range (len (deformation_matrices )):
164
159
md_job = self .md_maker .make (
165
- structure = deformed_structures [index ].final_structure ,
160
+ deformed_structures [index ].final_structure ,
166
161
prev_dir = None ,
167
162
)
168
163
relaxed_vol = len (working_outputs ["relax" ]["volume" ])
169
164
md_job .name = f"{ self .name } { md_job .name } { relaxed_vol + 1 } "
170
165
171
- working_outputs ["relax" ]["energies " ].append (md_job .output .output .energy )
166
+ working_outputs ["relax" ]["energy " ].append (md_job .output .output .energy )
172
167
working_outputs ["relax" ]["volume" ].append (md_job .output .structure .volume )
173
168
working_outputs ["relax" ]["stress" ].append (md_job .output .output .stress )
174
169
eos_jobs .append (md_job )
175
170
176
171
recursive = self .make (
177
- structure = structure ,
172
+ structure ,
178
173
prev_dir = None ,
179
174
working_outputs = working_outputs ,
180
175
)
@@ -262,14 +257,12 @@ def make(
262
257
structure = convergence_flow .output ["structure" ]
263
258
264
259
self .production_md_maker .name = self .name + " production run"
265
- production_run = self .production_md_maker .make (
266
- structure = structure , prev_dir = prev_dir
267
- )
260
+ production_run = self .production_md_maker .make (structure , prev_dir = prev_dir )
268
261
flow_jobs .append (production_run )
269
262
270
263
if self .quench_maker :
271
264
quench_flow = self .quench_maker .make (
272
- structure = production_run .output .structure ,
265
+ production_run .output .structure ,
273
266
prev_dir = production_run .output .dir_name ,
274
267
)
275
268
flow_jobs += [quench_flow ]
@@ -469,7 +462,7 @@ def make(self, structure: Structure, prev_dir: str | Path | None = None) -> Flow
469
462
)
470
463
if self .descent_method == "stepwise" :
471
464
md_job = self .call_md_maker (
472
- structure = structure ,
465
+ structure ,
473
466
temp = temp ,
474
467
prev_dir = prev_dir ,
475
468
)
@@ -478,13 +471,13 @@ def make(self, structure: Structure, prev_dir: str | Path | None = None) -> Flow
478
471
self .descent_method == "linear with hold"
479
472
): # TODO: Work in Progress; needs testing
480
473
md_job_linear = self .call_md_maker (
481
- structure = structure ,
474
+ structure ,
482
475
temp = [temp , temp - self .quench_temperature_step ], # type: ignore[arg-type]
483
476
prev_dir = prev_dir ,
484
477
)
485
478
486
479
md_job = self .call_md_maker (
487
- structure = md_job_linear .output .structure ,
480
+ md_job_linear .output .structure ,
488
481
temp = temp - self .quench_temperature_step ,
489
482
prev_dir = md_job_linear .output .dir_name ,
490
483
)
0 commit comments