@@ -243,16 +243,30 @@ def generate_doc(self, dir_name, qcinput_files, qcoutput_files, multirun):
243
243
else :
244
244
if len (d ["calcs_reversed" ]) > 1 :
245
245
first_calc = d ["calcs_reversed" ][- 1 ]["input" ]["rem" ]["job_type" ]
246
- second_calc = d ["calcs_reversed" ][- 2 ]["input" ]["rem" ]["job_type" ]
247
- if first_calc in ["freq" , "frequency" ] and second_calc in ["opt" , "optimization" , "ts" ]:
248
- d ["output" ]["optimized_molecule" ] = d_calc_final ["initial_molecule" ]
249
- d ["output" ]["final_energy" ] = d ["calcs_reversed" ][1 ]["final_energy" ]
246
+ second_calc = d ["calcs_reversed" ][- 2 ]["input" ]["rem" ][
247
+ "job_type"
248
+ ]
249
+ if first_calc in ["freq" , "frequency" ] and second_calc in [
250
+ "opt" ,
251
+ "optimization" ,
252
+ "ts" ,
253
+ ]:
254
+ d ["output" ]["optimized_molecule" ] = d_calc_final [
255
+ "initial_molecule"
256
+ ]
257
+ d ["output" ]["final_energy" ] = d ["calcs_reversed" ][1 ][
258
+ "final_energy"
259
+ ]
250
260
251
261
if d ["output" ]["job_type" ] == "pes_scan" :
252
262
d ["output" ]["scan_energies" ] = d_calc_final .get ("scan_energies" )
253
263
d ["input" ]["scan_variables" ] = d_calc_final .get ("scan_variables" )
254
- d ["output" ]["scan_geometries" ] = d_calc_final .get ("optimized_geometries" )
255
- d ["output" ]["scan_molecules" ] = d_calc_final .get ("molecules_from_optimized_geometries" )
264
+ d ["output" ]["scan_geometries" ] = d_calc_final .get (
265
+ "optimized_geometries"
266
+ )
267
+ d ["output" ]["scan_molecules" ] = d_calc_final .get (
268
+ "molecules_from_optimized_geometries"
269
+ )
256
270
257
271
if d ["output" ]["job_type" ] == "force" :
258
272
d ["output" ]["gradients" ] = d_calc_final ["gradients" ][0 ]
@@ -267,8 +281,8 @@ def generate_doc(self, dir_name, qcinput_files, qcoutput_files, multirun):
267
281
for calc in calcs :
268
282
job_type = calc ["input" ]["rem" ]["job_type" ]
269
283
if job_type in ["opt" , "optimization" , "ts" ]:
270
- for ii ,geom in enumerate (calc ["geometries" ]):
271
- site_properties = {"Mulliken" :calc ["Mulliken" ][ii ]}
284
+ for ii , geom in enumerate (calc ["geometries" ]):
285
+ site_properties = {"Mulliken" : calc ["Mulliken" ][ii ]}
272
286
if "RESP" in calc :
273
287
site_properties ["RESP" ] = calc ["RESP" ][ii ]
274
288
mol = Molecule (
@@ -326,36 +340,59 @@ def generate_doc(self, dir_name, qcinput_files, qcoutput_files, multirun):
326
340
327
341
d ["state" ] = "successful" if d_calc_final ["completion" ] else "unsuccessful"
328
342
if "special_run_type" in d :
329
- if d ["special_run_type" ] in ["frequency_flattener" , "ts_frequency_flattener" ]:
343
+ if d ["special_run_type" ] in [
344
+ "frequency_flattener" ,
345
+ "ts_frequency_flattener" ,
346
+ ]:
330
347
if d ["state" ] == "successful" :
331
348
orig_num_neg_freq = None
332
349
for calc in d ["calcs_reversed" ][::- 1 ]:
333
350
if "frequencies" in calc :
334
- orig_num_neg_freq = sum (1 for freq in calc ["frequencies" ] if freq < 0 )
351
+ orig_num_neg_freq = sum (
352
+ 1 for freq in calc ["frequencies" ] if freq < 0
353
+ )
335
354
break
336
355
orig_energy = None
337
356
for calc in d ["calcs_reversed" ][::- 1 ]:
338
357
if "final_energy" in calc :
339
358
if calc ["final_energy" ] is not None :
340
359
orig_energy = calc ["final_energy" ]
341
360
break
342
- final_num_neg_freq = sum (1 for freq in d_calc_final ["frequencies" ] if freq < 0 )
361
+ final_num_neg_freq = sum (
362
+ 1 for freq in d_calc_final ["frequencies" ] if freq < 0
363
+ )
343
364
final_energy = d ["calcs_reversed" ][1 ]["final_energy" ]
344
365
if orig_num_neg_freq is None :
345
366
d ["num_frequencies_flattened" ] = 0
346
367
else :
347
- d ["num_frequencies_flattened" ] = orig_num_neg_freq - final_num_neg_freq
368
+ d ["num_frequencies_flattened" ] = (
369
+ orig_num_neg_freq - final_num_neg_freq
370
+ )
348
371
349
372
if d ["special_run_type" ] == "frequency_flattener" :
350
- if final_num_neg_freq > 0 : # If a negative frequency remains,
373
+ if (
374
+ final_num_neg_freq > 0
375
+ ): # If a negative frequency remains,
351
376
# and it's too large to ignore,
352
- if final_num_neg_freq > 1 or abs (d ["output" ]["frequencies" ][0 ]) >= 15.0 :
353
- d ["state" ] = "unsuccessful" # then the flattening was unsuccessful
377
+ if (
378
+ final_num_neg_freq > 1
379
+ or abs (d ["output" ]["frequencies" ][0 ]) >= 15.0
380
+ ):
381
+ d [
382
+ "state"
383
+ ] = "unsuccessful" # then the flattening was unsuccessful
354
384
else :
355
- if final_num_neg_freq > 1 : # If a negative frequency remains,
385
+ if (
386
+ final_num_neg_freq > 1
387
+ ): # If a negative frequency remains,
356
388
# and it's too large to ignore,
357
- if final_num_neg_freq > 2 or abs (d ["output" ]["frequencies" ][1 ]) >= 15.0 :
358
- d ["state" ] = "unsuccessful" # then the flattening was unsuccessful
389
+ if (
390
+ final_num_neg_freq > 2
391
+ or abs (d ["output" ]["frequencies" ][1 ]) >= 15.0
392
+ ):
393
+ d [
394
+ "state"
395
+ ] = "unsuccessful" # then the flattening was unsuccessful
359
396
if final_energy > orig_energy :
360
397
d ["warnings" ]["energy_increased" ] = True
361
398
0 commit comments