Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 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)
Example #4
0
 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 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)
Example #6
0
 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 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)
Example #8
0
 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)
Example #9
0
 def setDataAttr(self, data):
     return osuper(INT, self).setDataAttr(data)
Example #10
0
 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)
Example #12
0
 def setDataAttr(self, data):
     return osuper(STRING, self).setDataAttr(data)
Example #13
0
 def setDataAttr(self, data):
     return osuper(COMPLEX, self).setDataAttr(data)
Example #14
0
 def setDataAttr(self, data):
     return osuper(GLOList, self).setDataAttr(data)
Example #15
0
 def edgeTip(self, data):
     if type(data) in self._type:
         msg = str(data.shape)
         return msg
     return osuper(NPYarray, self).edgeTip(data)
Example #16
0
 def setDataAttr(self, data):
     return osuper(TUPLE, self).setDataAttr(data)
Example #17
0
 def setDataAttr(self, data):
     return osuper(INT, self).setDataAttr(data)
Example #18
0
 def setDataAttr(self, data):
     return osuper(COMPLEX, self).setDataAttr(data)
Example #19
0
 def setDataAttr(self, data):
     return osuper(TUPLE, self).setDataAttr(data)
Example #20
0
 def setDataAttr(self, data):
     return osuper(STRING, self).setDataAttr(data)