I've noticed that in many functions the same parameters are repeated. Example:
def run_inspection(first_panel, last_panel, results, settings, references,
registration_settings):
"""
Runs multithreading for inspection stage.
Args:
first_panel (int): Number of the first panel to be inspected.
last_panel (int): Number of the last panel to be inspected.
results (data_management.StaticVar): Contains the results string.
settings (dictionary): General settings dictionary.
references (list): Contains dictionaries of references data.
registration_settings (dictionary): Contains data about the registration process.
Raises:
excepts.FatalError("WRONG_UV_INSPECTION_FLAG"): If the parameter
to define if UV light will be used has an incorrect value.
Returns:
total_time (float): Time it took to create results.
"""
and
def run_debug(first_panel, last_panel, results, settings, references):
"""
Runs multithreading for debug stage.
Args:
first_panel (int): Number of the first panel to be inspected.
last_panel (int): Number of the last panel to be inspected.
results (data_management.StaticVar): Contains the results string.
settings (dictionary): General configuration dictionary.
references (list): Contains dictionaries of references data.
Raises:
excepts.FatalError("WRONG_UV_INSPECTION_FLAG"): If the parameter
to define if UV light will be used has an incorrect value.
Returns:
total_time (float): Time it took to create results.
"""
These parameters are constantly repeated in many functions (more than six). Some functions that use these parameters aren't related to each other.
Should I document all the parameters, exceptions and return values of a function, even though they are already documented in many other functions?