tools

Module Contents

class text_format[source]
PURPLE = 
CYAN = 
DARKCYAN = 
BLUE = 
GREEN = 
YELLOW = 
WHITE = 
RED = 
BOLD = 
UNDERLINE = 
END = 
software_version()[source]
find_and_replace(begin_char, end_char, theStr, replace_function)[source]
create_unique_dirname(dirname)[source]
applyEquation(objectIn, s)[source]

Apply literal expression based on an object

Parameters
  • objectIn – Object

  • s – literal expression. Float variables taken from the object are written between {}, int between []. Example: s=”{x}+{y}*2” if x and y are attributes of objectIn.

Returns

value (float)

arithmeticEval(s)[source]
isNonePrintMessage(theObject, theMessage, show_type=SHOW_INFO)[source]
getPath_workspace()[source]
getLineInfo(lvl=1)[source]
printIfShown(theStr, show_type=SHOW_DEBUG, isToPrint=True, appendTypeName=True)[source]
universalPath(thePath)[source]
add_suffix_to_path(thePath, suffix)[source]
get_object_attrs(obj)[source]
rsetattr(obj, attr, val)[source]
rgetattr(obj, attr)[source]

Recursively get an attribute from object. Extends getattr method

Parameters
  • obj – object

  • attr – attribute to get

Returns

indentParagraph(text_in, indent_level=1)[source]
truncate(theStr, truncsize)[source]
str_all_attr(theObject, max_recursion_level)[source]
get_2D_pareto(xList, yList, max_X=True, max_Y=True)[source]
get_ND_pareto(objectives_list, are_maxobjectives_list=None)[source]

Return the N-D pareto front

Parameters
  • objectives_list – list of list of objectives: example [[0,1], [1,1], [2,2]]

  • are_maxobjectives_list – for each objective, tells if they are to be maximized or not: example [True, False]. Default: False

Returns

extracted_pareto, indices: list of [x, y, …] points forming the pareto front, and list of the indices of these points from the base list.

delete_indices_from_list(indices, theList)[source]

Delete elements from list at indices :param indices: list :param theList: list