class documentation

class InputArguments(list):

Constructor: InputArguments(args)

View In Hierarchy

Store clean input argument paths.

Allow to compute short names from paths which may be numbered or made unique. Short names can be retrieved by path name or by index in the list through the methods to_short_name, to_unique_short_name and to_numbered_short_name which all use algorithm_name_from_path.

Use genericsettings.algorithm_names when given for the respective position.

Usecases:

input_args = InputArguments(args)
args = list(input_args)  # args[i] == input_args[i]
algId = input_args.to_unique_short_name(args[1])
plt.text(input_args.to_numbered_short_name(alg, maxlen=True))

Details: names from genericsettings.algorithm_names are not shortened for display.

Method __init__ Undocumented
Method append return slightly cleaned path
Method to_numbered_short_name return a unique label like "1:Nelder" by position on input
Method to_short_name The name is generated with algorithm_name_from_path or taken
Method to_unique_short_name append a number in case name(path) has previous duplicates
Property label_length Return either genericsettings.len_of_names_in_pprldmany_legend or the minimal length for the names in self.short_names so that all names are different in 2 or more characters. At least 12 characters are displayed unless ...
Property short_names Undocumented
Method _to_path return also a path when isinstance(path, int)
def __init__(self, args=()):

Undocumented

def append(self, p):

return slightly cleaned path

def to_numbered_short_name(self, path_or_index, maxlen=None):

return a unique label like "1:Nelder" by position on input

def to_short_name(self, path_or_index, maxlen=None):

The name is generated with algorithm_name_from_path or taken

from genericsettings.algorithm_names when given.

def to_unique_short_name(self, path_or_index):

append a number in case name(path) has previous duplicates

@property
label_length =

Return either genericsettings.len_of_names_in_pprldmany_legend or the minimal length for the names in self.short_names so that all names are different in 2 or more characters. At least 12 characters are displayed unless 0 < genericsettings.len_of_names_in_pprldmany_legend < 12. This function is used for the algorithm names legend.

Copy-pasted old code which is now removed.

@property
short_names =

Undocumented

def _to_path(self, path):

return also a path when isinstance(path, int)