Skip to content

Commit

Permalink
Linting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ladinesa committed Dec 12, 2024
1 parent dcfdc5b commit e09fbe9
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions electronicparsers/vasp/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,7 @@ def get_pseudopotential(
)
return pps

def get_tier(
self, raw_data: Union[str, None] = None, type='native'
) -> Union[str, None]:
def get_tier(self, type: str = None, raw_data: str = None) -> Union[str, None]:
"""Extract the tier from a string, and return it in a standardized format.
- `raw_data`: the string to extract the tier from
- `type`: the standardized output format, either `native` to VASP,
Expand Down Expand Up @@ -869,9 +867,10 @@ def get_basis_parameters(self):
basis['ICORELEVEL'] = parameters.get('ICORELEVEL', 0)
return basis

def get_tier(self, type='native', **kwargs) -> Union[str, None]:
def get_tier(self, type='native', raw_data=None) -> Union[str, None]:
return super().get_tier(
raw_data=self.parser.get('parameters', {}).get('PREC'), type=type
raw_data=raw_data or self.parser.get('parameters', {}).get('PREC'),
type=type,
)

def get_energies(self, n_calc, n_scf):
Expand Down Expand Up @@ -1456,9 +1455,10 @@ def get_basis_parameters(self):
basis[tag] = cutoff
return basis

def get_tier(self, type='native', **kwargs) -> Union[str, None]:
def get_tier(self, type='native', raw_data=None) -> Union[str, None]:
return super().get_tier(
raw_data=self._get_key_values(
raw_data=raw_data
or self._get_key_values(
'/modeling[0]/parameters/separator[@name="electronic"]/i[@name="PREC"]'
)['PREC'][0],
type=type,
Expand Down Expand Up @@ -1666,8 +1666,10 @@ def get_incar_out(self):
}
return self._incar.setdefault('incar_out', incar)

def get_tier(self, raw_data=None, type='native'):
return super().get_tier(raw_data=raw_data, type=type)
def get_tier(self, type='native', raw_data=None):
return super().get_tier(
raw_data=raw_data or self.incar.get('PREC', 'b').decode(), type=type
)

@property
def header(self):
Expand Down

0 comments on commit e09fbe9

Please sign in to comment.