def testNumberOfPoints(self): ranges = self.params['ranges'] gen = ht.getGenerator(ranges) points = gen() self.assertEqual( len(points), reduce(lambda x, y: x * y, [len(x) for x in ranges], 1), "bad number of points generated")
def getGenerator(ranges, shellSpacing, maxDeviation): points = ht.getGenerator(ranges)() origin = [r[0] for r in ranges] shells = [ pt for pt in points if myDist(pt, origin, shellSpacing, maxDeviation) ] return lambda: shells
def testNumberOfPoints(self): ranges = self.params["ranges"] gen = ht.getGenerator(ranges) points = gen() self.assertEqual( len(points), reduce(lambda x, y: x * y, [len(x) for x in ranges], 1), "bad number of points generated" )
def getGenerator(ranges, offsetAngle, gapAngle, maximumDeviation): allPoints = ht.getGenerator(ranges)() origin = [r[0] for r in ranges] points = [ pt for pt in allPoints if myFilter(pt, origin, offsetAngle, gapAngle, maximumDeviation) ] return lambda: points
def getGenerator(ranges, offsetAngle, gapAngle, maximumDeviation): allPoints = ht.getGenerator(ranges)() origin = [r[0] for r in ranges] points = [pt for pt in allPoints if myFilter(pt, origin, offsetAngle, gapAngle, maximumDeviation)] return lambda: points
def getGenerator(ranges, shellSpacing, maxDeviation): points = ht.getGenerator(ranges)() origin = [r[0] for r in ranges] shells = [pt for pt in points if myDist(pt, origin, shellSpacing, maxDeviation)] return lambda: shells
def getHyperTable(params): rangeLists = map(lambda dim: dim['range'], params['dimensions']) ranges = map(lambda r: u.rangeIncludingBounds(r[0], r[1]), rangeLists) return ht.getGenerator(ranges)
def setUp(self): self.params = {"ranges": [myRange(1, 30), myRange(1, 30)]} self.ranges = self.params['ranges'] gen = ht.getGenerator(self.ranges) self.points = gen()
def setUp(self): self.params = {"ranges": [myRange(1, 30), myRange(1, 30)]} self.ranges = self.params["ranges"] gen = ht.getGenerator(self.ranges) self.points = gen()