From 242a5cc1e5cd92f6d9a365a2111996d5adcd2a31 Mon Sep 17 00:00:00 2001 From: Patrick Kunzmann Date: Tue, 7 Jan 2025 09:24:02 +0100 Subject: [PATCH] Add benchmark --- benchmarks/structure/benchmark_celllist.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 benchmarks/structure/benchmark_celllist.py diff --git a/benchmarks/structure/benchmark_celllist.py b/benchmarks/structure/benchmark_celllist.py new file mode 100644 index 000000000..afff79a07 --- /dev/null +++ b/benchmarks/structure/benchmark_celllist.py @@ -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)