bolt/spark/chunk.py
def map_generic(self, func):
        """
        Apply a generic array -> object to each subarray

        The resulting object is a BoltArraySpark of dtype object where the
        blocked dimensions are replaced with indices indication block ID.
        """
        def process_record(val):
            newval = empty(1, dtype="object")
            newval[0]  = func(val)
            return newval

        rdd = self._rdd.mapValues(process_record)

        nchunks = self.getnumber(self.plan, self.vshape)
        newshape = tuple([int(s) for s in r_[self.kshape, nchunks]])
        newsplit = len(self.shape)
        return BoltArraySpark(rdd, shape=newshape, split=newsplit, ordered=self._ordered, dtype="object")
def map_generic(self, func):
        """
        Apply a generic array -> object to each subarray

        The resulting object is a BoltArraySpark of dtype object where the
        blocked dimensions are replaced with indices indication block ID.
        """
        def process_record(val):
            newval = empty(1, dtype="object")
            newval[0]  = func(val)
            return newval

        rdd = self._rdd.mapValues(process_record)

        nchunks = self.getnumber(self.plan, self.vshape)
        newshape = tuple([int(s) for s in r_[self.kshape, nchunks]])
        newsplit = len(self.shape)
        return BoltArraySpark(rdd, shape=newshape, split=newsplit, ordered=self._ordered, dtype="object")
def map_generic ( self , func ) : def process_record ( val ) : newval = empty ( 1 , dtype = "object" ) newval [ 0 ] = func ( val ) return newval rdd = self . _rdd . mapValues ( process_record ) nchunks = self . getnumber ( self . plan , self . vshape ) newshape = tuple ( [ int ( s ) for s in r_ [ self . kshape , nchunks ] ] ) newsplit = len ( self . shape ) return BoltArraySpark ( rdd , shape = newshape , split = newsplit , ordered = self . _ordered , dtype = "object" )
Apply a generic array -> object to each subarray

        The resulting object is a BoltArraySpark of dtype object where the
        blocked dimensions are replaced with indices indication block ID.
Apply a generic array - > object to each subarray