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
Exemple #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"
     )
Exemple #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
Exemple #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
Exemple #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
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)
Exemple #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)
 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()
Exemple #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()