Esempio n. 1
0
def test_atomic_number_non_default_max_atoms_preprocessor(mol):
    preprocessor = AtomicNumberPreprocessor(max_atoms=5)
    ret_atom_array = preprocessor.get_input_features(mol)
    expect_atom_array = numpy.array([6, 7, 6, 8], dtype=numpy.int32)
    numpy.testing.assert_array_equal(ret_atom_array, expect_atom_array)

    preprocessor = AtomicNumberPreprocessor(max_atoms=3)
    with pytest.raises(MolFeatureExtractionError):
        preprocessor.get_input_features(mol)
def test_atomic_number_non_default_max_atoms_preprocessor(mol):
    preprocessor = AtomicNumberPreprocessor(max_atoms=5)
    ret_atom_array = preprocessor.get_input_features(mol)
    expect_atom_array = numpy.array([6, 7, 6, 8],
                                    dtype=numpy.int32)
    numpy.testing.assert_array_equal(ret_atom_array, expect_atom_array)

    preprocessor = AtomicNumberPreprocessor(max_atoms=3)
    with pytest.raises(MolFeatureExtractionError):
        preprocessor.get_input_features(mol)
Esempio n. 3
0
def test_atomic_number_preprocessor(mol):
    preprocessor = AtomicNumberPreprocessor(max_atoms=5, out_size=10)
    ret_atom_array = preprocessor.get_input_features(mol)
    expect_atom_array = numpy.array([6, 7, 6, 8, 0, 0, 0, 0, 0, 0],
                                    dtype=numpy.int32)
    numpy.testing.assert_array_equal(ret_atom_array, expect_atom_array)
Esempio n. 4
0
def test_atomic_number_default_preprocessor(mol):
    preprocessor = AtomicNumberPreprocessor()
    ret_atom_array = preprocessor.get_input_features(mol)
    expect_atom_array = numpy.array([6, 7, 6, 8], dtype=numpy.int32)
    numpy.testing.assert_array_equal(ret_atom_array, expect_atom_array)