gemseo.disciplines.remapping module#

A discipline whose inputs and outputs map to those of another.

class RemappingDiscipline(discipline, input_mapping=mappingproxy({}), output_mapping=mappingproxy({}))[source]#

Bases: Discipline

A discipline whose inputs and outputs map to those of another.

An input or output name mapping looks like {"new_x": "x", "new_y": ("y", components)} where the variable "new_x" corresponds to the original variable "x" and the variable "new_y" corresponds to some components of the original variable "y". components can be an integer i (the i-th component of y), a sequence of integers [i, j, k] (the i-th, j-th and k-th components of y) or an iterable of integers range(i, j+1) (from the i-th to the j-th components of y).

Initialize self. See help(type(self)) for accurate signature.

Parameters:
  • discipline (Discipline) -- The original discipline.

  • input_mapping (NameMapping) --

    The input names to the original input names.

    By default it is set to {}.

  • output_mapping (NameMapping) --

    The output names to the original output names.

    By default it is set to {}.

Raises:

ValueError -- When the original discipline has no default input values.

default_grammar_type: ClassVar[_GrammarType] = 'SimplerGrammar'#

The default type of grammar.

property original_discipline: Discipline#

The original discipline.