Skip to content
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

MOL2 parser populates elements attribute #3063

Merged
merged 116 commits into from
Aug 13, 2021
Merged

Conversation

RMeli
Copy link
Member

@RMeli RMeli commented Dec 8, 2020

Fixes #3062

Changes made in this Pull Request:

  • Add elements attribute when parsing MOL2 file

The elements are validated as for the PDBParser and empty records are used if the element is invalid.

When #2927 and #3057 are merged I can add a test for the selection and remove the bonds from the mol2_wrong_elements test variable.

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

RMeli and others added 30 commits August 7, 2019 18:41
Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple more comments, mostly responses to questions.

testsuite/MDAnalysisTests/data/mol2/Molecule.mol2 Outdated Show resolved Hide resolved
package/MDAnalysis/topology/MOL2Parser.py Outdated Show resolved Hide resolved
package/CHANGELOG Outdated Show resolved Hide resolved
Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nearly there I think, just a couple of extra things.

package/MDAnalysis/topology/tables.py Show resolved Hide resolved
package/MDAnalysis/topology/MOL2Parser.py Outdated Show resolved Hide resolved
package/MDAnalysis/topology/MOL2Parser.py Outdated Show resolved Hide resolved
Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple more things, we should be good to merge after this.

package/MDAnalysis/topology/MOL2Parser.py Outdated Show resolved Hide resolved
package/MDAnalysis/topology/MOL2Parser.py Outdated Show resolved Hide resolved
package/MDAnalysis/topology/MOL2Parser.py Outdated Show resolved Hide resolved
package/MDAnalysis/topology/tables.py Outdated Show resolved Hide resolved
testsuite/MDAnalysisTests/topology/test_mol2.py Outdated Show resolved Hide resolved
@RMeli
Copy link
Member Author

RMeli commented Aug 12, 2021

@IAlibay I could see your if/else vs try/catch benchmark twice but now that I resolved one conversation both disappeared. Anyways, I can reproduce your numbers locally: similar performance when no exception is triggered but a factor of 2 in performance drop when exceptions are triggered often. I'll change the code as suggested, thanks for bringing this up!

@IAlibay IAlibay self-requested a review August 12, 2021 21:02
@IAlibay IAlibay self-assigned this Aug 12, 2021
@IAlibay
Copy link
Member

IAlibay commented Aug 12, 2021

I'll have a final look in the morning - hopefully we should be good.

@richardjgowers - do you want to have another look or shall I dismiss your review? (I think your initial comments have all be addressed now)

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the one final thing 🙃

package/CHANGELOG Outdated Show resolved Hide resolved
Co-authored-by: Irfan Alibay <[email protected]>
@IAlibay IAlibay dismissed richardjgowers’s stale review August 13, 2021 13:31

Comments have been addressed.

@IAlibay IAlibay merged commit f8bb8ec into MDAnalysis:develop Aug 13, 2021
@RMeli RMeli deleted the mol2-elements branch August 13, 2021 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MOL2 parser does not populate the elements attribute
6 participants