gemseo / core

data_processor module

Data conversion between discipline data check and _run()

Classes:

ComplexDataProcessor()

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

DataProcessor()

Abstract class for pre and post processing data of MDODisciplines.

FloatDataProcessor()

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

NameMapping(mapping)

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

class gemseo.core.data_processor.ComplexDataProcessor[source]

Bases: gemseo.core.data_processor.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.

Methods:

post_process_data(data)

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

pre_process_data(data)

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.

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

Methods:

post_process_data(data)

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

pre_process_data(data)

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.

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: gemseo.core.data_processor.DataProcessor

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

Methods:

post_process_data(data)

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

pre_process_data(data)

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.

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: gemseo.core.data_processor.DataProcessor

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

Construcor.

Parameters

mapping – dictionary of names mapping data structure is {global_key:local_key} the global_key must be consistent with the discipline Grammar. The local key is the data provided to the _run method

Methods:

post_process_data(data)

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

pre_process_data(data)

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.

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