Example #1
0
def test_ecfp_3(data):
    fps = ECFP(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
Example #2
0
def test_ecfp_4(data):
    fps = ECFP(n_jobs=1, input_type='any')
    with pytest.raises(ValueError):
        fps.transform(data['err_smis'])

    fps = ECFP(n_jobs=1, input_type='any', on_errors='nan')
    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])
Example #3
0
def test_ecfp_2(data):
    fps = ECFP(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
Example #4
0
def test_ecfp_1(data):
    fps = ECFP(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'
Example #5
0
def test_ecfp_4(data):
    fps = ECFP(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
Example #6
0
def test_ecfp_3(data):
    fps = ECFP(n_jobs=1, input_type='any')
    fps.transform(data['mols'] + data['smis'])
Example #7
0
def test_ecfp_2(data):
    fps = ECFP(n_jobs=1, input_type='smiles')
    with pytest.raises(TypeError):
        fps.transform(data['mols'])

    fps.transform(data['smis'])
Example #8
0
def test_ecfp_1(data):
    fps = ECFP(n_jobs=1)
    fps.transform(data['mols'])

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