Skip to content

Commit

Permalink
Support tuples for random_crystal
Browse files Browse the repository at this point in the history
Bugfix for _check_consistency for tuples, otherwise causes the following error: TypeError: int() argument must be a string, a bytes-like object or a real number, not 'tuple'
  • Loading branch information
andaero authored Jan 8, 2025
1 parent 8dc7dfe commit dbdcf73
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pyxtal/crystal.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ def _check_consistency(self, site, numIon):
if isinstance(s, dict):
for key in s:
num += int(key[:-1])
elif isinstance(s, tuple):
(letter, x, y, z) = s
num += int(letter[:-1])
else:
num += int(s[:-1])
if numIon == num:
Expand Down

0 comments on commit dbdcf73

Please sign in to comment.