-
Notifications
You must be signed in to change notification settings - Fork 1
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
OpenBabelReader and Tests #16
Conversation
Hello @lunamorrow! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-08-06 01:37:45 UTC |
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.
Could you also add a test for mols without any coordinates making sure that they are all nan
?
Great work! Loving the progress :) |
@exs-cbouy It looks like null position in OpenBabel is stored as a (0, 0, 0) vector. I don't want to report that as a position when its not, so I'm thinking that I can check that if the whole molecules position vectors are (0, 0, 0) that there is no position info and to set it to nan (or not even set it) and issue a warning. That will prevent molecules with an atom at a valid (0, 0, 0) position from being flagged. Thoughts? Edit: I've got it, just had to change my conditions for empty coordinates. Pushing changes now. |
mda_openbabel_converter/OpenBabel.py
Outdated
coordinates = np.array([ | ||
[(coords := atom.GetVector()).GetX(), | ||
coords.GetY(), | ||
coords.GetZ()] for atom in OBMolAtomIter(filename)], | ||
dtype=np.float32) |
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.
Could potentially be as simple as (haven't tried it though):
coordinates = np.array([ | |
[(coords := atom.GetVector()).GetX(), | |
coords.GetY(), | |
coords.GetZ()] for atom in OBMolAtomIter(filename)], | |
dtype=np.float32) | |
coordinates = np.array(filename.GetConformers(), dtype=np.float32) |
Also we overlooked that the current implementation is missing one dimension for the number of conformers
…bmol's with more than 1 conformer as they cannnot be supported currently
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
In reference to #5. This is a draft of the code with the initial functionality starting to be roughly scaffolded out for feedback.
PR Checklist