@@ -38,10 +38,11 @@ def _check_incar(
38
38
note that all changes to `reasons` and `warnings` can be done in-place
39
39
(and hence there is no need to return those variables after every function call).
40
40
Any cases where that is not done is just to make the code more readable.
41
- I didn't think that would be necessary here.
41
+ # MK: A better description of this class should be included above the current docstring.
42
+ # I think writing clearly how the whole function operates, in chronological order, would be best.
42
43
"""
43
44
44
- working_params = GetParams (
45
+ working_params = GetParams ( # MK: unclear
45
46
parameters = parameters ,
46
47
defaults = _vasp_defaults ,
47
48
input_set = valid_input_set ,
@@ -75,7 +76,7 @@ def _check_incar(
75
76
76
77
77
78
class GetParams :
78
- """Initialize current params and update defaults as needed."""
79
+ """Initialize current params and update defaults as needed.""" # MK: unclear, expand
79
80
80
81
_default_defaults = {
81
82
"value" : None ,
@@ -101,7 +102,9 @@ def __init__(
101
102
vasp_version : Sequence [int ],
102
103
task_type ,
103
104
fft_grid_tolerance : float ,
104
- ) -> None :
105
+ ) -> None :
106
+ # MK: unclear. I think a thorough docstring describing how this class init
107
+ # operates, in chronological order, would be best.
105
108
self .parameters = copy .deepcopy (parameters )
106
109
self .defaults = copy .deepcopy (defaults )
107
110
self .input_set = input_set
@@ -630,6 +633,7 @@ def update_ionic_params(self):
630
633
631
634
class BasicValidator :
632
635
"""Lightweight validator class to handle majority of parameter checking."""
636
+ # MK: unclear. Is the above docstring accurate? It seems like all checks use this, right?
633
637
634
638
# avoiding dunder methods because these raise too many NotImplemented's
635
639
operations : tuple [str , ...] = ("==" , ">" , ">=" , "<" , "<=" , "in" , "approx" , "auto fail" )
@@ -670,7 +674,8 @@ def _check_parameter(
670
674
671
675
# Allow for printing different tag than the one used to access values
672
676
# For example, the user sets ENCUT via INCAR, but the value of ENCUT is stored
673
- # by VASP as ENMAX
677
+ # by VASP as ENMAX
678
+ # MK: is the above comment in the best place?
674
679
675
680
append_comments = append_comments or ""
676
681
@@ -714,7 +719,7 @@ def check_parameter(
714
719
current_values = [current_values ]
715
720
reference_values = [reference_values ]
716
721
717
- if not all (operation in self .operations for operation in operations ):
722
+ if not all (operation in self .operations for operation in operations ): # MK: unclear
718
723
# Do not validate
719
724
return
720
725
0 commit comments