-
Notifications
You must be signed in to change notification settings - Fork 21
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
Split off a base parser from read_smiles #49
base: master
Are you sure you want to change the base?
Conversation
Also teaches the tests to ignore these "operational" node and edge attributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! I think we're getting more and more modular, which is really a big benefit.
for node in mol: | ||
mol.nodes[node].update(parse_atom(mol.nodes[node]['_atom_str'])) | ||
for idx, jdx, attrs in ring_bonds: | ||
if mol.nodes[idx].get('rs_isomer'): | ||
mol.nodes[idx]['rs_isomer'][1].append(jdx) | ||
if mol.nodes[jdx].get('rs_isomer'): | ||
mol.nodes[jdx]['rs_isomer'][1].append(idx) | ||
for edge in mol.edges: | ||
if mol.edges[edge]['_bond_str']: | ||
order = bond_to_order[mol.edges[edge]['_bond_str']] | ||
if not order and not zero_order_bonds: | ||
mol.remove_edge(*edge) | ||
continue | ||
mol.edges[edge]['order'] = order | ||
elif mol.nodes[edge[0]].get('aromatic') and mol.nodes[edge[1]].get('aromatic'): | ||
mol.edges[edge]['order'] = default_aromatic_bond | ||
else: | ||
mol.edges[edge]['order'] = default_bond | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If one were to make a bold suggestion: These could be put into functions as well such that one can mix and match a read_smiles interpreter function. Maybe even decorators? Something like an abstract interpret_graph
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea, but I need to think on it a little bit. How to organise the code and such. I suggest leaving that for a next PR
No description provided.