def _dt_from_unit(unit):
    """Infers the timestep based on the unit.


    Arguments:
        unit {string} -- The unit (yr, kyr, Myr, Gyr) under consideration.

    Raises:
        AssertionError -- on malformed input.
    """

    assert unit in ['yr', 'kyr', 'Myr', 'Gyr']

    return {'yr': 1e0,
            'kyr': 1e3,
            'Myr': 1e6,
            'Gyr': 1e9}[unit]