Did I find the right examples for you? yes no

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)

src/c/o/cogent-1.5.3/tests/test_maths/test_matrix/test_distance.py   cogent(Download)
            n = deepcopy(m)
            dm = DistanceMatrix(data=n, RowOrder=m.keys(), Pad=False)
            dm.scale(lambda x: x**2)
            self.assertEqual(dm['A']['A'],m['A']['A']**2)
            self.assertEqual(dm['B']['A'],m['B']['A']**2)
            n = deepcopy(m)
            dm = DistanceMatrix(data=n, RowOrder=m.keys(), Pad=False)
            dm.scale(lambda x: x**3)
            self.assertEqual(dm['A']['A'],m['A']['A']**3)
            self.assertEqual(dm['B']['A'],m['B']['A']**3)
            n = deepcopy(m)
            dm = DistanceMatrix(data=n, RowOrder=m.keys(), Pad=False)
            dm.scale(lambda x: 10**-(x/10.0))
            self.assertFloatEqual(dm['A']['A'],10**-(m['A']['A']/10.))
            self.assertFloatEqual(dm['B']['A'],10**-(m['B']['A']/10.))

src/p/y/pycogent-HEAD/tests/test_maths/test_matrix/test_distance.py   pycogent(Download)
            n = deepcopy(m)
            dm = DistanceMatrix(data=n, RowOrder=m.keys(), Pad=False)
            dm.scale(lambda x: x**2)
            self.assertEqual(dm['A']['A'],m['A']['A']**2)
            self.assertEqual(dm['B']['A'],m['B']['A']**2)
            n = deepcopy(m)
            dm = DistanceMatrix(data=n, RowOrder=m.keys(), Pad=False)
            dm.scale(lambda x: x**3)
            self.assertEqual(dm['A']['A'],m['A']['A']**3)
            self.assertEqual(dm['B']['A'],m['B']['A']**3)
            n = deepcopy(m)
            dm = DistanceMatrix(data=n, RowOrder=m.keys(), Pad=False)
            dm.scale(lambda x: 10**-(x/10.0))
            self.assertFloatEqual(dm['A']['A'],10**-(m['A']['A']/10.))
            self.assertFloatEqual(dm['B']['A'],10**-(m['B']['A']/10.))