def map_base_attributes(cube, mapper_class, naming, locale=None):
    """Map all base attributes of `cube` using mapping function `mapper`.
    `naming` is a naming convention object. Returns a tuple (`fact_name`,
    `mapping`) where `fact_name` is a fact table name and `mapping` is a
    dictionary of attribute references and their physical column
    references."""

    base = [attr for attr in cube.all_attributes if attr.is_base]

    mapper = mapper_class(cube, naming, locale)
    mapped = {attr.ref:mapper[attr] for attr in base}

    return (mapper.fact_name, mapped)