def unit_commitment_milp_constraint_rule(backend_model, loc_tech, timestep):
    """
    Constraining the number of integer units
    :math:`operating_units(loc_tech, timestep)` of a technology which
    can operate in a given timestep, based on maximum purchased units
    :math:`units(loc_tech)`

    .. container:: scrolling-wrapper

        .. math::

            \\boldsymbol{operating\\_units}(loc::tech, timestep) \\leq
            \\boldsymbol{units}(loc::tech)
            \\quad \\forall loc::tech \\in loc::techs_{milp},
            \\forall timestep \\in timesteps

    """

    return (
        backend_model.operating_units[loc_tech, timestep]
        <= backend_model.units[loc_tech]
    )