Skip to content

Commit

Permalink
add patch for getting non-element site
Browse files Browse the repository at this point in the history
  • Loading branch information
daico007 committed May 16, 2024
1 parent 47a2ec2 commit d667404
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gmso/formats/top.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import numpy as np
import unyt as u
from lark import UnexpectedCharacters

from gmso.core.dihedral import Dihedral
from gmso.core.element import element_by_atom_type
Expand Down Expand Up @@ -421,7 +422,7 @@ def _lookup_atomic_number(atom_type):
try:
element = element_by_atom_type(atom_type)
return element.atomic_number
except GMSOError:
except (GMSOError, UnexpectedCharacters):

Check warning on line 425 in gmso/formats/top.py

View check run for this annotation

Codecov / codecov/patch

gmso/formats/top.py#L425

Added line #L425 was not covered by tests
return 0


Expand All @@ -430,7 +431,7 @@ def _lookup_element_symbol(atom_type):
try:
element = element_by_atom_type(atom_type)
return element.symbol
except GMSOError:
except (GMSOError, UnexpectedCharacters):

Check warning on line 434 in gmso/formats/top.py

View check run for this annotation

Codecov / codecov/patch

gmso/formats/top.py#L434

Added line #L434 was not covered by tests
return "X"


Expand Down

0 comments on commit d667404

Please sign in to comment.