Formulation Settings#
The available GEMSEO formulations require different configuration settings to be instantiated. There are two ways to pass formulation settings, either one by one:
scenario = create_scenario(
disciplines,
"y_4",
design_space,
maximize_objective=True,
**formulation_settings,
formulation_name="MDF",
main_mda_name="MDAGaussSeidel",
main_mda_settings={
"max_mda_iter": 50,
"warm_start": True,
"linear_solver_tolerance": 1e-14,
},
)
or via their associated Pydantic model:
from gemseo.settings.formulations import MDF_Settings
scenario = create_scenario(
disciplines,
"y_4",
design_space,
maximize_objective=True,
formulation_settings_model=MDF_Settings(
main_mda_name="MDAGaussSeidel",
main_mda_settings={
"max_mda_iter": 50,
"warm_start": True,
"linear_solver_tolerance": 1e-14,
},
),
)
The advantage of using the Pydantic model directly is that IDEs provide auto completion for Pydantic models. Another advantage is that the settings are validated at instantiation of the Pydantic model, so in case a setting name or setting value is not valid, the validation exception will happen before the execution of the scenario, thus saving time.