def candidatesFromDandRlimits(*, eventType='DandR', dLimits=None, rLimits=None
    ):
    """
    This is implemented as a generator because if large limits are given, it is
    easy to get a very large candidate list, so it's best to
    create the candidates one at a time.
    """
    if eventType == 'Donly':
        for D in range(dLimits[0], dLimits[1] + 1):
            yield D, None
    elif eventType == 'Ronly':
        for R in range(rLimits[0], rLimits[1] + 1):
            yield None, R
    elif eventType == 'DandR':
        for D in range(dLimits[0], dLimits[1] + 1):
            for R in range(rLimits[0], rLimits[1] + 1):
                yield D, R
    else:
        raise Exception('Unrecognized edvent type')
