@@ -65,12 +65,12 @@ def _check_incar(
65
65
task_type : TaskType
66
66
Task type of the calculation.
67
67
fft_grid_tolerance: float
68
- Directly calculating the FFT grid defaults from VASP is actually impossible
69
- without information on how VASP was compiled. This is because the FFT
70
- params generated depend on whatever fft library used. So instead, we do our
71
- best to calculate the FFT grid defaults and then lower it artificially by
72
- `fft_grid_tolerance`. So if the user’ s FFT grid parameters are greater than
73
- (fft_grid_tolerance x slightly-off defaults), the FFT params are marked
68
+ Directly calculating the FFT grid defaults from VASP is actually impossible
69
+ without information on how VASP was compiled. This is because the FFT
70
+ params generated depend on whatever fft library used. So instead, we do our
71
+ best to calculate the FFT grid defaults and then lower it artificially by
72
+ `fft_grid_tolerance`. So if the user' s FFT grid parameters are greater than
73
+ (fft_grid_tolerance x slightly-off defaults), the FFT params are marked
74
74
as valid.
75
75
"""
76
76
@@ -140,9 +140,6 @@ class UpdateParameterValues:
140
140
sensible default values.
141
141
"""
142
142
143
- # MK: unclear, expand
144
- # AK: review
145
-
146
143
_default_schema : dict [str , Any ] = {
147
144
"value" : None ,
148
145
"tag" : None ,
@@ -183,7 +180,9 @@ def __init__(
183
180
task_type : TaskType
184
181
Task type of the calculation.
185
182
fft_grid_tolerance: float
186
- TODO MK : what was the purpose of this originally?
183
+ See docstr for `_check_incar`. The FFT grid generation has been udpated frequently
184
+ in VASP, and determining the grid density with absolute certainty is not possible.
185
+ This tolerance allows for "reasonable" discrepancies from the ideal FFT grid density.
187
186
"""
188
187
189
188
self .parameters = copy .deepcopy (parameters )
@@ -414,22 +413,18 @@ def update_hybrid_params(self) -> None:
414
413
self .valid_values ["LHFCALC" ] = self .input_set .incar .get ("LHFCALC" , self .defaults ["LHFCALC" ]["value" ])
415
414
416
415
if self .valid_values ["LHFCALC" ]:
417
- self .defaults ["AEXX" ] = 0.25
418
- self .parameters ["AEXX" ] = self .parameters .get ("AEXX" , self .defaults ["AEXX" ])
419
- self .defaults ["AGGAC" ] = 0.0
416
+ self .defaults ["AEXX" ][ "value" ] = 0.25
417
+ self .parameters ["AEXX" ] = self .parameters .get ("AEXX" , self .defaults ["AEXX" ][ "value" ] )
418
+ self .defaults ["AGGAC" ][ "value" ] = 0.0
420
419
for key in ("AGGAX" , "ALDAX" , "AMGGAX" ):
421
- self .defaults [key ] = 1.0 - self .parameters ["AEXX" ]
420
+ self .defaults [key ][ "value" ] = 1.0 - self .parameters ["AEXX" ]
422
421
423
- if self .parameters .get ("AEXX" , self .defaults ["AEXX" ]) == 1.0 :
424
- self .defaults ["ALDAC" ] = 0.0
425
- self .defaults ["AMGGAC" ] = 0.0
422
+ if self .parameters .get ("AEXX" , self .defaults ["AEXX" ][ "value" ] ) == 1.0 :
423
+ self .defaults ["ALDAC" ][ "value" ] = 0.0
424
+ self .defaults ["AMGGAC" ][ "value" ] = 0.0
426
425
427
426
for key in self .categories ["hybrid" ]:
428
- self .defaults [key ].update (
429
- {
430
- "operation" : "==" if isinstance (self .defaults [key ]["value" ], bool ) else "approx" ,
431
- }
432
- )
427
+ self .defaults [key ]["operation" ] = "==" if isinstance (self .defaults [key ]["value" ], bool ) else "approx"
433
428
434
429
def update_fft_params (self ) -> None :
435
430
"""Update parameters related to the FFT grid."""
@@ -756,9 +751,6 @@ class BasicValidator:
756
751
check if a Sequence contains an element
757
752
"""
758
753
759
- # MK: unclear. Is the above docstring accurate? It seems like all checks use this, right?
760
- # AK: review
761
-
762
754
# avoiding dunder methods because these raise too many NotImplemented's
763
755
operations : set [str | None ] = {"==" , ">" , ">=" , "<" , "<=" , "in" , "approx" , "auto fail" , None }
764
756
0 commit comments