def prune_comp_sel(sel_list, comp_names):
    """Discover and remove vector component from selection list"""
    comp_slc = slice(None)
    comp_idx = None
    for i, s in enumerate(sel_list):
        try:
            s = s.strip().lower()
            if s in comp_names:
                if comp_idx is not None:
                    raise IndexError(
                        'Multiple vector component slices given, {0}'.
                        format(tuple(sel_list)))
                comp_slc = comp_names.index(s)
                comp_idx = i
        except (TypeError, AttributeError):
            pass
    if comp_idx is not None:
        sel_list.pop(comp_idx)
        comp_idx = None
    return sel_list, comp_slc
