def ReplaceContext(self, context): self.address = context.copy() self.dirty = True if self.__dict__.has_key("_physicalop"): ## ar = catalog.getArrayReader(self.address, self.attr, self.ptrs) ar = makeArrayReader(self.array,len(self.array)) ar = makeArrayReader(self.array,len(self.array)) if (self.patternAttribute !=None): ar.setPatternAttribute(self.patternAttribute) self._physicalop.setArrayReader(ar)
def ChangeContext(self, attr, val): self.address[attr] = val #fn, o = catalog.resolveContext(self.address) #self._physicalop.setFilename(fn) #self._physicalop.setOffsetInt(o) if self.__dict__.has_key("_physicalop"): # ar = catalog.getArrayReader(self.address, self.attr, self.ptrs) ar = makeArrayReader(self.array,len(self.array)) ar = makeArrayReader(self.array,len(self.array)) if (self.patternAttribute !=None): ar.setPatternAttribute(self.patternAttribute) self._physicalop.setArrayReader(ar)
def init(self): #try: # if isinstance(self.previous, gridfield.GridField): # self.previous = Wrap(self.previous) # self.previous.init() #except AttributeError: #self.previous=Wrap(self.previous) #self.previous.init() if UnaryOperator.init(self): #fn, o = catalog.resolveContext(self.address) #ef = gridfield.ElcircFile(fn) #ar = ef.getVariableReader(0, "addr") #fn, o = catalog.resolveContext(self.address) #ar = catalog.getArrayReader(self.address, self.attr, self.ptrs) ar = makeArrayReader(self.array,len(self.array)) if (self.patternAttribute !=None): ar.setPatternAttribute(self.patternAttribute) #try: self._physicalop = BindOp(self.name,self.type, ar, self.dim, self.previous._physicalop)