performance_histories module¶
A class to implement a collection of performance histories.
- class gemseo_benchmark.results.performance_histories.PerformanceHistories(*histories)[source]¶
Bases:
MutableSequence
A collection of performance histories.
- Parameters:
*histories (PerformanceHistory) – The performance histories.
- append(value)¶
S.append(value) – append value to the end of the sequence
- clear() None -- remove all items from S ¶
- compute_maximum()[source]¶
Return the itemwise maximum history of the collection.
- Returns:
The itemwise maximum history of the collection.
- Return type:
- compute_median(compute_low_median=True)[source]¶
Return the itemwise median history of the collection.
- Parameters:
compute_low_median (bool) –
Whether to compute the low median (rather than the high median).
By default it is set to True.
- Returns:
The itemwise median history of the collection.
- Return type:
- compute_minimum()[source]¶
Return the itemwise minimum history of the collection.
- Returns:
The itemwise minimum history of the collection.
- Return type:
- count(value) integer -- return number of occurrences of value ¶
- extend(values)¶
S.extend(iterable) – extend sequence by appending elements from the iterable
- index(value[, start[, stop]]) integer -- return first index of value. ¶
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- insert(index, history)[source]¶
Insert a performance history in the collection.
- Parameters:
index (int) – The index where to insert the performance history.
history (PerformanceHistory) – The performance history.
- Return type:
None
- plot_algorithm_histories(axes, algorithm_name, max_feasible_objective, plot_all, color, marker, alpha, markevery)[source]¶
Plot the histories associated with an algorithm.
- Parameters:
axes (Axes) – The axes on which to plot the performance histories.
algorithm_name (str) – The name of the algorithm.
max_feasible_objective (float) – The ordinate for infeasible history items.
plot_all (bool) – Whether to plot all the performance histories.
color (str) – The color of the plot.
marker (str) – The marker type of the plot.
alpha (float) – The opacity level for overlapping areas. Refer to the Matplotlib documentation.
markevery (MarkeveryType) – The sampling parameter for the markers of the plot. Refer to the Matplotlib documentation.
- Returns:
The minimum feasible objective value of the median history or
None
if the median history has no feasible item.- Return type:
float | None
- pop([index]) item -- remove and return item at index (default last). ¶
Raise IndexError if list is empty or index is out of range.
- remove(value)¶
S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.
- reverse()¶
S.reverse() – reverse IN PLACE