Skip to content

Commit

Permalink
Changed test transformers to use the pytest fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
EBjerrum committed Nov 30, 2022
1 parent 92bd92b commit 445212c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/test_transformers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# checking that the new transformers can work within a scikitlearn pipeline of the kind
# Pipeline([("s2m", SmilesToMol()), ("FP", FPTransformer()), ("RF", RandomForestRegressor())])
# using some test data stored in ./data/SLC6A4_active_excape_export.csv
# using some test data stored in ./data/SLC6A4_active_excape_subset.csv

# to run as
# pytest tests/test_transformers.py --> tests/test_transformers.py::test_transformer PASSED
Expand All @@ -14,12 +14,13 @@
from scikit_mol.transformers import MACCSTransformer, RDKitFPTransformer, AtomPairFingerprintTransformer, \
TopologicalTorsionFingerprintTransformer, MorganTransformer

def test_transformer():
from fixtures import SLC6A4_subset

def test_transformer(SLC6A4_subset):
# load some toy data for quick testing on a small number of samples
data = pd.read_csv("./tests/data/SLC6A4_active_excape_export.csv")
X_smiles, Y = data.SMILES, data.pXC50
X_train, X_test = X_smiles[:128], X_smiles[128:256]
Y_train, Y_test = Y[:128], Y[128:256]
X_smiles, Y = SLC6A4_subset.SMILES, SLC6A4_subset.pXC50
X_train, X_test = X_smiles[:128], X_smiles[128:]
Y_train, Y_test = Y[:128], Y[128:]

# run FP with default parameters except when useCounts can be given as an argument
FP_dict = {"MACCSTransformer": [MACCSTransformer, None],
Expand Down

0 comments on commit 445212c

Please sign in to comment.