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

Speed up check_compatibility for relevant writer method #700

Merged
merged 9 commits into from
Dec 13, 2022

Conversation

daico007
Copy link
Member

With the new change to Topology's potential types, the performance of the writing step may be affected by the check_compatiblity step (due to a lot of sympy.sympify call). A simplify_check option has been added to speed up the process (started with GROMACS top writer). This PR will attempt to add the simplify_check option to other relevant writer and add documentation at the Topology.save method.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 22, 2022

This pull request introduces 1 alert when merging 7de41c7 into 4f00c99 - view on LGTM.com

new alerts:

  • 1 for Unused import

Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog.

@codecov
Copy link

codecov bot commented Nov 23, 2022

Codecov Report

Base: 91.39% // Head: 91.48% // Increases project coverage by +0.09% 🎉

Coverage data is based on head (8d87658) compared to base (fe321e2).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #700      +/-   ##
==========================================
+ Coverage   91.39%   91.48%   +0.09%     
==========================================
  Files          63       63              
  Lines        5451     5450       -1     
==========================================
+ Hits         4982     4986       +4     
+ Misses        469      464       -5     
Impacted Files Coverage Δ
gmso/core/topology.py 92.21% <ø> (+0.84%) ⬆️
gmso/formats/__init__.py 100.00% <100.00%> (ø)
gmso/formats/json.py 92.41% <100.00%> (ø)
gmso/formats/mol2.py 100.00% <100.00%> (ø)
gmso/formats/top.py 87.71% <100.00%> (ø)
gmso/utils/compatibility.py 96.55% <100.00%> (+8.55%) ⬆️
gmso/core/atom_type.py 97.36% <0.00%> (-1.32%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@daico007 daico007 changed the title Standardize simplify_check/check_compatibility for relevant writer method Speed up check_compatibility for relevant writer method Nov 23, 2022
@daico007
Copy link
Member Author

On second, I think the simplify check behavior should be the default behavior for the compatibility check step. I will try to modify the method such that I will speed up in most case and only slow down/perform detail check when encounter hard case.

@CalCraven
Copy link
Contributor

@daico007 I've pretty much dismantled the lammpswriter in the PR I'm currently working on. So maybe we should limit this to just the speedups checks instead of also including these changes directly to the lammpswriter. Let me pull the PR with what I have currently and maybe we can discuss what needs to be included between them. I mostly followed the way it was done with the .top writer.

@CalCraven
Copy link
Contributor

Briefly comparing the two, it looks like I didn't actually make the connection maps you generate in this code addition, but otherwise I've covered the rest of these changes. We can discuss the best way to iterate through the connection types in that PR.

@daico007
Copy link
Member Author

Good point, I will revert the LAMMPS stuff

@daico007 daico007 marked this pull request as ready for review November 29, 2022 16:59
@@ -1387,7 +1375,7 @@ def create_subtop(self, label_type, label):
new_top.update_topology()
return new_top

def save(self, filename, overwrite=False, **kwargs):
def save(self, filename, overwrite=False, simplify_check=True, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure why this simplify_check is here if we removed it from other sections. Is this an oversight, or is it doing something that I missed?

@daico007 daico007 merged commit 5085640 into mosdef-hub:main Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants