import warnings


def _remove_pd(pars, key, name):
    """
    Remove polydispersity from the parameter list.

    Note: operates in place
    """
    # Bumps style parameter names
    width = pars.pop(key+".width", 0.0)
    n_points = pars.pop(key+".npts", 0)
    if width != 0.0 and n_points != 0:
        warnings.warn("parameter %s not polydisperse in sasview %s"%(key, name))
    pars.pop(key+".nsigmas", None)
    pars.pop(key+".type", None)
    return pars