Gets the min/max of a scalar given its name across all blocks
558894
def get_data_range(self, name):
        """"""
        mini, maxi = np.inf, -np.inf
        for i in range(self.n_blocks):
            data = self[i]
            if data is None:
                continue
            # get the scalar if availble
            arr = get_scalar(data, name)
            if arr is None:
                continue
            tmi, tma = np.nanmin(arr), np.nanmax(arr)
            if tmi < mini:
                mini = tmi
            if tma > maxi:
                maxi = tma
        return mini, maxi
1096235
def clamp(value, lower=0, upper=sys.maxsize):
    """"""
    return max(lower, min(upper, value))
431179
def min(self, axis=None, skipna=True):
        """"""
        nv.validate_minmax_axis(axis)
        return self._minmax('min')
1075202
public static double findMaxCol(final int blockLength , final DSubmatrixD1 Y , final int col )
    {
        final int width = Math.min(blockLength,Y.col1-Y.col0);

        final double dataY[] = Y.original.data;

        double max = 0;

        for( int i = Y.row0; i < Y.row1; i += blockLength ) {
            int height = Math.min( blockLength , Y.row1 - i );

            int index = i*Y.original.numCols + height*Y.col0 + col;

            if( i == Y.row0 ) {
                index += width*col;
                for( int k = col; k < height; k++ , index += width ) {
                    double v = Math.abs(dataY[index]);
                    if( v > max ) {
                        max = v;
                    }
                }
            } else {
                for( int k = 0; k < height; k++ , index += width ) {
                    double v = Math.abs(dataY[index]);
                    if( v > max ) {
                        max = v;
                    }
                }
            }
        }

        return max;
    }
1363852
def Eg(self, **kwargs):
        '''
        
        '''
        return min(self.Eg_Gamma(**kwargs),
                   self.Eg_L(**kwargs),
                   self.Eg_X(**kwargs))
1043152
def minimum(x1, x2, output_shape=None, name=None):
  
  output_shape = convert_to_shape(output_shape)
  with tf.name_scope(name, default_name="minimum"):
    x1, x2 = binary_arguments_to_tensors(x1, x2)
    return MinMaxOperation(
        tf.minimum, x1, x2, output_shape=_infer_binary_broadcast_shape(
            x1.shape, x2.shape, output_shape)).outputs[0]
1355048
def max(cls):
        """"""
        max_recid = db.session.query(func.max(cls.recid)).scalar()
        return max_recid if max_recid else 0
546149
def _get_scalar_names(self, limit=None):
        """"""
        names = []
        if limit == 'point':
            inpnames = list(self.input_dataset.point_arrays.keys())
        elif limit == 'cell':
            inpnames = list(self.input_dataset.cell_arrays.keys())
        else:
            inpnames = self.input_dataset.scalar_names
        for name in inpnames:
            arr = self.input_dataset.get_scalar(name)
            rng = self.input_dataset.get_data_range(name)
            if arr is not None and arr.size > 0 and (rng[1]-rng[0] > 0.0):
                names.append(name)
        try:
            self._last_scalars = names[0]
        except IndexError:
            pass
        return names
53090
public static double findMaxRow( final int blockLength ,
                                          final DSubmatrixD1 Y ,
                                          final int row , final int colStart ) {
        final int height = Math.min(blockLength , Y.row1-Y.row0);

        final double dataY[] = Y.original.data;

        double max = 0;

        for( int j = Y.col0; j < Y.col1; j += blockLength ) {
            int width = Math.min( blockLength , Y.col1 - j );

            int index = Y.row0*Y.original.numCols + height*j + row*width;

            if( j == Y.col0 ) {
                index += colStart;

                for( int k = colStart; k < width; k++ ) {
                    double v = Math.abs(dataY[index++]);
                    if( v > max ) {
                        max = v;
                    }
                }
            } else {
                for( int k = 0; k < width; k++ ) {
                    double v = Math.abs(dataY[index++]);
                    if( v > max ) {
                        max = v;
                    }
                }
            }
        }

        return max;
    }
216141
def min(self):
        
        res = self._qexec("min(%s)" % self._name)
        if len(res) > 0:
            self._min = res[0][0]
        return self._min
1101354
def min(self, default=None):
        
        return numpy.asscalar(numpy.min(self.values)) if self.values else default
1229310
def __find_smallest(self):
        """"""
        minval = sys.maxsize
        for i in range(self.n):
            for j in range(self.n):
                if (not self.row_covered[i]) and (not self.col_covered[j]):
                    if minval > self.C[i][j]:
                        minval = self.C[i][j]
        return minval
285634
def getoneblock(astr, start, end):
    """"""
    alist = astr.split(start)
    astr = alist[-1]
    alist = astr.split(end)
    astr = alist[0]
    return astr
538818
def _min(self):
        """"""
        return (
            self.range[0] if (self.range and self.range[0] is not None) else
            (min(self.yvals) if self.yvals else None)
        )
852880
function (low, high, max) {
            var length = high - low;

            if (length < 0) {
                return {
                    min: -1,
                    max: -1
                };
            }

            low = util.clamp(low, 0, max);
            high = util.clamp(low + length, 0, max);
            if (high - low < length) {
                low = util.clamp(high - length, 0, max);
            }
            return {
                min: low,
                max: high
            };
        }
741430
def scale_values(numbers, num_lines=1, minimum=None, maximum=None):
    ""

    # find min/max values, ignoring Nones
    filtered = [n for n in numbers if n is not None]
    min_ = min(filtered) if minimum is None else minimum
    max_ = max(filtered) if maximum is None else maximum
    dv = max_ - min_

    # clamp
    numbers = [max(min(n, max_), min_) if n is not None else None for n in numbers]

    if dv == 0:
        values = [4 * num_lines if x is not None else None for x in numbers]
    elif dv > 0:
        num_blocks = len(blocks) - 1

        min_index = 1.
        max_index = num_lines * num_blocks

        values = [
            ((max_index - min_index) * (x - min_)) / dv + min_index
            if not x is None else None for x in numbers
        ]

        values = [round(v) or 1 if not v is None else None for v in values]
    return values
669074
def _nan_minmax_object(func, fill_value, value, axis=None, **kwargs):
    
    valid_count = count(value, axis=axis)
    filled_value = fillna(value, fill_value)
    data = getattr(np, func)(filled_value, axis=axis, **kwargs)
    if not hasattr(data, 'dtype'):  # scalar case
        data = dtypes.fill_value(value.dtype) if valid_count == 0 else data
        return np.array(data, dtype=value.dtype)
    return where_method(data, valid_count != 0)