Skip to content

Commit

Permalink
handle number only case
Browse files Browse the repository at this point in the history
  • Loading branch information
pillose committed Jun 14, 2023
1 parent 342d9a8 commit 8069406
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion package/MDAnalysis/topology/guessers.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ def guess_atom_element(atomname):
# strip symbols and numbers
no_symbols = re.sub(SYMBOLS, '', atomname)
no_numbers = re.split(NUMBERS, no_symbols)
name = list(filter(None, no_numbers))[0]

if (list(filter(None, no_numbers)) == []):
name = ''
else:
name = list(filter(None, no_numbers))[0]

# just in case
if name in tables.atomelements:
Expand Down

0 comments on commit 8069406

Please sign in to comment.