def _setup(self):
        """
        Set the binning info we need from the `edges`
        """
        dtype = [('inv', 'f8'), ('min', 'f8'), ('max', 'f8'),('N', 'i4'), ('spacing','object')]
        dtype        = numpy.dtype(dtype)
        self._info   = numpy.empty(self.Ndim, dtype=dtype)
        self.min     = self._info['min']
        self.max     = self._info['max']
        self.N       = self._info['N']
        self.inv     = self._info['inv']
        self.spacing = self._info['spacing']

        for i, dim in enumerate(self.dims):

            self.N[i] = len(self.edges[i])-1
            self.min[i] = self.edges[i][0]
            self.max[i] = self.edges[i][-1]

            # determine the type of spacing
            self.spacing[i] = None
            lin_diff = numpy.diff(self.edges[i])
            with numpy.errstate(divide='ignore', invalid='ignore'):
                log_diff = numpy.diff(numpy.log10(self.edges[i]))
            if numpy.allclose(lin_diff, lin_diff[0]):
                self.spacing[i] = 'linspace'
                self.inv[i] = self.N[i] * 1.0 / (self.max[i] - self.min[i])
            elif numpy.allclose(log_diff, log_diff[0]):
                self.spacing[i] = 'logspace'
                self.inv[i] = self.N[i] * 1.0 / numpy.log10(self.max[i] / self.min[i])

        self.shape = self.N + 2

        # store Rmax
        self.Rmax = self.max[0]
def _setup ( self ) : dtype = [ ( 'inv' , 'f8' ) , ( 'min' , 'f8' ) , ( 'max' , 'f8' ) , ( 'N' , 'i4' ) , ( 'spacing' , 'object' ) ] dtype = numpy . dtype ( dtype ) self . _info = numpy . empty ( self . Ndim , dtype = dtype ) self . min = self . _info [ 'min' ] self . max = self . _info [ 'max' ] self . N = self . _info [ 'N' ] self . inv = self . _info [ 'inv' ] self . spacing = self . _info [ 'spacing' ] for i , dim in enumerate ( self . dims ) : self . N [ i ] = len ( self . edges [ i ] ) - 1 self . min [ i ] = self . edges [ i ] [ 0 ] self . max [ i ] = self . edges [ i ] [ - 1 ] self . spacing [ i ] = None lin_diff = numpy . diff ( self . edges [ i ] ) with numpy . errstate ( divide = 'ignore' , invalid = 'ignore' ) : log_diff = numpy . diff ( numpy . log10 ( self . edges [ i ] ) ) if numpy . allclose ( lin_diff , lin_diff [ 0 ] ) : self . spacing [ i ] = 'linspace' self . inv [ i ] = self . N [ i ] * 1.0 / ( self . max [ i ] - self . min [ i ] ) elif numpy . allclose ( log_diff , log_diff [ 0 ] ) : self . spacing [ i ] = 'logspace' self . inv [ i ] = self . N [ i ] * 1.0 / numpy . log10 ( self . max [ i ] / self . min [ i ] ) self . shape = self . N + 2 self . Rmax = self . max [ 0 ]
Set the binning info we need from the `edges`