Skip to content

Commit

Permalink
Add benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
padix-key committed Jan 6, 2025
1 parent d202aa7 commit 803f61b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions benchmarks/structure/benchmark_superimpose.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from pathlib import Path
import pytest
import biotite.structure as struc
import biotite.structure.io.pdbx as pdbx
from tests.util import data_dir


@pytest.fixture
def atoms():
pdbx_file = pdbx.BinaryCIFFile.read(Path(data_dir("structure")) / "1gya.bcif")
return pdbx.get_structure(pdbx_file)


@pytest.mark.benchmark
@pytest.mark.parametrize(
"method",
[
struc.superimpose,
struc.superimpose_without_outliers,
struc.superimpose_homologs,
struc.superimpose_structural_homologs,
],
)
def benchmark_superimpose(method, atoms):
"""
Compute superimposition of two structures with the same number of atoms.
"""
method(atoms[0], atoms[1])

0 comments on commit 803f61b

Please sign in to comment.