plottable_array_and_units returns 5 things:
Returns
-------
scaled_array : np.ndarray
factor : float
units_str : str or None
Display units of the scaled values.
xmin : float
xmax : float
This, and any other function that returns more than 2ish items, should be converted to a namedtuple.
That would mean you could access scaled_array as plottable_array_and_units()[0] as you would currently or plottable_array_and_units().scaled_array.
This is generally good practice as confusion about positional order of return values is similar to having too many positional arguments in a function. It's better to name them.
plottable_array_and_unitsreturns 5 things:This, and any other function that returns more than 2ish items, should be converted to a namedtuple.
That would mean you could access
scaled_arrayasplottable_array_and_units()[0]as you would currently orplottable_array_and_units().scaled_array.This is generally good practice as confusion about positional order of return values is similar to having too many positional arguments in a function. It's better to name them.