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


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


## Create a simple DOE on a single discipline¶

Use the DisciplinaryOpt formulation and a DOEScenario scenario. Even for simple DOEs, GEMSEO formulates an optimization problem, so requires a MDO formulation. The DisciplinaryOpt formulation executes the MDODiscipline alone, or the list of MDODiscipline in the order passed by the user. This means that you must specify an objective function. The DOE won’t try to minimize it but it will be set as an objective in the visualizations.

For more details, we invite you to read our tutorial Tutorial: How to carry out a trade-off study.

## Create a simple optimization on a single discipline¶

Use the DisciplinaryOpt formulation and a MDOScenario. The DisciplinaryOpt formulation executes the MDODiscipline alone, or the list of MDODiscipline in the order passed by the user.

## Available options for DOE/Optimization¶

Look at the JSON schema with the name of the library or algorithm, in the gemseo/algos/doe/options or gemseo/algos/opt/options packages. Their list and meanings are also documented in the library wrapper (for instance gemseo.algos.opt.lib_scipy.ScipyOpt._get_options()).

## Coupling a simulation software to GEMSEO¶

We invite you to discover all the steps in this tutorial Tutorial: How to solve a MDO problem.

## Extend GEMSEO features¶

The simplest way is to create a subclass associated to the feature you want to extend, respectively:

• for optimizers, inherit from OptimizationLibrary, and put the Python file in the src/gemseo/algos/opt package

• for DOEs, inherit from DOELibrary, and put the Python file in the src/gemseo/algos/doe package

• for surrogate models, inherit from MLRegressionAlgo, and put the Python file in the src/gemseo/mlearning/regression package

• for MDAs, inherit from MDA, and put the Python file in the src/gemseo/mda package

• for MDO formulations, inherit from MDOFormulation, and put the Python file in the src/gemseo/formulations package

• for disciplines, inherit from MDODiscipline, and put the Python file in the src/gemseo/problems/my_problem package, which you created

See Extending GEMSEO to learn how to run GEMSEO with external Python modules.

## What are JSON schemas?¶

JSON schemas describe the format (i.e. structure) of JSON files, in a similar way as XML schemas define the format of XML files. JSON schemas come along with validators, that check that a JSON data structure is valid against a JSON schema, this is used in GEMSEO’ Grammars.

We invite you to read our documentation: Input and output description: grammars.

All details about the JSON schema specification can be found here: Understanding JSON schemas.

## Store persistent data produced by disciplines¶

Use HDF5 caches to persist the discipline output on the disk.

We invite you to read our documentation: Caching and recording discipline data.

## How to use GEMSEO without DISPLAY?¶

With python 2.7, GEMSEO may error out if the environment variable DISPLAY is not set (because of matplotlib). In you shell, run

export MPLBACKEND=AGG


## GEMSEO fails with openturns¶

Openturns implicitely requires the library libnsl that may not be installed by default on recent linux OSes. Under CentOS for instance, install it with:

sudo yum install libnsl


## Some GEMSEO tests fail under Windows without any reason¶

The user may face some issues with the last version of Windows 10, build 2004, while running the tests. The errors are located deep in either numpy or scipy, while performing some low-level linear algebra operations. The root cause of this issue is well known and comes from an incompatibility with Windows 10, build 2004 and some versions of OpenBlas. GEMSEO users shall not encounter any issue in production. Otherwise, please contact us in order to get some mitigation instructions.