@@ -198,12 +198,14 @@ def run_task(self, fw_spec):
198
198
shutil .rmtree (os .path .join (calc_dir , "scratch" ))
199
199
200
200
# Check for additional keys to set based on the fw_spec
201
+ logger .info ("Updating fw_spec_field" )
201
202
if self .get ("fw_spec_field" ):
202
203
task_doc .update (
203
204
{self .get ("fw_spec_field" ): fw_spec .get (self .get ("fw_spec_field" ))}
204
205
)
205
206
206
207
# Update fw_spec with final/optimized structure
208
+ logger .info ("Updating charges in spec" )
207
209
update_spec = {}
208
210
if task_doc .get ("output" ).get ("optimized_molecule" ):
209
211
update_spec ["prev_calc_molecule" ] = task_doc ["output" ]["optimized_molecule" ]
@@ -214,13 +216,15 @@ def run_task(self, fw_spec):
214
216
update_spec ["prev_calc_esp" ] = task_doc ["output" ]["ESP" ]
215
217
216
218
# get the database connection
219
+ logger .info ("Get database connection" )
217
220
db_file = env_chk (self .get ("db_file" ), fw_spec )
218
221
219
222
# db insertion or taskdoc dump
220
223
if not db_file :
221
224
with open (os .path .join (calc_dir , "task.json" ), "w" ) as f :
222
225
f .write (json .dumps (task_doc , default = DATETIME_HANDLER ))
223
226
else :
227
+ logger .info ("Connecting to QChemCalcDb" )
224
228
mmdb = QChemCalcDb .from_db_file (db_file , admin = True )
225
229
t_id = mmdb .insert (task_doc )
226
230
logger .info (f"Finished parsing with task_id: { t_id } " )
@@ -308,12 +312,26 @@ def run_task(self, fw_spec):
308
312
task_doc_clean ["orig" ]["molecule" ]["spin_multiplicity" ] = 1
309
313
task_doc_clean ["output" ]["initial_molecule" ]["charge" ] = 1
310
314
task_doc_clean ["output" ]["initial_molecule" ]["spin_multiplicity" ] = 1
311
- task_doc_clean ["output" ]["initial_molecule" ]["sites" ] = [{'name' : 'H' , 'species' : [{'element' : 'H' , 'occu' : 1 }], 'xyz' : [0.0 , 0.0 , 0.0 ], 'properties' : {}}]
315
+ task_doc_clean ["output" ]["initial_molecule" ]["sites" ] = [
316
+ {
317
+ "name" : "H" ,
318
+ "species" : [{"element" : "H" , "occu" : 1 }],
319
+ "xyz" : [0.0 , 0.0 , 0.0 ],
320
+ "properties" : {},
321
+ }
322
+ ]
312
323
task_doc_clean ["output" ]["mulliken" ] = [+ 1.000000 ]
313
324
task_doc_clean ["output" ]["resp" ] = [+ 1.000000 ]
314
325
task_doc_clean ["output" ]["optimized_molecule" ]["charge" ] = 1
315
326
task_doc_clean ["output" ]["optimized_molecule" ]["spin_multiplicity" ] = 1
316
- task_doc_clean ["output" ]["optimized_molecule" ]["sites" ] = [{'name' : 'H' , 'species' : [{'element' : 'H' , 'occu' : 1 }], 'xyz' : [0.0 , 0.0 , 0.0 ], 'properties' : {}}]
327
+ task_doc_clean ["output" ]["optimized_molecule" ]["sites" ] = [
328
+ {
329
+ "name" : "H" ,
330
+ "species" : [{"element" : "H" , "occu" : 1 }],
331
+ "xyz" : [0.0 , 0.0 , 0.0 ],
332
+ "properties" : {},
333
+ }
334
+ ]
317
335
task_doc_clean ["output" ]["final_energy" ] = (
318
336
task_doc_2 ["output" ]["final_energy" ] - task_doc_1 ["output" ]["final_energy" ]
319
337
)
0 commit comments