def mass_to_volume_mixing_ratio(mass_mixing_ratio, molecular_weight=None,
    molecular_weight_air=28.964):
    """
    g/g or g/kg to mole/mole

    Converts from mass mixing ratio (mass per unit mass) to volume
    mixing ratio (volume per unit volume)

    Args:

        mass_mixing_ratio (array):
            The quantity to be transformed in units of :math:`g/g`.

        molecular_weight (float):
            The molecular weight of the gas in :math:`g/mol`.

        molecular_weight_air (float,optional):
            The molecular weight of dry air.
            If it is not provided, the value for dry air on earth (28.964 g/mol)
            is used.

    Returns:

        volume_mixing_ratio (array):
            The volume mixing ratio of the gas.

    Raises:

        ValueError:
            if the molecular weight is not provided.

    """
    if molecular_weight is None:
        raise ValueError('The molecular weight must be provided')
    volume_mixing_ratio = (mass_mixing_ratio * molecular_weight_air /
        molecular_weight)
    return volume_mixing_ratio
