consolidate

Package Contents

Classes

Functions

Attributes

class Option_class[source]
add_option(idOption, theOption)[source]
get_option_name(idOption)[source]
get_option_value(idOption)[source]
set_option(idOption, value)[source]
_pack_options()[source]
__str__()[source]

Return str(self).

class Option_int(name, based_value, choices=None)[source]

Bases: Base_Option

set_value(value)[source]
class ListDataStruct(compress_save=False)[source]

Bases: ListDataStruct_Interface

__len__()[source]
get_length()[source]
clone(filename)[source]

Clone the datastructure to a new location

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()

_format_data_lines()[source]
_get_json_module_tree()[source]
add_data(data_in)[source]

Add a data to the list

get_data()[source]

Get full list of datas

get_data_generator()[source]

Get a generator to all the data stored

get_data_at_index(index)[source]
set_data(theData)[source]

Set full list of datas

set_data_at_index(data_in, index)[source]

Replace data at specific index

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
reset_data()[source]
delete_points_at_indices(indices)[source]

Delete several elements from the Collection

Parameters:indices – list of indices to delete
merge(collection)[source]

Merge a collection with the current collection

Parameters:collectionCollection to merge
get_nbr_elements()[source]
Returns:the number of elements contained inside the structure
class AutosaveStruct(dataStruct, filename='', change_filename_if_exists=True)[source]

Structure that provides automated save of DataStructures

__str__()[source]

Return str(self).

get_filename()[source]

Get set filename

set_filename(filename, change_filename_if_exists)[source]
Parameters:
  • filename – Filename to set
  • change_filename_if_exists – If already exists, create a new filename
stop_autosave()[source]

Stop autosave

start_autosave(timer_autosave, safe_save=True)[source]

Start autosave

save(safe_save=True)[source]

Save

get_datastruct()[source]

Return :class:’~DataStruct_Interface’

__getstate__()[source]
__setstate__(state)[source]
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)

rgetattr(obj, attr)[source]

getattr, but recursively. Works with list.

class Parametric_Collection(**kwargs)[source]

Bases: optimeed.core.collection.ListDataStruct

class Parametric_parameter(analyzed_attribute, reference_device)[source]

Abstract class for a parametric parameter

get_reference_device()[source]
get_analyzed_attribute()[source]
class Parametric_minmax(analyzed_attribute, reference_device, minValue, maxValue, is_relative=False, npoints=10)[source]

Bases: Parametric_parameter

Abstract class for a parametric parameter

get_values()[source]
class Parametric_analysis(theParametricParameter, theCharacterization, filename_collection=None, autosave=False)[source]

Bases: optimeed.core.Option_class

run()[source]

Instantiates input arguments for analysis

evaluate(theDevice)[source]
initialize_output_collection()[source]
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.

get_device()[source]
get_M2P()[source]
get_charac()[source]
get_optivariables()[source]
get_paramvalues()[source]
get_additional_attributes_to_save()[source]

Return list of attributes corresponding to object, whose type cannot be determined statically (e.g. topology change)

class Restrained_SensitivityParameters(*args)[source]

Bases: SensitivityParameters

Class to perform Sensitivty Analysis on a subset of the full parameters

set_selected(selection)[source]
get_optivariables()[source]
get_paramvalues()[source]
class SensitivityAnalysis_LibInterface(theSensitivityParameters: SensitivityParameters, theObjectives)[source]

Interface a library for sensitivity analysis

Parameters:
get_summary()[source]

Display a summary of the sobol indices

get_convergence_S1(stepsize=1)[source]

Create dictionary for convergence plot - First order index

Parameters:stepsize – increments of sampling size
Returns:Dictionary
get_convergence_ST(stepsize=1)[source]

Create dictionary for convergence plot - Total order index

Parameters:stepsize – increments of sampling size
Returns:Dictionary
_get_convergence(method, stepsize)[source]
get_SA_params()[source]
set_SA_params(theSensitivityParameters)[source]
set_objectives(theObjectives)[source]
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:

launch_missing_embarrassingly_parallel_sensitivity(theSensitivityParameters, studyname, missing_list, base_index, mult_factor=1)[source]

Same as launch_embarrassingly_parallel_sensitivity, but using the ‘missing_list’ arg used for mapping

condition_aborted_sensitivities(foldername)[source]
printIfShown(theStr, show_type=SHOW_DEBUG, isToPrint=True, appendTypeName=True, end='n')[source]