Exemplo n.º 1
0
Arquivo: map.py Projeto: 2t7/ipython
 def concatenate(self, listOfPartitions):
     testObject = listOfPartitions[0]
     # First see if we have a known array type
     if is_array(testObject):
         return numpy.concatenate(listOfPartitions)
     # Next try for Python sequence types
     if isinstance(testObject, (list, tuple)):
         return utils_flatten(listOfPartitions)
     # If we have scalars, just return listOfPartitions
     return listOfPartitions
Exemplo n.º 2
0
 def concatenate(self, listOfPartitions):
     testObject = listOfPartitions[0]
     # First see if we have a known array type
     if is_array(testObject):
         return numpy.concatenate(listOfPartitions)
     # Next try for Python sequence types
     if isinstance(testObject, (list, tuple)):
         return utils_flatten(listOfPartitions)
     # If we have scalars, just return listOfPartitions
     return listOfPartitions
Exemplo n.º 3
0
Arquivo: map.py Projeto: 3kwa/ipython
 def concatenate(self, listOfPartitions):
     testObject = listOfPartitions[0]
     # First see if we have a known array type
     for m in arrayModules:
         #print m
         if isinstance(testObject, m['type']):
             return m['module'].concatenate(listOfPartitions)
     # Next try for Python sequence types
     if isinstance(testObject, (types.ListType, types.TupleType)):
         return utils_flatten(listOfPartitions)
     # If we have scalars, just return listOfPartitions
     return listOfPartitions
Exemplo n.º 4
0
 def concatenate(self, listOfPartitions):
     testObject = listOfPartitions[0]
     # First see if we have a known array type
     for m in arrayModules:
         #print m
         if isinstance(testObject, m['type']):
             return m['module'].concatenate(listOfPartitions)
     # Next try for Python sequence types
     if isinstance(testObject, (types.ListType, types.TupleType)):
         return utils_flatten(listOfPartitions)
     # If we have scalars, just return listOfPartitions
     return listOfPartitions