-
Notifications
You must be signed in to change notification settings - Fork 78
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
Decouple parmed from the foyer atomtyper #389
Decouple parmed from the foyer atomtyper #389
Conversation
4bda6a9
to
36d8e08
Compare
This PR is now complete for initial round of reviews. |
This pull request introduces 2 alerts when merging f969c13 into e80015c - view on LGTM.com new alerts:
|
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.
Reviewed in tandem with @umesh-timalsina and @daico007 . LGTM!
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.
LGTM!
foyer/topology_graph.py
Outdated
name=atom.name, | ||
index=atom.idx, | ||
atomic_number=atom.atomic_number, | ||
element=atom.element, |
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 don't think this is what you want here. The atom.element
attribute is actually the atomic number. The atom.element_name
attribute is the two-character element code.
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.
Agreed.
def __init__(self, index, name, atomic_number, element, bond_partners, **kwargs): | ||
self.index = index | ||
self.name = name | ||
self.atomic_number = atomic_number |
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.
What do we do for the atomic_number
of non-element atom types?
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.
For non_element
atom types, this attribute is not used.
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.
But I see your point. Will change this to be optional
1. Remove bond_partners information from AtomData class 2. Dynamically build bond_partners information for the node in TopologyGraph 3. Make element and atomic_number attributes optional in TopologyGraph
foyer/atomtyper.py
Outdated
if a.name in forcefield.non_element_types: | ||
system_elements.add(a.name) | ||
name = atom_data.name | ||
atomic_number = atom_data.atomic_number |
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.
This line is why I was asking about how non-element atom types handle atomic_number
.
Codecov Report
@@ Coverage Diff @@
## master #389 +/- ##
==========================================
+ Coverage 85.08% 85.42% +0.34%
==========================================
Files 15 16 +1
Lines 1448 1496 +48
==========================================
+ Hits 1232 1278 +46
- Misses 216 218 +2 |
…flag in test/utils.atomtype
This issue has been discussed at length in #386. Specifically this PR is intended to address #386 (comment) and with #382 underway. I think we can safely commit to removing third party packages for atomtyping engine from foyer.
Checklist:
atom_typer.py
smarts_graph.py
Based on the third point a utility class could look like the following: