Skip to content

Commit

Permalink
Restore ValueError
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrv committed Aug 29, 2024
1 parent cf8927d commit 3451dd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
7 changes: 2 additions & 5 deletions pyiron_atomistics/sphinx/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,11 +1075,8 @@ def set_empty_states(self, n_empty_states=None):
# will be converted later; see load_default_groups
self.input["EmptyStates"] = "auto"
else:
if n_empty_states < 0:
self.logger.warning(
f"Number of empty states must be a positive integer, not {n_empty_states}! Setting to 1."
)
n_empty_states = 1
if n_empty_states <= 0:
raise ValueError(f"Number of empty states must be a positive integer, not {n_empty_states}!")
self.input["EmptyStates"] = n_empty_states
self.input.sphinx.PAWHamiltonian.nEmptyStates = self.input["EmptyStates"]

Expand Down
5 changes: 1 addition & 4 deletions pyiron_atomistics/vasp/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,10 +1334,7 @@ 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:
self.logger.warning(
f"Number of empty states must be a positive integer, not {n_empty_states}! Setting to 1."
)
n_empty_states = 1
raise ValueError(f"Number of empty states must be a positive integer, not {n_empty_states}!")
self.input.incar["NBANDS"] = int(round(n_elect / 2)) + int(n_empty_states)

def get_nelect(self):
Expand Down

0 comments on commit 3451dd1

Please sign in to comment.