-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add benchmarks for structural alphabet conversion
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from pathlib import Path | ||
import pytest | ||
import biotite.structure.alphabet as strucalph | ||
import biotite.structure.io.pdbx as pdbx | ||
from tests.util import data_dir | ||
|
||
PDB_ID = "1aki" | ||
|
||
|
||
@pytest.fixture | ||
def atoms(): | ||
pdbx_file = pdbx.BinaryCIFFile.read(Path(data_dir("structure")) / f"{PDB_ID}.bcif") | ||
return pdbx.get_structure(pdbx_file, model=1, include_bonds=True) | ||
|
||
|
||
@pytest.mark.benchmark | ||
@pytest.mark.parametrize("method", [strucalph.to_3di, strucalph.to_protein_blocks]) | ||
def benchmark_structural_alphabet_methods(method, atoms): | ||
""" | ||
Convert a structure to the given structural alphabet. | ||
""" | ||
method(atoms) |