@classmethod
def register_unit(cls, dimension, name, conversion_to_base_unit):
    """
        Register a new unit under the given dimension.

        Parameters
        ----------
        dimension : unicode
            The dimension to which the unit belongs.
        name : unicode
            The identifier of the unit.
        conversion_to_base_unit : float
            The conversion factor for converting the given unit to the
            dimension's base unit.

        Raises
        ------
        ValueError
            If the given dimension does not exist.
        ValueError
            If the given unit already exists for the given dimension.
        """
    try:
        base_unit = cls._defaults_per_dimension[dimension]
    except KeyError:
        raise ValueError('Dimension %s does not exist' % dimension)
    if name in cls._units_per_dimension[dimension]:
        raise ValueError('Unit %s already exists' % name)
    cls._units_per_dimension[dimension] += name,
    cls._conversion_factors[name, base_unit] = conversion_to_base_unit
    cls._conversion_factors[base_unit, name] = 1.0 / conversion_to_base_unit
