Upgrading GEMSEO¶
This page contains the history of the breaking changes in GEMSEO. The codes using those shall be updated according to the target GEMSEO version.
4.0.0¶
API changes that impact user scripts code¶
In post-processing,
fig_sizeis the unique name to identify the size of a figure and the occurrences offigsize,figsize_xandfigsize_yhave been replaced byfig_size,fig_size_xandfig_size_y.The argument
parallel_execinIDF.__init__()has been renamed ton_processes.The argument
quantileofVariableInfluencehas been renamed tolevel.BasicHistory:data_listhas been renamed tovariable_names.MDAChain.sub_mda_listhas been renamed toMDAChain.inner_mdas.RadarChart:constraints_listhas been renamed toconstraint_names.ScatterPlotMatrix:variables_listhas been renamed tovariable_names.All
MDAalgos now count their iterations starting from0.The
MDA.residual_historyis now a list of normed residuals.The argument
figsizeinMDA.plot_residual_history()was renamed tofig_sizeto be consistent withOptPostProcessoralgos.ConstraintsHistory:constraints_listhas been renamed toconstraint_names.The
MDAChainnow takesinner_mda_nameas argument instead ofsub_mda_class.The
MDFformulation now takesmain_mda_nameas argument instead ofmain_mda_classandinner_mda_nameinstead of -sub_mda_class.The
BiLevelformulation now takesmain_mda_nameas argument instead ofmda_name. It is now possible to explicitly define aninner_mda_nameas well.In
DesignSpace:get_current_xhas been renamed toget_current_value().has_current_xhas been renamed tohas_current_value().set_current_xhas been renamed toset_current_value().Remove
get_current_x_normalizedandget_current_x_dict.
The short names of some machine learning algorithms have been replaced by conventional acronyms.
MatlabDiscipline.__init__():input_data_listandoutput_data_listhas been renamed toinput_namesandoutput_names.save_matlab_file():dict_to_savehas been renamed todata.The classes of the regression algorithms are renamed as
{Prefix}Regressor.The class
ConcatenationDisciplinehas been renamed toConcatenater.In Caches:
inputs_nameshas been renamed toinput_names.get_all_data()has been replaced by[cache_entry for cache_entry in cache].get_datahas been removed.get_length()has been replaced bylen(cache).get_outputs(input_data)has been replaced bycache[input_data].outputs.{INPUTS,JACOBIAN,OUTPUTS,SAMPLE}_GROUPhave been removed.get_last_cached_inputs()has been replaced bycache.last_entry.inputs.get_last_cached_outputs()has been replaced bycache.last_entry.outputs.max_lengthhas been removed.mergehas been renamed toupdate().outputs_nameshas been renamed tooutput_names.varsizeshas been renamed tonames_to_sizes.samples_indiceshas been removed.
API changes that impact discipline wrappers¶
In Grammar:
update_fromhas been renamed toupdate().remove_item(name)has been replaced bydel grammar[name].get_data_nameshas been renamed tokeys().initialize_from_data_nameshas been renamed toupdate().initialize_from_base_dicthas been renamed toupdate_from_data().update_from_if_not_inhas been renamed to now useupdate()withexclude_names.set_item_valuehas been removed.remove_required(name)has been replaced byrequired_names.remove(name).data_nameshas been renamed tokeys().data_typeshas been renamed tovalues().update_elementshas been renamed toupdate().update_required_elementshas been removed.init_from_schema_filehas been renamed toupdate_from_file().
API changes that affect plugin or features developers¶
AlgoLib.lib_dicthas been renamed toAlgoLib.descriptions.gemseo.utils.data_conversion.FLAT_JAC_SEPhas been renamed toSTRING_SEPARATOR.In
gemseo.utils.data_conversion:DataConversion.dict_to_arrayhas been renamed toconcatenate_dict_of_arrays_to_array().DataConversion.list_of_dict_to_arrayremoved.DataConversion.array_to_dicthas been renamed tosplit_array_to_dict_of_arrays().DataConversion.jac_2dmat_to_dicthas been renamed tosplit_array_to_dict_of_arrays().DataConversion.jac_3dmat_to_dicthas been renamed tosplit_array_to_dict_of_arrays().DataConversion.dict_jac_to_2dmatremoved.DataConversion.dict_jac_to_dicthas been renamed toflatten_nested_dict().DataConversion.flat_jac_nameremoved.DataConversion.dict_to_jac_dicthas been renamed tonest_flat_bilevel_dict().DataConversion.update_dict_from_arrayhas been renamed toupdate_dict_of_arrays_from_array().DataConversion.deepcopy_datadicthas been renamed todeepcopy_dict_of_arrays().DataConversion.get_all_inputshas been renamed toget_all_inputs().DataConversion.get_all_outputshas been renamed toget_all_outputs().
DesignSpace.get_current_valuecan now return a dictionary of NumPy arrays or normalized design values.The method
MDOFormulation.check_disciplineshas been removed.The class variable
MLAlgo.ABBRhas been renamed toMLAlgo.SHORT_ALGO_NAME.For
OptResultandMDOFunction:get_data_dict_reprhas been renamed toto_dict.Remove plugin detection for packages with
gemseo_prefix.MDOFunctionGenerator.get_function:input_names_listandoutput_names_listhas been renamed tooutput_namesandoutput_names.MDOScenarioAdapter.__init__:inputs_listandoutputs_listhas been renamed toinput_namesandoutput_names.OptPostProcessor.out_data_dicthas been renamed toOptPostProcessor.materials_for_plotting.-
input_data_listhas been renamed toinput_values.worker_listhas been renamed toworkers.
In Grammar,
is_type_arrayhas been renamed tois_array().
Internal changes that rarely or not affect users¶
In Grammar:
load_datahas been renamed tovalidate().is_data_name_existing(name)has been renamed toname in grammar.is_all_data_names_existing(names)has been replaced byset(names) <= set(keys()).to_simple_grammarhas been renamed toconvert_to_simple_grammar().is_required(name)has been renamed toname in required_names.write_schemahas been renamed towrite().schema_dicthas been renamed toschema.JSONGrammarclass attributes removed has been renamed toPROPERTIES_FIELD,REQUIRED_FIELD,TYPE_FIELD,OBJECT_FIELD,TYPES_MAP.AbstractGrammarhas been renamed toBaseGrammar.
AnalyticDiscipline.expr_symbols_dicthas been renamed toAnalyticDiscipline.output_names_to_symbols.AtomicExecSequence.get_state_dicthas been renamed toAtomicExecSequence.get_statuses().-
CompositeExecSequence.get_state_dicthas been renamed toCompositeExecSequence.get_statuses().CompositeExecSequence.sequence_listhas been renamed toCompositeExecSequence.sequences.
Remove
gemseo.utils.multi_processing.
3.0.0¶
As GEMS has been renamed to GEMSEO, upgrading from version 2 to version 3 requires to change all the import statements of your code from
import gems
from gems.x.y import z
to
import gemseo
from gemseo.x.y import z
2.0.0¶
The API of GEMS 2 has been slightly modified with respect to GEMS 1. In particular, for all the supported Python versions, the strings shall to be encoded in unicode while they were previously encoded in ASCII.
That kind of error:
ERROR - 17:11:09 : Invalid data in : MDOScenario_input
', error : data.algo must be string
Traceback (most recent call last):
File "plot_mdo_scenario.py", line 85, in <module>
scenario.execute({"algo": "L-BFGS-B", "max_iter": 100})
File "/home/distracted_user/workspace/gemseo/src/gemseo/core/discipline.py", line 586, in execute
self.check_input_data(input_data)
File "/home/distracted_user/workspace/gemseo/src/gemseo/core/discipline.py", line 1243, in check_input_data
raise InvalidDataException("Invalid input data for: " + self.name)
gemseo.core.grammar.InvalidDataException: Invalid input data for: MDOScenario
is most likely due to the fact that you have not migrated your code to be compliant with GEMSEO 2. To migrate your code, add the following import at the beginning of all your modules defining literal strings:
from __future__ import unicode_literals