def test_get_labels(self): a = LocalEncodedBond(segments=2, start=0., end=1.) m = a.fit_transform([METHANE]) labels = a.get_labels() self.assertEqual(m.shape[2], len(labels)) expected = ( 'C_0.0', 'C_1.0', 'H_0.0', 'H_1.0', ) self.assertEqual(labels, expected)
def test_get_labels(self): a = LocalEncodedBond(segments=2, start=0., end=1.) m = a.fit_transform([METHANE]) labels = a.get_labels() self.assertEqual(m.shape[2], len(labels)) expected = ( 'C_0.0', 'C_1.0', 'H_0.0', 'H_1.0', ) self.assertEqual(labels, expected)
def test_form(self): a = LocalEncodedBond(form=0) m = a.fit_transform([METHANE]) self.assertEqual(m.shape, (1, 5, 100))
def test_transform_invalid_spacing(self): a = LocalEncodedBond(spacing='not real"') with self.assertRaises(KeyError): a.fit_transform(ALL_DATA)
def test_form(self): a = LocalEncodedBond(form=0) m = a.fit_transform([METHANE]) self.assertEqual(m.shape, (1, 5, 100))
def test_transform_invalid_spacing(self): a = LocalEncodedBond(spacing='not real"') with self.assertRaises(KeyError): a.fit_transform(ALL_DATA)