-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
87 additions
and
4 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
Empty file.
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,13 @@ | ||
from pathlib import Path | ||
import pytest | ||
import fastpdb | ||
|
||
|
||
@pytest.fixture | ||
def pdb_file_path(): | ||
return Path(__file__).parents[1] / "tests" / "data" / "1aki.pdb" | ||
|
||
|
||
@pytest.fixture | ||
def pdb_file(pdb_file_path): | ||
return fastpdb.PDBFile.read(pdb_file_path) |
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,27 @@ | ||
import pytest | ||
import fastpdb | ||
|
||
|
||
@pytest.mark.benchmark | ||
def test_read(pdb_file_path): | ||
fastpdb.PDBFile.read(pdb_file_path) | ||
|
||
|
||
@pytest.mark.benchmark | ||
def test_get_coord(pdb_file): | ||
pdb_file.get_coord(model=1) | ||
|
||
|
||
@pytest.mark.benchmark | ||
def test_get_structure(pdb_file): | ||
pdb_file.get_structure(model=1) | ||
|
||
|
||
@pytest.mark.benchmark | ||
def test_get_structure_with_bonds(pdb_file): | ||
pdb_file.get_structure(model=1, include_bonds=True) | ||
|
||
|
||
@pytest.mark.benchmark | ||
def test_get_remark(pdb_file): | ||
pdb_file.get_remark(350) |
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,23 @@ | ||
import pytest | ||
import fastpdb | ||
|
||
|
||
@pytest.fixture | ||
def atoms(pdb_file): | ||
return pdb_file.get_structure(model=1, include_bonds=True) | ||
|
||
|
||
@pytest.fixture | ||
def empty_pdb_file(): | ||
return fastpdb.PDBFile() | ||
|
||
|
||
@pytest.mark.benchmark | ||
def test_set_structure(atoms, empty_pdb_file): | ||
atoms.bonds = None | ||
empty_pdb_file.set_structure(atoms) | ||
|
||
|
||
@pytest.mark.benchmark | ||
def test_set_structure_with_bonds(atoms, empty_pdb_file): | ||
empty_pdb_file.set_structure(atoms) |
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