-
Notifications
You must be signed in to change notification settings - Fork 94
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
Issue 1998 #2018
Issue 1998 #2018
Conversation
jaclark5
commented
Feb 10, 2025
•
edited
Loading
edited
- Tag issue being addressed. Resolves Document that Molecule.from_dict accepts a list of lists but not a numpy array #1998
- [NA] Add tests
- Update docstrings/documentation, if applicable
- [NA] Lint codebase
- Update changelog
for more information, see https://pre-commit.ci
In the doctoring for In my description of the |
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 % two tiny errors I found (annotating the units as float
) which I believe should be updated before merge.
I found a lot of other details that either are out of scope here and don't need fixing or can go either way at your discretion, a.k.a. non-blocking and don't require a re-review unless you wish for one
openff/toolkit/topology/molecule.py
Outdated
- **properties** (dict): Outputs from chosen a chosen toolkit: | ||
|
||
- **atom_map** (dict): Dictionary of atom index (as in ``atoms`` entry) and the mapped index relevant | ||
to a mapped canonical smiles string | ||
- **\*\*kwargs**: Other toolkit dependent outputs | ||
|
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 dict is empty by default, i.e. not including the atom map, so I'd prefer either not listing it here or being more general about what can go in. IIRC it's a dumping ground for just about anything that can be represented in memory
In [10]: Molecule.from_smiles("CCO").to_dict()['properties']
Out[10]: {}
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.
So I made a comment on the PR wondering if I should be more specific since I can see the functions used by the toolkit for the other kwargs. I'll take that as a no :)
I can see that if this is a dumping ground for metadata, it shouldn't be specified, but in the case of atom_map, I might be uploading a molecule with a mapped CMILES and a geometry I got elsewhere... in that case I might need to figure out how to do this manually, which is why I thought it would be useful to explain.
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.
In the doctoring of to_smiles
it is encouraged for a user to supply an atom_map
for this purpose, but doesn't define its format. I think it's important to define it, and I believe this is the place to do it.
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.
Ah totally my mistake, I didn't read the second half of that comment
IMHO
- I have a preference for whatever gets this over the finish line with the lowest friction (I think the original objective of structure of
Molecule
-generated dictionaries is more than met) - The added docs/examples you're considering adding are valuable but may be better for different portions of the docs than the docstrings of some serialization methods. I know CMILES is covered in the molecule cookbook but I forget the details
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 see that it is "verbally" explained in from_smiles
I can remove this if you want, or you can save me the commit.
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.
Either is fine with me, tiebreaker going to "do nothing because that's quicker"
(I tagged the unit string as the only blocker, everything else is up to you)