Esempio n. 1
0
def test_maccs_3(data):
    fps = MACCS(n_jobs=1, input_type='any')
    try:
        fps.transform(data['mols'] + data['smis'])
    except BaseException as e:
        print(e)
        assert False, 'should not got error'
    else:
        assert True
Esempio n. 2
0
def test_maccs4(data):
    fps = MACCS(n_jobs=1, input_type='any')
    with pytest.raises(ValueError):
        fps.transform(data['err_smis'])

    fps = MACCS(n_jobs=1, input_type='any', on_errors='nan')
    ret = fps.transform(data['err_smis'])
    assert pd.DataFrame(data=ret).shape == (4, 167)
    assert np.isnan(ret[1][10])
    assert np.isnan(ret[2][20])
Esempio n. 3
0
def test_maccs_2(data):
    fps = MACCS(n_jobs=1, input_type='smiles')
    try:
        fps.transform(data['mols'])
    except TypeError:
        assert True
    else:
        assert False, 'should not got error'

    try:
        fps.transform(data['smis'])
    except:
        assert False, 'should not got error'
    else:
        assert True
Esempio n. 4
0
def test_maccs_1(data):
    fps = MACCS(n_jobs=1)

    try:
        fps.transform(data['mols'])
    except:
        assert False, 'should not got error'
    else:
        assert True

    try:
        fps.transform(data['smis'])
    except TypeError:
        assert True
    else:
        assert False, 'should not got error'
Esempio n. 5
0
def test_maccs4(data):
    fps = MACCS(n_jobs=1, input_type='any')
    try:
        fps.transform(data['err_smis'])
    except ValueError:
        assert True
    else:
        assert False, 'should not got error'

    fps = ECFP(n_jobs=1, input_type='any', on_errors='nan')
    try:
        ret = fps.transform(data['err_smis'])
        assert pd.DataFrame(data=ret).shape == (4, 2048)
        assert np.isnan(ret[1][10])
        assert np.isnan(ret[2][20])
    except:
        assert False
    else:
        assert True
Esempio n. 6
0
def test_maccs_3(data):
    fps = MACCS(n_jobs=1, input_type='any')
    fps.transform(data['mols'] + data['smis'])
Esempio n. 7
0
def test_maccs_2(data):
    fps = MACCS(n_jobs=1, input_type='smiles')
    with pytest.raises(TypeError):
        fps.transform(data['mols'])

    fps.transform(data['smis'])
Esempio n. 8
0
def test_maccs_1(data):
    fps = MACCS(n_jobs=1)
    fps.transform(data['mols'])

    with pytest.raises(TypeError):
        fps.transform(data['smis'])