tools
¶
Module Contents¶
Classes¶
Functions¶
Attributes¶
-
_workspace_path
¶
-
create_unique_dirname
(dirname)[source]¶ Create dirname if it doesn’t exists, otherwise append an integer to dirname and create it.
Parameters: dirname – name of the directory to create Returns: name of the directory created
-
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)
-
getPath_workspace
()[source]¶ Get workspace path (i.e., location where optimeed files will be created). Create directory if doesn’t exist.
-
setPath_workspace
(thePath)[source]¶ Set workspace path (i.e., location where optimeed files will be created)
-
rsetattr
(obj, attr, val)[source]¶ setattr, but recursively. Works with list (i.e. theObj.myList[0].var_x)
-
indentParagraph
(text_in, indent_level=1)[source]¶ Add ‘ ‘ at beginning of strings and after each ‘ ‘.
-
get_2D_pareto
(xList, yList, max_X=True, max_Y=True)[source]¶ Get 2D pareto front
Parameters: - xList – list of x coordinates
- yList – list of y coordinates
- max_X – True if x is to maximize
- max_Y – true if y is to maximize
Returns: x pareto-optimal coordinates, y pareto-optimal coordinates, indices of these points in input parameters
-
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
Parameters: - indices – list
- theList – list