Example #1
0
 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
Example #3
0
 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"
     )
Example #4
0
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
Example #5
0
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
Example #6
0
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
Example #7
0
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)
Example #8
0
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)
Example #9
0
 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()
Example #10
0
 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()