def determine_adder_scaler(ref0, ref, adder, scaler):
    '\n    Determine proper values of adder and scaler based on user arguments.\n\n    Adder and Scaler are used internally because the transformation is\n    slightly more efficient.\n\n    Parameters\n    ----------\n    ref0 : float or ndarray, optional\n        Value of response variable that scales to 0.0 in the driver.\n    ref : float or ndarray, optional\n        Value of response variable that scales to 1.0 in the driver.\n    adder : float or ndarray, optional\n        Value to add to the model value to get the scaled value. Adder\n        is first in precedence.\n    scaler : float or ndarray, optional\n        Value to multiply the model value to get the scaled value. Scaler\n        is second in precedence.\n\n    Returns\n    -------\n    tuple\n        Adder and scaler, properly formatted and based on ref/ref0 if provided.\n\n    Raises\n    ------\n    ValueError\n        If both ref/ref0 and adder/scaler were provided.\n\n    Notes\n    -----\n    The response can be scaled using ref and ref0.\n    The argument :code:`ref0` represents the physical value when the scaled value is 0.\n    The argument :code:`ref` represents the physical value when the scaled value is 1.\n    '
    if ((ref0 is not None) or (ref is not None)):
        if ((scaler is not None) or (adder is not None)):
            raise ValueError('Inputs ref/ref0 are mutually exclusive with scaler/adder')
        if (ref is None):
            ref = 1.0
        if (ref0 is None):
            ref0 = 0.0
        adder = (- ref0)
        scaler = (1.0 / (ref + adder))
    else:
        if (scaler is None):
            scaler = 1.0
        if (adder is None):
            adder = 0.0
    adder = format_as_float_or_array('adder', adder, val_if_none=0.0, flatten=True)
    scaler = format_as_float_or_array('scaler', scaler, val_if_none=1.0, flatten=True)
    return (adder, scaler)
Determine proper values of adder and scaler based on user arguments.

Adder and Scaler are used internally because the transformation is
slightly more efficient.

Parameters
----------
ref0 : float or ndarray, optional
    Value of response variable that scales to 0.0 in the driver.
ref : float or ndarray, optional
    Value of response variable that scales to 1.0 in the driver.
adder : float or ndarray, optional
    Value to add to the model value to get the scaled value. Adder
    is first in precedence.
scaler : float or ndarray, optional
    Value to multiply the model value to get the scaled value. Scaler
    is second in precedence.

Returns
-------
tuple
    Adder and scaler, properly formatted and based on ref/ref0 if provided.

Raises
------
ValueError
    If both ref/ref0 and adder/scaler were provided.

Notes
-----
The response can be scaled using ref and ref0.
The argument :code:`ref0` represents the physical value when the scaled value is 0.
The argument :code:`ref` represents the physical value when the scaled value is 1.
def determine_adder_scaler(ref0, ref, adder, scaler):
    '\n    Determine proper values of adder and scaler based on user arguments.\n\n    Adder and Scaler are used internally because the transformation is\n    slightly more efficient.\n\n    Parameters\n    ----------\n    ref0 : float or ndarray, optional\n        Value of response variable that scales to 0.0 in the driver.\n    ref : float or ndarray, optional\n        Value of response variable that scales to 1.0 in the driver.\n    adder : float or ndarray, optional\n        Value to add to the model value to get the scaled value. Adder\n        is first in precedence.\n    scaler : float or ndarray, optional\n        Value to multiply the model value to get the scaled value. Scaler\n        is second in precedence.\n\n    Returns\n    -------\n    tuple\n        Adder and scaler, properly formatted and based on ref/ref0 if provided.\n\n    Raises\n    ------\n    ValueError\n        If both ref/ref0 and adder/scaler were provided.\n\n    Notes\n    -----\n    The response can be scaled using ref and ref0.\n    The argument :code:`ref0` represents the physical value when the scaled value is 0.\n    The argument :code:`ref` represents the physical value when the scaled value is 1.\n    '
    if ((ref0 is not None) or (ref is not None)):
        if ((scaler is not None) or (adder is not None)):
            raise ValueError('Inputs ref/ref0 are mutually exclusive with scaler/adder')
        if (ref is None):
            ref = 1.0
        if (ref0 is None):
            ref0 = 0.0
        adder = (- ref0)
        scaler = (1.0 / (ref + adder))
    else:
        if (scaler is None):
            scaler = 1.0
        if (adder is None):
            adder = 0.0
    adder = format_as_float_or_array('adder', adder, val_if_none=0.0, flatten=True)
    scaler = format_as_float_or_array('scaler', scaler, val_if_none=1.0, flatten=True)
    return (adder, scaler)