Skip to content

Commit

Permalink
Add warning for removing undefined atomtype
Browse files Browse the repository at this point in the history
  • Loading branch information
rmatsum836 committed Oct 9, 2019
1 parent e0b41ba commit 1365fd8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions foyer/xml_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from lxml import etree as ET
from foyer.smarts_graph import SMARTSGraph
import networkx as nx
import warnings

import numpy as np

Expand Down Expand Up @@ -147,6 +148,9 @@ def _update_defs(atomtypes, nonbonded, forcefield):
for extra in extra_types:
for i, definition in enumerate(def_list):
if extra in definition:
warnings.warn('Removing undefined atom type `{}`'
' from SMARTS string `{}`'.format(
extra, definition))
extra_edit = '%' + extra
extra_index = definition.find(extra_edit)
if definition[extra_index-1] == ';':
Expand Down

0 comments on commit 1365fd8

Please sign in to comment.