-
Notifications
You must be signed in to change notification settings - Fork 837
ENH: Add PDB reader benchmark to track parsing performance #5394
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,6 +28,12 @@ | |||||||
| except ImportError: | ||||||||
| pass | ||||||||
|
|
||||||||
| try: | ||||||||
| import MDAnalysis as mda | ||||||||
| from MDAnalysisTests.datafiles import PDB_multiframe | ||||||||
| except ImportError: | ||||||||
| pass | ||||||||
|
|
||||||||
| traj_dict = { | ||||||||
| "XTC": [XTC, XTCReader], | ||||||||
| "TRR": [TRR, TRRReader], | ||||||||
|
|
@@ -71,3 +77,20 @@ def time_strides(self, traj_format): | |||||||
| """ | ||||||||
| for ts in self.reader_object: | ||||||||
| pass | ||||||||
|
|
||||||||
|
|
||||||||
| class PDBReaderBench(object): | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you need to create a separate class? Did you try adding coordinates.PDB.PDBReader and PDB_multiframe in the |
||||||||
| """Benchmarks for PDB file format reading and parsing""" | ||||||||
|
|
||||||||
| units = "ms" | ||||||||
| timeout = 60.0 | ||||||||
|
|
||||||||
| def setup(self): | ||||||||
| self.u = mda.Universe(PDB_multiframe) | ||||||||
|
|
||||||||
| def time_read(self): | ||||||||
| mda.Universe(PDB_multiframe) | ||||||||
|
Comment on lines
+91
to
+92
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This includes time for both topology and setting up PDBReader. You could try PDBReader(PDB_multiframe, n_atoms=u.atoms.n_atoms)By providing mdanalysis/package/MDAnalysis/coordinates/PDB.py Lines 290 to 292 in cec335f
You could benchmark the two cases: one with n_atoms, the other without. |
||||||||
|
|
||||||||
| def time_iterate(self): | ||||||||
| for ts in self.u.trajectory: | ||||||||
| pass | ||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ The rules for this file: | |
| * 2.11.0 | ||
|
|
||
| Fixes | ||
| * Added ASV benchmark for PDB trajectory reading (PR #1234) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would be an enhancement, not a fix. |
||
| * `MDAnalysis.analysis.nucleicacids.WatsonCrickDist`, `MinorPairDist`, | ||
| and `MajorPairDist` now match residue names against the full resname | ||
| instead of only the first character, fixing incorrect behaviour with | ||
|
|
||
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.
from MDAnalysis.coordinates.PDB.PDBReader