Skip to content

Commit

Permalink
Merge pull request #246 from CompRhys/patch-1
Browse files Browse the repository at this point in the history
If eneg None comparison can fail if other criteria are met
  • Loading branch information
AntObi authored May 9, 2024
2 parents e67de89 + cecef9b commit 2e2c720
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions smact/screening.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ def eneg_states_test(ox_states: List[int], enegs: List[float]):
for (ox1, eneg1), (ox2, eneg2) in combinations(
list(zip(ox_states, enegs)), 2
):
if (ox1 > 0) and (ox2 < 0) and (eneg1 >= eneg2):
if eneg1 is None or eneg2 is None:
return False
elif (ox1 < 0) and (ox2 > 0) and (eneg1 <= eneg2):
elif (ox1 > 0) and (ox2 < 0) and (eneg1 >= eneg2):
return False
elif eneg1 is None or eneg2 is None:
elif (ox1 < 0) and (ox2 > 0) and (eneg1 <= eneg2):
return False
else:
return True
Expand Down

0 comments on commit 2e2c720

Please sign in to comment.