Skip to content

Commit

Permalink
Fix case sensitivity
Browse files Browse the repository at this point in the history
  • Loading branch information
MRHemmati committed Dec 21, 2023
1 parent b339413 commit ee336f0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions masci_tools/io/kkr_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
}

# prevent kkrparams to add brackets around these keywords automatically
# case insensitive (converted to lower case)
__forbid_brackets__ = ['use_input_alat']
# case insensitive (converted to upper case)
__forbid_brackets__ = ['USE_INPUT_ALAT']


class kkrparams:
Expand Down Expand Up @@ -1219,6 +1219,9 @@ def _create_keywords_dict(self, **kwargs):
# workaround to fix inconsistency of XC input between host and impurity code
if self.__params_type == 'kkrimp' and key2 == 'XC':
kwargs[key] = self.change_XC_val_kkrimp(val)
# enforce upper case for key2
key2 = key2.upper()

default_keywords[key2][0] = val

return default_keywords
Expand Down Expand Up @@ -2100,7 +2103,7 @@ def _add_brackets_to_key(self, key, key_dict):
return key

key2 = key
if key not in key_dict and key.lower() not in __forbid_brackets__:
if key.upper() not in key_dict and key.upper() not in __forbid_brackets__:
key2 = '<' + key + '>'

return key2

0 comments on commit ee336f0

Please sign in to comment.