XOutput (class)¶
Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Output/XOutput
-
class
XOutput
(paramexplorer_list=-1, output_list=-1, xoutput_dict=-1, nb_simu=0, simu=-1, path_result='', geo=-1, elec=-1, mag=-1, struct=-1, post=-1, logger_name='Pyleecan.Output', force=-1, init_dict=None, init_str=None)[source]¶ Bases:
pyleecan.Classes.Output.Output
XOutput object: gather all the outputs of all the modules for multiple simulations
-
VERSION
= 1¶
-
count
(x)¶ Return the number of times x appears in the list.
-
insert
(i, x)¶ Insert an item at a given position. The first argument is the index of the element before which to insert, so a.insert(0, x) inserts at the front of the list, and a.insert(len(a), x) is equivalent to a.append(x).
-
pop
(i)¶ Remove the item at the given position in the list, and return it. If no index is specified, a.pop() removes and returns the last item in the list.
-
remove
(x)¶ Remove the first item from the list whose value is equal to x. It raises a ValueError if there is no such item.
-
append
(elem)¶ Method to behave like a list and access quickly to output_list
-
get_simu
(index)¶ Generate a simulation according to index
- Parameters
index (int) – simulation index
- Returns
simu – simulation generated
- Return type
-
keys
()¶ Return xoutput_dict keys to behave like a dict
-
items
()¶ Returns self.xoutput_dict.items to behave like a dict
-
get_param_simu
(idx)¶ Return the list of parameter values for a specific simulation
-
get_paramexplorer
(symbol)¶ Get the ParamExplorer with symbol :param symbol: ParamExplorer symbol :type symbol: str
-
plot_multi
(x_symbol, y_symbol, plot_type='scatter', idx=None, ax=None, title=None)¶ Plot data from a DataKeeper for a given parameter from a ParamExplorer
- x_symbol: str
ParamExplorer or DataKeeper symbol
- y_symbol: str
ParamExplorer or DataKeeper symbol
- plot_type: str
scatter or plot to chose plot type
- idx: slice
To plot only some data
- ax: matplotlib.pyplot.Axe
To put the plot in a specific ax
- title: str
Figure or subfigure title according to ax
- Returns
- Return type
fig or ax
- Raises
-
plot_pareto
(x_symbol, y_symbol, c_symbol=None, cmap=None, ax=None, title=None, grid=False)¶ Plot the pareto front for 2 objective functions
- Parameters
self (XOutput) –
x_symbol (str) – symbol of the first objective function
y_symbol (str) – symbol of the second objective function
c_symbol (str) – optional symbol to set the plot colors
cmap (colormap) – optional colormap
-
plot_generation
(x_symbol, y_symbol, ax=None)¶ Plot every fitness values according to the two fitness
- Parameters
self (XOutput) –
obj1 (str) – symbol of the ParamExplorer or the DataKeeper
obj2 (str) – symbol of the ParamExplorer or the DataKeeper
-
get_pareto_index
()¶ Return index of individuals in the pareto
- Parameters
self (XOutput) –
- Returns
idx_non_dom – list of index of non dominated individuals
- Return type
list
-
save
(save_path='', is_folder=False)¶ Save the object to the save_path
- Parameters
self – A pyleecan object
save_path (str) – path to the folder to save the object
is_folder (bool) – to split the object in different files: separate simulation machine and materials
-
copy
()¶ Return a copy of the class
-
get_logger
()¶ Get the object logger or its parent’s one
- Parameters
obj – A pyleecan object
- Returns
logger – Pyleecan object dedicated logger
- Return type
logging.Logger
-
property
paramexplorer_list
¶ List containing ParamExplorer
- Type
[ParamExplorer]
-
property
output_list
¶ List containing Output for each simulation
- Type
[Output]
-
property
xoutput_dict
¶ Dictionnary containing VarParam DataKeeper results in ndarray
- Type
{DataKeeper}
-
property
nb_simu
¶ Number of simulations excluding reference simulation
- Type
int
- Min
0
-