Skip to content

Commit

Permalink
Add benchmarks for structural alphabet conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
padix-key committed Nov 4, 2024
1 parent 46d2c61 commit 06647dc
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions benchmarks/structure/benchmark_alphabet.py
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)

0 comments on commit 06647dc

Please sign in to comment.