Skip to content

Commit

Permalink
Add safeguard to operators
Browse files Browse the repository at this point in the history
  • Loading branch information
ndaelman committed Oct 16, 2024
1 parent 9b71e4a commit 49bfd97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/nomad_parser_vasp/parsers/xml_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@

class RunXMLParser(XMLParser):
@staticmethod
def mix_alpha(mix, cond):
def mix_alpha(mix: float, cond: bool) -> float:
return mix if cond else 0

@staticmethod
def get_eigenvalues(array):
return np.array(array).T[1]
def get_eigenvalues(array: list) -> np.ndarray:
return np.array(array).T[1] if array is not None else np.array([])


class VasprunXMLParser:
Expand Down

0 comments on commit 49bfd97

Please sign in to comment.