Special handle for finding bounds on constrained dists.

        Example:
            >>> d0 = chaospy.Uniform()
            >>> dist = chaospy.J(d0, d0+chaospy.Uniform())
            >>> print(dist.range())
            [[0. 0.]
             [1. 2.]]
509200
def _range(self, xloc, cache):
        
        uloc = numpy.zeros((2, len(self)))
        for dist in evaluation.sorted_dependencies(self, reverse=True):
            if dist not in self.inverse_map:
                continue
            idx = self.inverse_map[dist]
            xloc_ = xloc[idx].reshape(1, -1)
            uloc[:, idx] = evaluation.evaluate_bound(
                dist, xloc_, cache=cache).flatten()
        return uloc
902659
def dist(*args)
      case args.length
      when 4
        return dist2d(*args)
      when 6
        return dist3d(*args)
      else
        raise ArgumentError, 'takes 4 or 6 parameters'
      end
    end
20690
def distCEIL2D(x1,y1,x2,y2):
    """"""
    xdiff = x2 - x1
    ydiff = y2 - y1
    return int(math.ceil(math.sqrt(xdiff*xdiff + ydiff*ydiff)))
47251
def known_dists():
    ''''''
    return (
        dist for dist in pkg_resources.working_set
        if any(k in ENTRYPOINTS for k in dist.get_entry_map().keys())
    )
145036
def _compute_distance(cls, dists, coeffs):
        
        return coeffs['b3']*np.log10(np.sqrt(dists.rjb**2. + coeffs['b4']**2.))
1320211
def _stieltjes_approx(dist, order, accuracy, normed, **kws):
    """"""
    kws["rule"] = kws.get("rule", "C")
    assert kws["rule"].upper() != "G"

    absisas, weights = chaospy.quad.generate_quadrature(
        accuracy, dist.range(), **kws)
    weights = weights*dist.pdf(absisas)

    poly = chaospy.poly.variable(len(dist))
    orth = [poly*0, poly**0]

    inner = numpy.sum(absisas*weights, -1)
    norms = [numpy.ones(len(dist)), numpy.ones(len(dist))]
    coeff1 = []
    coeff2 = []

    for _ in range(order):

        coeff1.append(inner/norms[-1])
        coeff2.append(norms[-1]/norms[-2])
        orth.append((poly-coeff1[-1])*orth[-1] - orth[-2]*coeff2[-1])

        raw_nodes = orth[-1](*absisas)**2*weights
        inner = numpy.sum(absisas*raw_nodes, -1)
        norms.append(numpy.sum(raw_nodes, -1))

        if normed:
            orth[-1] = orth[-1]/numpy.sqrt(norms[-1])

    coeff1.append(inner/norms[-1])
    coeff2.append(norms[-1]/norms[-2])
    coeff1 = numpy.transpose(coeff1)
    coeff2 = numpy.transpose(coeff2)
    norms = numpy.array(norms[1:]).T
    orth = orth[1:]
    return orth, norms, coeff1, coeff2
390575
def cycle_dist(x, y, n):
    
    dist = abs(x - y) % n
    if dist >= 0.5 * n:
        dist = n - dist
    return dist
389884
def get_distribution(dist):
    """"""
    if isinstance(dist, six.string_types):
        dist = Requirement.parse(dist)
    if isinstance(dist, Requirement):
        dist = get_provider(dist)
    if not isinstance(dist, Distribution):
        raise TypeError("Expected string, Requirement, or Distribution", dist)
    return dist
306534
def distL1(x1,y1,x2,y2):
    """"""
    return int(abs(x2-x1) + abs(y2-y1)+.5)
176307
def bounds(self):
        
        bounds = []
        for p in self.params:
            if p.fixed:
                if p.value >= 0.0:
                    bounds.append([np.nextafter(p.value, 0), p.value])
                else:
                    bounds.append([p.value, np.nextafter(p.value, 0)])
            else:
                bounds.append([p.min, p.max])
        return bounds
711490
def calc_LD(M,pos,i_start=[0],max_dist=1000000):
    
    RV = []
    DIST = []
    for start in i_start:
        pos0 = pos[start]
        v0  = M[:,start]
        Iselect = sp.nonzero(sp.absolute(pos-pos0)<=max_dist)[0]
        rv = sp.zeros(len(Iselect))
        for i in range(len(Iselect)):
            rv[i] = (sp.corrcoef(v0,M[:,Iselect[i]])[0,1])**2
        #sort by distance
        dist = sp.absolute(pos[Iselect]-pos0)
        RV.extend(rv)
        DIST.extend(dist)
    RV = sp.array(RV)
    DIST = sp.array(DIST)
    II = DIST.argsort()
    return [DIST[II],RV[II]]
1241333
def find_contig_distribution(contig_lengths_dict):
    
    # Initialise the dictionary
    contig_len_dist_dict = dict()
    for file_name, contig_lengths in contig_lengths_dict.items():
        # Initialise integers to store the number of contigs that fall into the different bin sizes
        over_1000000 = 0
        over_500000 = 0
        over_100000 = 0
        over_50000 = 0
        over_10000 = 0
        over_5000 = 0
        other = 0
        for contig_length in contig_lengths:
            # Depending on the size of the contig, increment the appropriate integer
            if contig_length > 1000000:
                over_1000000 += 1
            elif contig_length > 500000:
                over_500000 += 1
            elif contig_length > 100000:
                over_100000 += 1
            elif contig_length > 50000:
                over_50000 += 1
            elif contig_length > 10000:
                over_10000 += 1
            elif contig_length > 5000:
                over_5000 += 1
            else:
                other += 1
        # Populate the dictionary with a tuple of each of the size range frequencies
        contig_len_dist_dict[file_name] = (over_1000000,
                                           over_500000,
                                           over_100000,
                                           over_50000,
                                           over_10000,
                                           over_5000,
                                           other)
    return contig_len_dist_dict
53683
def bounds_handler(ctx, param, value):
    """"""
    retval = from_like_context(ctx, param, value)
    if retval is None and value is not None:
        try:
            value = value.strip(", []")
            retval = tuple(float(x) for x in re.split(r"[,\s]+", value))
            assert len(retval) == 4
            return retval
        except Exception:
            raise click.BadParameter(
                "{0!r} is not a valid bounding box representation".format(value)
            )
    else:  # pragma: no cover
        return retval
595308
def remove_symbol_from_dist(dist, index):
    '''
    
    '''
    if type(dist) is not Distribution:
        raise TypeError("remove_symbol_from_dist got an object ot type {0}".format(type(dist)))

    new_prob = dist.prob.copy()
    new_prob[index]=0
    new_prob /= sum(new_prob)
    return Distribution(new_prob)
1164072
private void findFullGridIntBounds() {
		int[] iIntBounds = getIntBounds(ibounds);

		bounds = new int[6];
		if (jbounds==null) {
			bounds = iIntBounds;
		} else {
			int[] jIntBounds = getIntBounds(jbounds);
			bounds[0] = Math.min(iIntBounds[0],jIntBounds[0]);
			bounds[1] = Math.min(iIntBounds[1],jIntBounds[1]);
			bounds[2] = Math.min(iIntBounds[2],jIntBounds[2]);
			bounds[3] = Math.max(iIntBounds[3],jIntBounds[3]);
			bounds[4] = Math.max(iIntBounds[4],jIntBounds[4]);
			bounds[5] = Math.max(iIntBounds[5],jIntBounds[5]);
		}
	}
360772
def get_bounding_box(self, maxdist):
        
        return utils.get_bounding_box([ps.location for ps in self], maxdist)
672085
def _compute_bounds(self, axis, view):
        
        is_vertical = self._is_vertical
        pos = self._pos
        if axis == 0 and is_vertical:
            return (pos[0, 0], pos[0, 0])
        elif axis == 1 and not is_vertical:
            return (self._pos[0, 1], self._pos[0, 1])

        return None