consolidate¶
Package Contents¶
Classes¶
Functions¶
Attributes¶
-
class
ListDataStruct
(compress_save=False)[source]¶ Bases:
ListDataStruct_Interface
-
save
(filename)[source]¶ Save data using json format. The data to be saved are automatically detected, see
obj_to_json()
-
extract_collection_from_indices
(indices)[source]¶ Extract data from the collection at specific indices, and return it as new collection
-
_format_str_save
()[source]¶ Save data using json format. The data to be saved are automatically detected, see
obj_to_json()
-
extract_collection_from_attribute
(attributeName)[source]¶ Convenience class to create a sub-collection from an attribute of all the items.
Parameters: attributeName – Name of the attribute to extract Returns: ListDataStruct
-
delete_points_at_indices
(indices)[source]¶ Delete several elements from the Collection
Parameters: indices – list of indices to delete
-
-
class
AutosaveStruct
(dataStruct, filename='', change_filename_if_exists=True)[source]¶ Structure that provides automated save of DataStructures
-
getPath_workspace
()[source]¶ Get workspace path (i.e., location where optimeed files will be created). Create directory if doesn’t exist.
-
rsetattr
(obj, attr, val)[source]¶ setattr, but recursively. Works with list (i.e. theObj.myList[0].var_x)
-
class
Parametric_parameter
(analyzed_attribute, reference_device)[source]¶ Abstract class for a parametric parameter
-
class
Parametric_minmax
(analyzed_attribute, reference_device, minValue, maxValue, is_relative=False, npoints=10)[source]¶ Bases:
Parametric_parameter
Abstract class for a parametric parameter
-
class
Parametric_analysis
(theParametricParameter, theCharacterization, filename_collection=None, autosave=False)[source]¶ Bases:
optimeed.core.Option_class
-
leastSquare
(function, functionArgs, x_data, y_data)[source]¶ Least square calculation (sum (y-ŷ)^2)
Parameters: - function – Function to fit
- functionArgs – Arguments of the function
- x_data – x-axis coordinates of data to fit
- y_data – y-axis coordinates of data to fit
Returns: least squares
-
do_fit
(fitFunction, x_data, y_data, *args, fitCriterion=leastSquare)[source]¶ Main method to fit a function
Parameters: - fitFunction – the function to fit (link to it)
- x_data – x-axis coordinates of data to fit
- y_data – y-axis coordinates of data to fit
- args – for each parameter: [min, max] admissible value
- fitCriterion – fit criterion to minimize. Default: least square
Returns: [arg_i_optimal, …], y estimated, error.
-
evaluate_sensitivities
(theSensitivityParameters: SensitivityParameters, numberOfCores=2, studyname='sensitivity', indices_to_evaluate=None)[source]¶ Evaluate the sensitivities
Parameters: - theSensitivityParameters – class`~SensitivityParameters`
- numberOfCores – number of core for multicore evaluation
- studyname – Name of the study, that will be the subfolder name in workspace
- indices_to_evaluate – if None, evaluate all param_values, otherwise if list: evaluate subset of param_values defined by indices_to_evaluate
Returns: collection of class`~SensitivityResults`
-
evaluate_sensitivities_fast
(theSensitivityParameters: SensitivityParameters)[source]¶ Deactivate multicore and save management for fast results
-
class
SensitivityParameters
(param_values, list_of_optimization_variables, theDevice, theMathsToPhys, theCharacterization)[source]¶ Bases:
optimeed.core.SaveableObject
Abstract class for dynamically type-hinted objects. This class is to solve the special case where the exact type of an attribute is not known before runtime, yet has to be saved.
-
class
Restrained_SensitivityParameters
(*args)[source]¶ Bases:
SensitivityParameters
Class to perform Sensitivty Analysis on a subset of the full parameters
-
class
SensitivityAnalysis_LibInterface
(theSensitivityParameters: SensitivityParameters, theObjectives)[source]¶ Interface a library for sensitivity analysis
Parameters: - theSensitivityParameters –
optimeed.consolidate.sensitivity_analysis.SensitivityParameters
- theObjectives – array-like objective associated to evaluation, using Sobol sampling
-
get_convergence_S1
(stepsize=1)[source]¶ Create dictionary for convergence plot - First order index
Parameters: stepsize – increments of sampling size Returns: Dictionary
- theSensitivityParameters –
-
prepare_embarrassingly_parallel_sensitivity
(theSensitivityParameters, studyname)[source]¶ Initialize sensitivity analysis folder :param theSensitivityParameters: :param studyname: Folder to be created in Workspace :return:
-
gather_embarrassingly_parallel_sensitivity
(theSensitivityParameters, studyname)[source]¶ Gather the results. If some are missing, display the indices.
Parameters: - theSensitivityParameters –
- studyname –
Returns:
-
launch_embarrassingly_parallel_sensitivity
(theSensitivityParameters, studyname, base_index, mult_factor=1)[source]¶ Single job launcher for an embarrassingly parallel evaluation :param theSensitivityParameters: :param studyname: Name of the folder in Workspace in which the study is performed :param base_index: start index (Formula: index to evaluate = base_index*mult_factor) :param mult_factor: Multiplication factor of the base_index. Allows to overcome QOSMaxJobPerUserLimit in clusters. :return: