-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add performance checks #539
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
487116f
Add performance tests for writers
595f774
Add test to check from_mbuild performance
7c5dc51
Merge branch 'master' into add/performance_tests
umesh-timalsina 0aa3c87
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e7a3fcd
Merge branch 'master' into add/performance_tests
daico007 11015ea
Merge branch 'master' into add/performance_tests
umesh-timalsina 51445cb
Merge branch 'master' into add/performance_tests
daico007 53fa3b1
Merge branch 'master' into add/performance_tests
umesh-timalsina a83e9fb
Merge branch 'main' into add/performance_tests
daico007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import pytest | ||
|
||
from gmso.core.atom import Atom | ||
from gmso.core.atom_type import AtomType | ||
Check notice Code scanning / CodeQL Unused import
Import of 'AtomType' is not used.
|
||
from gmso.core.topology import Topology | ||
Check notice Code scanning / CodeQL Unused import
Import of 'Topology' is not used.
|
||
from gmso.external import from_mbuild | ||
from gmso.formats.gro import write_gro | ||
from gmso.formats.lammpsdata import write_lammpsdata | ||
from gmso.formats.mcf import write_mcf | ||
from gmso.formats.top import write_top | ||
from gmso.formats.xyz import write_xyz | ||
from gmso.tests.base_test import BaseTest | ||
|
||
|
||
class TestPerformance(BaseTest): | ||
@pytest.mark.timeout(15) | ||
def test_lammps_performance(self, n_typed_ar_system): | ||
top = n_typed_ar_system(n_sites=10000) | ||
write_lammpsdata(top, "data.ar") | ||
|
||
@pytest.mark.timeout(15) | ||
def test_mcf_performance(self, n_typed_ar_system): | ||
top = n_typed_ar_system(n_sites=10000) | ||
write_mcf(top, "ar.mcf") | ||
|
||
@pytest.mark.timeout(15) | ||
def test_top_performance(self, n_typed_ar_system): | ||
top = n_typed_ar_system(n_sites=10000) | ||
write_top(top, "ar.top") | ||
|
||
@pytest.mark.timeout(5) | ||
def test_xyz_performance(self, n_ar_system): | ||
cmpd = n_ar_system(n_sites=10000) | ||
top = from_mbuild(cmpd) | ||
write_xyz(top, "ar.xyz") | ||
|
||
@pytest.mark.timeout(5) | ||
def test_gro_performance(self, n_ar_system): | ||
cmpd = n_ar_system(n_sites=10000) | ||
top = from_mbuild(cmpd) | ||
write_gro(top, "ar.gro") | ||
|
||
# TODO: Add test to check performance of loading in XML when more performant | ||
|
||
@pytest.mark.timeout(20) | ||
def test_from_mbuild_performance(self, n_ar_system): | ||
cmpd = n_ar_system(n_sites=50000) | ||
top = from_mbuild(cmpd) | ||
Check notice Code scanning / CodeQL Unused local variable
Variable top is not used.
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / CodeQL
Unused import