diff --git a/pyiron_atomistics/sphinx/base.py b/pyiron_atomistics/sphinx/base.py index 48ed204a1..ea6570763 100644 --- a/pyiron_atomistics/sphinx/base.py +++ b/pyiron_atomistics/sphinx/base.py @@ -1076,7 +1076,9 @@ def set_empty_states(self, n_empty_states=None): self.input["EmptyStates"] = "auto" else: if n_empty_states < 0: - raise ValueError("Number of empty states must be greater than 0") + raise ValueError( + f"Number of empty states must be a positive integer or zero, not {n_empty_states}!" + ) self.input["EmptyStates"] = n_empty_states self.input.sphinx.PAWHamiltonian.nEmptyStates = self.input["EmptyStates"] diff --git a/pyiron_atomistics/vasp/base.py b/pyiron_atomistics/vasp/base.py index f093069fa..d695fbd24 100644 --- a/pyiron_atomistics/vasp/base.py +++ b/pyiron_atomistics/vasp/base.py @@ -1333,6 +1333,10 @@ def set_empty_states(self, n_empty_states=None): """ n_elect = self.get_nelect() if n_empty_states is not None: + if n_empty_states < 0: + raise ValueError( + f"Number of empty states must be a positive integer or zero, not {n_empty_states}!" + ) self.input.incar["NBANDS"] = int(round(n_elect / 2)) + int(n_empty_states) def get_nelect(self):