@@ -347,22 +347,22 @@ def get_correction(self, entry) -> ufloat:
347
347
348
348
comp = entry .composition
349
349
rform = comp .reduced_formula
350
- cpdenergies = self .cpd_energies
350
+ cpd_energies = self .cpd_energies
351
351
352
352
# only correct GGA or GGA+U entries
353
353
if entry .parameters .get ("run_type" , None ) not in ["GGA" , "GGA+U" ]:
354
354
return ufloat (0.0 , 0.0 )
355
355
356
356
correction = ufloat (0.0 , 0.0 )
357
357
358
- if rform in cpdenergies :
358
+ if rform in cpd_energies :
359
359
if rform in ["H2" , "H2O" ]:
360
- corr = cpdenergies [rform ] * comp .num_atoms - entry .uncorrected_energy - entry .correction
360
+ corr = cpd_energies [rform ] * comp .num_atoms - entry .uncorrected_energy - entry .correction
361
361
err = self .cpd_errors [rform ] * comp .num_atoms
362
362
363
363
correction += ufloat (corr , err )
364
364
else :
365
- corr = cpdenergies [rform ] * comp .num_atoms
365
+ corr = cpd_energies [rform ] * comp .num_atoms
366
366
err = self .cpd_errors [rform ] * comp .num_atoms
367
367
368
368
correction += ufloat (corr , err )
@@ -491,17 +491,17 @@ def get_correction(self, entry) -> ufloat:
491
491
if entry .parameters .get ("run_type" , None ) not in ["GGA" , "GGA+U" ]:
492
492
return ufloat (0.0 , 0.0 )
493
493
494
- ucorr = self .u_corrections .get (most_electroneg , {})
495
- usettings = self .u_settings .get (most_electroneg , {})
496
- uerrors = self .u_errors .get (most_electroneg , defaultdict (float ))
494
+ u_corr = self .u_corrections .get (most_electroneg , {})
495
+ u_settings = self .u_settings .get (most_electroneg , {})
496
+ u_errors = self .u_errors .get (most_electroneg , defaultdict (float ))
497
497
498
498
for el in comp .elements :
499
499
sym = el .symbol
500
500
# Check for bad U values
501
- if calc_u .get (sym , 0 ) != usettings .get (sym , 0 ):
501
+ if calc_u .get (sym , 0 ) != u_settings .get (sym , 0 ):
502
502
raise CompatibilityError (f"Invalid U value of { calc_u .get (sym , 0 )} on { sym } " )
503
- if sym in ucorr :
504
- correction += ufloat (ucorr [sym ], uerrors [sym ]) * comp [el ]
503
+ if sym in u_corr :
504
+ correction += ufloat (u_corr [sym ], u_errors [sym ]) * comp [el ]
505
505
506
506
return correction
507
507
@@ -670,14 +670,7 @@ def get_adjustments(self, entry: AnyComputedEntry) -> list[EnergyAdjustment]:
670
670
uncertainty = np .nan
671
671
else :
672
672
uncertainty = uncertainties [k ]
673
- adjustment_list .append (
674
- ConstantEnergyAdjustment (
675
- v ,
676
- uncertainty = uncertainty ,
677
- name = k ,
678
- cls = self .as_dict (),
679
- )
680
- )
673
+ adjustment_list .append (ConstantEnergyAdjustment (v , uncertainty = uncertainty , name = k , cls = self .as_dict ()))
681
674
682
675
return adjustment_list
683
676
0 commit comments