Skip to content

Commit

Permalink
ValueError Modifications in VEC for
Browse files Browse the repository at this point in the history
invalid elements ie Lr0
  • Loading branch information
ryannduma committed Aug 22, 2024
1 parent f8b7a8a commit 55ba0db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions smact/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,7 @@ def get_element_valence(element: str) -> int:
total_valence += stoich * valence
total_stoich += stoich
except TypeError:
print(
f"Calculation failed: No valence information for element {element}"
)
raise ValueError(f"No valence information for element {element}")

if total_stoich == 0:
return 0.0
Expand Down
2 changes: 1 addition & 1 deletion smact/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_valence_electron_count(self):
with self.assertRaises(ValueError):
valence_electron_count("Xx2O3") # Xx is not a real element

with self.assertRaises(TypeError):
with self.assertRaises(ValueError):
valence_electron_count("LrO")

# ---------------- BUILDER ----------------
Expand Down

0 comments on commit 55ba0db

Please sign in to comment.