Skip to content

Commit

Permalink
Add benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
padix-key committed Jan 7, 2025
1 parent 226f2b4 commit 242a5cc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions benchmarks/structure/benchmark_celllist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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, model=1)


def benchmark_cell_list(atoms):
"""
Find all contacts in a structure using a cell list.
"""
cell_list = struc.CellList(atoms, 5.0)
cell_list.get_atoms(atoms.coord, 5.0)

0 comments on commit 242a5cc

Please sign in to comment.