RDKitReader and RDKitParser#2707
RDKitReader and RDKitParser#2707richardjgowers merged 43 commits intoMDAnalysis:developfrom cbouy:develop
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2707 +/- ##
===========================================
+ Coverage 91.08% 91.11% +0.03%
===========================================
Files 177 179 +2
Lines 23655 23833 +178
Branches 3122 3143 +21
===========================================
+ Hits 21545 21716 +171
- Misses 1490 1496 +6
- Partials 620 621 +1
Continue to review full report at Codecov.
|
|
Unrelated, but I wonder why Azure pipelines is not showing up in CI. |
|
/azp run |
|
No pipelines are associated with this pull request. |
richardjgowers
left a comment
There was a problem hiding this comment.
@cbouy this is looking like a good start!
|
Can I add an SDF file in the test data to check that it's read correctly as well ? |
Please do! The more tests the better :) |
|
Yup a small one but with corner cases preferably
…On Wed, Jun 3, 2020 at 18:38, Cédric Bouysset ***@***.***> wrote:
Can I add an SDF file in the test data to check that it's read correctly
as well ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2707 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGSGBYYX3SUGEHCBT54BDLRU2DBTANCNFSM4NQAXTLA>
.
|
|
Looks like there are a few more formats that RDKit supports but not MDA:
But I guess just SDF is enough. I'll try to find a file with charges, stereochemistry, custom data and whatnot... |
Note here, to save on space, we could probably store things in gzip format and feed rdkit with file-like objects. |
|
Is the |
I believe it's the partial charges of each atom in electron charge units. |
| def mol2_mol(): | ||
| return Chem.MolFromMol2File(mol2_molecule, removeHs=False) | ||
|
|
||
| def smiles_mol(): | ||
| mol = Chem.MolFromSmiles("CCO") | ||
| mol = Chem.AddHs(mol) | ||
| cids = AllChem.EmbedMultipleConfs(mol, numConfs=3) | ||
| return mol | ||
|
|
||
| class TestRDKitReader(object): | ||
| @pytest.mark.parametrize("rdmol, n_frames", [ | ||
| (mol2_mol(), 1), | ||
| (smiles_mol(), 3), | ||
| ]) |
There was a problem hiding this comment.
Not sure if this is a very pythonic way of testing things, but since parametrize won't take fixtures as args I decided to do it this way
There was a problem hiding this comment.
Yeah pytest can't parametrize over fixtures, it's annoying. Not sure there's much better you can do here.
IAlibay
left a comment
There was a problem hiding this comment.
Just a couple more things, mainly docstring (Travis is failing somewhere). Have you had a chance to build the docs and have a look at them? If you haven't, I'd recommend doing so, there's always a tiny thing that just doesn't build you expect it to.
Overall looks good to me, should be about ready to merge.
| coordinates = np.array([ | ||
| conf.GetPositions() for conf in filename.GetConformers()], | ||
| dtype=np.float32) | ||
| if coordinates.size == 0: |
There was a problem hiding this comment.
Do we have a feeling for what the standard behaviour across the MDA readers is? I believe the netcdf reader will just throw an error if it can't find a reasonable dimension (my thought here is that we would want to have a similar behaviour to how other things work).
I have to admit I skipped building the doc locally until now. I think I installed everything now but when I run Also, is |
I'm not sure where you got to in the process, @lilyminium made a very good guide on building the documentation: https://userguide.mdanalysis.org/contributing_code.html#working-with-the-code-documentation You should just need to do |
Got it, thanks! Still the same error though |
|
Sphinx must be < 3. See #2667 . For You can also temporarily disable the warnings = error by changing Line 18 in 788f294 This will always build all docs and for historical reasons they will be built in package/doc/html/html/index.html. If you want faster turn-around while working on docs then use These docs will show up at package/doc/html/index.html (sigh... it's ugly). The Makefile does not have |
|
Edit: oops, I didn't see @orbeckst's comment.
Interesting, what version of sphinx are you running? I know that 2+ have issues with our docs (I think there's an issue open about it). With 1.8.5, I get the following: Have you had any luck with compiling the docs from the standard develop branch? (I have just noticed that your PR is coming from your fork's develop branch rather than a separate branch, you probably want to avoid doing that in the future). |
|
Is this still for 1.0.0 ? I see that it's been timestamped to last week on the changelog. Or should I mark it for 1.0.1 in the docs and the changelog ? |
|
This will be 2.0
…On Fri, Jun 19, 2020 at 10:31, Cédric Bouysset ***@***.***> wrote:
Is this still for 1.0.0 ? I see that it's been timestamped to last week on
the changelog. Or should I mark it for 1.0.1 in the docs and the changelog ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2707 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGSGB4OA7IO3L2S4CEX3YLRXMV5TANCNFSM4NQAXTLA>
.
|
IAlibay
left a comment
There was a problem hiding this comment.
I don't think I have anything else to say on this one, lgtm :)
I'll let @fiona-naughton and @richardjgowers approve it before we merge.
| pass | ||
|
|
||
| def apply(self, group): | ||
| return group[group.aromaticities].unique |
There was a problem hiding this comment.
I've changed this so that it will fail if there aren't aromaticities available, rather than silently putting everything as false
| n_residues = 1 | ||
|
|
||
| # Segment | ||
| if any(segids) and not any(val is None for val in segids): |
There was a problem hiding this comment.
@cbouy Was just checking codecov to double check that there were enough tests and it looks like this branch of the code isn't tested at all (might be looking at an old commit). Could you double check that this is the case & add a test if so? https://codecov.io/gh/MDAnalysis/mdanalysis/src/dc482401df0d5c5839b2b37343b49a778987c2b1/package/MDAnalysis/topology/RDKitParser.py
|
I'll merge this so it's done, we can look at coverage + corner cases in future issues. @cbouy first step done! |
Part of the fixes for #2468
Changes made in this Pull Request:
core.topology.Topologyobject from anrdkit.Chem.rdchem.Molobject.Aromaticitiestopology attributes, and thearomaticselection token (for now, only usable when the Universe was created from an RDKit molecule)from_smilesclassmethod to the Universe (can add hydrogens and generate multiple conformers)This
iswas a minimal version complemented iteratively by adding new attributes, tests and the doc. Code heavily inspired from the ParmEdParser.PR Checklist