def METHOD_NAME(phase_compositions, bulk_composition):
    """
    Performs weighted constrained least squares on a set of phase compositions
    to find the amount of those phases that best-fits a given bulk composition.
    The fitting applies appropriate non-negativity constraints
    (i.e. no phase can have a negative abundance in the bulk).
    :param phase_compositions: The composition of each phase.
        Can be in weight or mole amounts.
    :type phase_compositions: 2D numpy.array
    :param bulk_composition: The bulk composition of the composite.
        Must be in the same units as the phase compositions.
    :type bulk_composition: numpy.array
    :returns: Optimized molar fractions, corresponding covariance matrix and the
        weighted residual.
    :rtype: tuple of 1D numpy.array, 2D numpy.array and float
    """
    n_phases = len(phase_compositions[0])
    inequality_constraints = [-np.eye(n_phases), np.zeros(n_phases)]
    popt, pcov, res = weighted_constrained_least_squares(
        phase_compositions, bulk_composition, None, None, inequality_constraints
    )
    return (popt, pcov, res)