def toolTip_Data(self, data): if type(data) in self._type: msg = str(data.dtype) + '\n' msg += "shape: " + str(data.shape) return msg else: return osuper(NPYarray, self).toolTip_Data(data)
def setDataAttr(self, data): # set NPY array to read-only # so downstream mods don't accidentally # edit it. if type(data) in self._type: data.flags.writeable = False if not data.flags['C_CONTIGUOUS']: cf = inspect.currentframe().f_back.f_back try: pname = '\'' + str(cf.f_locals['pnumORtitle']) + '\'' except: pname = '(can\'t resolve port name)' try: fname = '\'' + str( cf.f_back.f_locals['self'].__module__) + '\'' except: fname = '(can\'t reslove file name)' self.log.warn( __name__ + ': Output array is not contiguous, forcing contiguity:\n\tFILE: ' + fname + ', PORT: ' + pname) data = np.ascontiguousarray(data) return data else: return osuper(NPYarray, self).setDataAttr(data)
def toolTip_Data(self, data): if type(data) == self._type: msg = str(data.dtype) + '\n' msg += "shape: "+str(data.shape) return msg else: return osuper(NPYarray, self).toolTip_Data(data)
def edgeTip(self, data): if type(data) == self._type: if data.len() != 1: msg = '\n' + str(data.len()) + ' GLObjs' else: msg = '\n' + str(data.len()) + ' GLObj' return msg return osuper(GLOList, self).edgeTip(data)
def toolTip_Data(self, data): if type(data) == self._type: msg = str(type(data)) if data.len() != 1: msg += '\n' + str(data.len()) + ' GLObjs' else: msg += '\n' + str(data.len()) + ' GLObj' return msg else: return osuper(GLOList, self).toolTip_Data(data)
def setDataAttr(self, data): # set NPY array to read-only # so downstream mods don't accidentally # edit it. if type(data) == self._type: data.flags.writeable = False if not data.flags['C_CONTIGUOUS']: cf = inspect.currentframe().f_back.f_back try: pname = '\''+str(cf.f_locals['pnumORtitle'])+'\'' except: pname = '(can\'t resolve port name)' try: fname = '\''+str(cf.f_back.f_locals['self'].__module__)+'\'' except: fname = '(can\'t reslove file name)' self.log.warn(__name__+': Output array is not contiguous, forcing contiguity:\n\tFILE: '+fname+', PORT: '+pname) data = np.ascontiguousarray(data) return data else: return osuper(NPYarray, self).setDataAttr(data)
def setDataAttr(self, data): return osuper(INT, self).setDataAttr(data)
def edgeTip(self, data): if type(data) == self._type: msg = str(data.shape) return msg return osuper(NPYarray, self).edgeTip(data)
def setDataAttr(self, data): return osuper(GLOList, self).setDataAttr(data)
def setDataAttr(self, data): return osuper(STRING, self).setDataAttr(data)
def setDataAttr(self, data): return osuper(COMPLEX, self).setDataAttr(data)
def edgeTip(self, data): if type(data) in self._type: msg = str(data.shape) return msg return osuper(NPYarray, self).edgeTip(data)
def setDataAttr(self, data): return osuper(TUPLE, self).setDataAttr(data)