Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find_data in lark #341

Merged
merged 2 commits into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion foyer/smarts_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(self, smarts_string, parser=None, name=None, overrides=None,

def _add_nodes(self):
"""Add all atoms in the SMARTS string as nodes in the graph."""
for n, atom in enumerate(self.ast.find_data('atom')):
for n, atom in enumerate([x for x in self.ast.iter_subtrees_topdown() if x.data == 'atom']):
self.add_node(n, atom=atom)
self._atom_indices[id(atom)] = n

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openmm
mbuild
parmed
networkx >=2.0
lark-parser <=0.8.5
lark-parser
requests
lxml
pytest >=3.0
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openmm
parmed
networkx >=2.0
lark-parser <=0.8.5
lark-parser
requests
lxml