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_size
is the unique name to identify the size of a figure and the occurrences offigsize
,figsize_x
andfigsize_y
have been replaced byfig_size
,fig_size_x
andfig_size_y
.The argument
parallel_exec
inIDF.__init__()
has been renamed ton_processes
.The argument
quantile
ofVariableInfluence
has been renamed tolevel
.BasicHistory
:data_list
has been renamed tovariable_names
.MDAChain.sub_mda_list
has been renamed toMDAChain.inner_mdas
.RadarChart
:constraints_list
has been renamed toconstraint_names
.ScatterPlotMatrix
:variables_list
has been renamed tovariable_names
.All
MDA
algos now count their iterations starting from0
.The
MDA.residual_history
is now a list of normed residuals.The argument
figsize
inMDA.plot_residual_history()
was renamed tofig_size
to be consistent withOptPostProcessor
algos.ConstraintsHistory
:constraints_list
has been renamed toconstraint_names
.The
MDAChain
now takesinner_mda_name
as argument instead ofsub_mda_class
.The
MDF
formulation now takesmain_mda_name
as argument instead ofmain_mda_class
andinner_mda_name
instead of -sub_mda_class
.The
BiLevel
formulation now takesmain_mda_name
as argument instead ofmda_name
. It is now possible to explicitly define aninner_mda_name
as well.In
DesignSpace
:get_current_x
has been renamed toget_current_value()
.has_current_x
has been renamed tohas_current_value()
.set_current_x
has been renamed toset_current_value()
.Remove
get_current_x_normalized
andget_current_x_dict
.
The short names of some machine learning algorithms have been replaced by conventional acronyms.
MatlabDiscipline.__init__()
:input_data_list
andoutput_data_list
has been renamed toinput_names
andoutput_names
.save_matlab_file()
:dict_to_save
has been renamed todata
.The classes of the regression algorithms are renamed as
{Prefix}Regressor
.The class
ConcatenationDiscipline
has been renamed toConcatenater
.In Caches:
inputs_names
has been renamed toinput_names
.get_all_data()
has been replaced by[cache_entry for cache_entry in cache]
.get_data
has been removed.get_length()
has been replaced bylen(cache)
.get_outputs(input_data)
has been replaced bycache[input_data].outputs
.{INPUTS,JACOBIAN,OUTPUTS,SAMPLE}_GROUP
have 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_length
has been removed.merge
has been renamed toupdate()
.outputs_names
has been renamed tooutput_names
.varsizes
has been renamed tonames_to_sizes
.samples_indices
has been removed.
API changes that impact discipline wrappers¶
In Grammar:
update_from
has been renamed toupdate()
.remove_item(name)
has been replaced bydel grammar[name]
.get_data_names
has been renamed tokeys()
.initialize_from_data_names
has been renamed toupdate()
.initialize_from_base_dict
has been renamed toupdate_from_data()
.update_from_if_not_in
has been renamed to now useupdate()
withexclude_names
.set_item_value
has been removed.remove_required(name)
has been replaced byrequired_names.remove(name)
.data_names
has been renamed tokeys()
.data_types
has been renamed tovalues()
.update_elements
has been renamed toupdate()
.update_required_elements
has been removed.init_from_schema_file
has been renamed toupdate_from_file()
.
API changes that affect plugin or features developers¶
AlgoLib.lib_dict
has been renamed toAlgoLib.descriptions
.gemseo.utils.data_conversion.FLAT_JAC_SEP
has been renamed toSTRING_SEPARATOR
.In
gemseo.utils.data_conversion
:DataConversion.dict_to_array
has been renamed toconcatenate_dict_of_arrays_to_array()
.DataConversion.list_of_dict_to_array
removed.DataConversion.array_to_dict
has been renamed tosplit_array_to_dict_of_arrays()
.DataConversion.jac_2dmat_to_dict
has been renamed tosplit_array_to_dict_of_arrays()
.DataConversion.jac_3dmat_to_dict
has been renamed tosplit_array_to_dict_of_arrays()
.DataConversion.dict_jac_to_2dmat
removed.DataConversion.dict_jac_to_dict
has been renamed toflatten_nested_dict()
.DataConversion.flat_jac_name
removed.DataConversion.dict_to_jac_dict
has been renamed tonest_flat_bilevel_dict()
.DataConversion.update_dict_from_array
has been renamed toupdate_dict_of_arrays_from_array()
.DataConversion.deepcopy_datadict
has been renamed todeepcopy_dict_of_arrays()
.DataConversion.get_all_inputs
has been renamed toget_all_inputs()
.DataConversion.get_all_outputs
has been renamed toget_all_outputs()
.
DesignSpace.get_current_value
can now return a dictionary of NumPy arrays or normalized design values.The method
MDOFormulation.check_disciplines
has been removed.The class variable
MLAlgo.ABBR
has been renamed toMLAlgo.SHORT_ALGO_NAME
.For
OptResult
andMDOFunction
:get_data_dict_repr
has been renamed toto_dict
.Remove plugin detection for packages with
gemseo_
prefix.MDOFunctionGenerator.get_function
:input_names_list
andoutput_names_list
has been renamed tooutput_names
andoutput_names
.MDOScenarioAdapter.__init__
:inputs_list
andoutputs_list
has been renamed toinput_names
andoutput_names
.OptPostProcessor.out_data_dict
has been renamed toOptPostProcessor.materials_for_plotting
.-
input_data_list
has been renamed toinput_values
.worker_list
has been renamed toworkers
.
In Grammar,
is_type_array
has been renamed tois_array()
.
Internal changes that rarely or not affect users¶
In Grammar:
load_data
has 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_grammar
has been renamed toconvert_to_simple_grammar()
.is_required(name)
has been renamed toname in required_names
.write_schema
has been renamed towrite()
.schema_dict
has been renamed toschema
.JSONGrammar
class attributes removed has been renamed toPROPERTIES_FIELD
,REQUIRED_FIELD
,TYPE_FIELD
,OBJECT_FIELD
,TYPES_MAP
.AbstractGrammar
has been renamed toBaseGrammar
.
AnalyticDiscipline.expr_symbols_dict
has been renamed toAnalyticDiscipline.output_names_to_symbols
.AtomicExecSequence.get_state_dict
has been renamed toAtomicExecSequence.get_statuses()
.-
CompositeExecSequence.get_state_dict
has been renamed toCompositeExecSequence.get_statuses()
.CompositeExecSequence.sequence_list
has 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
Please also read carefully python2and3 for more information.