예제 #1
0
def test_fcfp_3(data):
    fps = FCFP(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
예제 #2
0
def test_fcfp_4(data):
    fps = FCFP(n_jobs=1, input_type='any')
    with pytest.raises(ValueError):
        fps.transform(data['err_smis'])

    fps = FCFP(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])
예제 #3
0
def test_fcfp_2(data):
    fps = FCFP(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
예제 #4
0
def test_fcfp_1(data):
    fps = FCFP(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'
예제 #5
0
def test_fcfp_4(data):
    fps = FCFP(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
예제 #6
0
def test_fcfp_3(data):
    fps = FCFP(n_jobs=1, input_type='any')
    fps.transform(data['mols'] + data['smis'])
예제 #7
0
def test_fcfp_2(data):
    fps = FCFP(n_jobs=1, input_type='smiles')
    with pytest.raises(TypeError):
        fps.transform(data['mols'])

    fps.transform(data['smis'])
예제 #8
0
def test_fcfp_1(data):
    fps = FCFP(n_jobs=1)
    fps.transform(data['mols'])

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