def get_input_features(self, mol):
        """get input features

        Args:
            mol (Mol):

        Returns:

        """
        type_check_num_atoms(mol, self.max_atoms)
        atom_array = construct_atomic_number_array(mol, out_size=self.out_size)
        return atom_array
    def get_input_features(self, mol):
        """get input features for WeaveNet

        WeaveNetPreprocessor automatically add `H` to `mol`

        Args:
            mol (Mol):

        """
        type_check_num_atoms(mol, self.max_atoms)
        # TODO(Nakago): support original paper feature extraction
        # currently only embed id is supported.
        atom_array = construct_atomic_number_array(mol, self.max_atoms)
        pair_feature = construct_pair_feature(mol,
                                              num_max_atoms=self.max_atoms)
        return atom_array, pair_feature
Exemple #3
0
 def test_normal_truncated(self, sample_molecule):
     with pytest.raises(ValueError):
         adj = common.construct_atomic_number_array(sample_molecule, 3)
Exemple #4
0
    def test_padding(self, sample_molecule):
        actual = common.construct_atomic_number_array(sample_molecule, 5)

        assert actual.shape == (5, )
        expect = numpy.array([6, 7, 6, 8, 0], dtype=numpy.int32)
        numpy.testing.assert_equal(actual, expect)