post module¶
Post-processing for scalability study.
The PostScalabilityStudy
class implements the way as the set of
ScalabilityResult
-based result files
contained in the study directory are graphically post-processed. This class
provides several methods to easily change graphical properties, notably
the plot labels. It also makes it possible to define a cost function per
MDO formulation, converting the numbers of executions and linearizations
of the different disciplines required by a MDO process in an estimation
of the computational cost associated with what would be a scaled version
of the true problem.
Warning
Comparing MDO formulations in terms of estimated true computational time
rather than CPU time of the ScalabilityStudy
is highly
recommended.
Indeed, time is often an obviousness criterion to distinguish between
MDO formulations having the same performance in terms of distance to the
optimum: look at our calculation budget and choose the best formulation
that satisfies this budget, or even saves us time. Thus, it is important
to carefully define these cost functions.
- class gemseo.problems.scalable.data_driven.study.post.PostScalabilityStudy(study_directory)[source]¶
Bases:
object
The PostScalabilityStudy class aims to post-process a list of scalability results stored in a directory.
Constructor.
- Parameters
study_directory (str) – directory of the scalability study.”
- labelize_exec_time(description)[source]¶
Change the description of execution time, used in plotting methods notably.
- Parameters
description (str) – description.
- labelize_is_feasible(description)[source]¶
Change the description of feasibility, used in plotting methods notably.
- Parameters
description (str) – description.
- labelize_n_calls(description)[source]¶
Change the description of number of calls, used in plotting methods notably.
- Parameters
description (str) – description.
- labelize_n_calls_linearize(description)[source]¶
Change the description of number of calls for linearization, used in plotting methods notably.
- Parameters
description (str) – description.
- labelize_original_exec_time(description)[source]¶
Change the description of original execution time, used in plotting methods notably.
- Parameters
description (str) – description.
- labelize_scaling_strategy(description)[source]¶
Change the description of scaling strategy, used in plotting methods notably.
- Parameters
description (str) – description.
- labelize_status(description)[source]¶
Change the description of status, used in plotting methods notably.
- Parameters
description (str) – description.
- plot(legend_loc='upper left', xticks=None, xticks_labels=None, xmargin=0.0, **options)[source]¶
Plot the results using different methods according to the presence or absence of replicate values.
- Parameters
legend_loc (str) –
legend localization
By default it is set to upper left.
list of xticks (default: None)
By default it is set to None.
list of xticks labels (default: None)
By default it is set to None.
xmargin (float) –
margin on left and right sides of the x-axis
By default it is set to 0.0.
options – options for the specialized plot methods
- set_cost_function(formulation, cost)[source]¶
Set cost function for each formulation.
- Parameters
formulation (str) – name of the formulation.
cost (function) – cost function
- set_cost_unit(cost_unit)[source]¶
Set the measurement unit for cost evaluation.
- Parameters
cost_unit (str) – cost unit, e.g. ‘h’, ‘min’, …
- NOMENCLATURE = {'exec_time': 'Execution time (s)', 'is_feasible': 'Feasibility of the solution (0 or 1)', 'n_calls': 'Number of discipline evaluations', 'n_calls_linearize': 'Number of gradient evaluations', 'original_exec_time': 'Pseudo-original execution time', 'scaling_strategy': 'Number of design parameters per type.', 'status': 'Optimizatin status', 'total_calls': 'Total number of evaluations'}¶
- property n_samples¶
Number of samples.
- property names¶
Get the names of the scalability results.
- property optimization_strategies¶