-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] added tests for multiple models
- Loading branch information
1 parent
8cc98e5
commit cf3a8e8
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
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,26 @@ | ||
# BioPandas | ||
# Author: Sebastian Raschka <[email protected]> | ||
# Author: Arian Jamasb <[email protected]> | ||
# License: BSD 3 clause | ||
# Project Website: http://rasbt.github.io/biopandas/ | ||
# Code Repository: https://github.com/rasbt/biopandas | ||
import os | ||
|
||
from biopandas.mmcif import PandasMmcif | ||
|
||
TESTDATA_FILENAME = os.path.join(os.path.dirname(__file__), "data", "2jyf.cif.gz") | ||
|
||
def test_get_model(): | ||
df = PandasMmcif().read_mmcif(TESTDATA_FILENAME) | ||
MODEL_INDEX = 1 | ||
new_df = df.get_model(MODEL_INDEX) | ||
print(df) | ||
assert new_df.df["ATOM"]["pdbx_PDB_model_num"].all() == MODEL_INDEX | ||
|
||
|
||
def test_get_models(): | ||
df = PandasMmcif().read_mmcif(TESTDATA_FILENAME) | ||
MODEL_INDICES = [1, 3, 5] | ||
|
||
new_df = df.get_models(MODEL_INDICES) | ||
assert new_df.df["ATOM"]["pdbx_PDB_model_num"].all() in MODEL_INDICES |