tools
¶
Module Contents¶
-
class
text_format
[source]¶ -
PURPLE
= [95m¶
-
CYAN
= [96m¶
-
DARKCYAN
= [36m¶
-
BLUE
= [94m¶
-
GREEN
= [92m¶
-
YELLOW
= [93m¶
-
WHITE
= [30m¶
-
RED
= [91m¶
-
BOLD
= [1m¶
-
UNDERLINE
= [4m¶
-
END
= [0m¶
-
-
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)
-
rgetattr
(obj, attr)[source]¶ Recursively get an attribute from object. Extends getattr method
Parameters: - obj – object
- attr – attribute to get
Returns:
-
dist
(p, q)[source]¶ Return the Euclidean distance between points p and q. :param p: [x, y] :param q: [x, y] :return: distance (float)
-
sparse_subset
(points, r)[source]¶ Returns a maximal list of elements of points such that no pairs of points in the result have distance less than r. :param points: list of tuples (x,y) :param r: distance :return: corresponding subset (list), indices of the subset (list)
-
integrate
(x, y)[source]¶ Performs Integral(x[0] to x[-1]) of y dx
Parameters: - x – x axis coordinates (list)
- y – y axis coordinates (list)
Returns: integral value
-
my_fourier
(x, y, n, L)[source]¶ Fourier analys
Parameters: - x – x axis coordinates
- y – y axis coordinates
- n – number of considered harmonic
- L – half-period length
Returns: a and b coefficients (y = a*cos(x) + b*sin(y))
-
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.