gemseo / core

data_processor module

Data conversion between discipline data check and _run()

class gemseo.core.data_processor.ComplexDataProcessor[source]

Bases: DataProcessor

A data preprocessor that converts all gemseo complex arrays input data to floats arrays, and converts all discipline output data to numpy complex arrays.

post_process_data(data)[source]

Executes a post processing of discipline output data after the _run method of the discipline, before they are checked by MDODiscipline.check_output_data,

Parameters:

data – The output data to process.

Returns:

The processed output data.

pre_process_data(data)[source]

Executes a pre processing of input data after they are checked by MDODiscipline.check_data, and before the _run method of the discipline is called.

Parameters:

data – The input data to process.

Returns:

The processed input data.

class gemseo.core.data_processor.DataProcessor[source]

Bases: object

Abstract class for pre and post processing data of MDODisciplines.

Executes a pre processing of input data after they are checked by MDODiscipline.check_data, and before the _run method of the discipline is called. Similarly, the post processing method is executed after the _run method and before the output data is checked by GEMSEO

This is usefull to cast the data types, since the GEMSEO kernel only handles numpy arrays, and interfaces to disciplinary tools, workflow engines or environment can require different types

post_process_data(data)[source]

Executes a post processing of discipline output data after the _run method of the discipline, before they are checked by MDODiscipline.check_output_data,

Parameters:

data – The output data to process.

Returns:

The processed output data.

pre_process_data(data)[source]

Executes a pre processing of input data after they are checked by MDODiscipline.check_data, and before the _run method of the discipline is called.

Parameters:

data – The input data to process.

Returns:

The processed input data.

class gemseo.core.data_processor.FloatDataProcessor[source]

Bases: DataProcessor

A data preprocessor that converts all gemseo scalar input data to floats, and converts all discipline output data to numpy arrays.

post_process_data(data)[source]

Executes a post processing of discipline output data after the _run method of the discipline, before they are checked by MDODiscipline.check_output_data,

Parameters:

data – The output data to process.

Returns:

The processed output data.

pre_process_data(data)[source]

Executes a pre processing of input data after they are checked by MDODiscipline.check_data, and before the _run method of the discipline is called.

Parameters:

data – The input data to process.

Returns:

The processed input data.

class gemseo.core.data_processor.NameMapping(mapping)[source]

Bases: DataProcessor

A data preprocessor that maps process level data names to local discipline data names.

Parameters:

mapping – A mapping structure of the form {global_name: local_name} where global_name must be consistent with the grammar of the discipline. The local name is the data provided to the MDODiscipline._run() method.

post_process_data(data)[source]

Executes a post processing of discipline output data after the _run method of the discipline, before they are checked by MDODiscipline.check_output_data,

Parameters:

data – The output data to process.

Returns:

The processed output data.

pre_process_data(data)[source]

Executes a pre processing of input data after they are checked by MDODiscipline.check_data, and before the _run method of the discipline is called.

Parameters:

data – The input data to process.

Returns:

The processed input data.