def apply_generic_variability(tmodel, va, inplace=True):
    """
    Reactions a dealt with cobra, but the other variables added use pytfa's
    interface: the class GenericVariable. We use a different method to apply
    variability directly in the solver

    :param tmodel:
    :param va:
    :param inplace:
    :return:
    """
    if inplace:
        _tmodel = tmodel
    else:
        _tmodel = tmodel.copy()
    for varname in va.index:
        the_min, the_max = va.loc[varname, ['minimum', 'maximum']]
        _tmodel._var_dict[varname].variable.lb = the_min
        _tmodel._var_dict[varname].variable.ub = the_max
    return _tmodel
