def closure(coordinates): cPoints = [ sc.MultiPhasePoint(coors, [[quadChooser.getQuadrature(coors[0]), 'B']]) for coors in coordinates ] return Common.DependentList(cPoints)
def adder(point): hashValue = hashFunc(point) if hashT.has_key(hashValue): cPoint = hashT[hashValue] cPoint.addQuadrature(point.quadrature) else: newCPoint = sc.MultiPhasePoint(point.coordinates) newCPoint.addQuadrature(point.quadrature) hashT[hashValue] = newCPoint
def makeNearbyPoints(myCoors, quads): allCloseCoordinates = lg.multipleDimensions( [makeRange(c) for c in myCoors]) closeEnoughCoordinates = [ pt for pt in allCloseCoordinates if distance(myCoors, pt) <= 1 ] return [ WrapperPoint(sc.MultiPhasePoint(newCoords, quads)) for newCoords in closeEnoughCoordinates ]
def getSchedule(text): text = text.rstrip() lines = text.split('\n') points = [] for l in lines: nums = l.rstrip().split(' ') #print "nums: ", nums numericNums = [int(x) for x in nums] points.append(s.MultiPhasePoint(numericNums)) print "number of points: ", len(points) return s.SampleSchedule(points)
def bumpCoordinates(coors, quads, blurWidth): newCoords = [bump(c, blurWidth) for c in coors] return WrapperPoint(sc.MultiPhasePoint(newCoords, quads))
def __call__(self, coordinates): cPoints = map( lambda coors: sc.MultiPhasePoint(coors, self.quadratureChooser()), coordinates) return DependentList(cPoints)