fastoad.models.performances.mission.mission_definition.mission_builder.structure_builders module
Classes for managing internal structures of missions.
The mission file provides a “human” definition of the mission. Structures are the translation of this human definition, that is ready to be transformed into a Python implementation.
- class fastoad.models.performances.mission.mission_definition.mission_builder.structure_builders.AbstractStructureBuilder(definition: dataclasses.InitVar[dict], name: str, parent_name: Optional[str] = None, variable_prefix: str = '')[source]
Bases:
abc.ABC
Base class for building structures of mission parts.
“Structures” are dicts that are derived from the mission definition file so that they can be readily translated into the matching implementation.
Usage:
Subclasses must implement the build method that will create the specific part of the structure dict (name and type fields are automated).
If the structure has to contain the result of another result,
insert_builder()
should be used to ensure a correct processing of the global structure, especially to get a correct resolution ofinput_definitions
.- type = None
Defined by subclass
- property structure: dict
A dictionary that is ready to be translated to the matching implementation.
- get_input_definitions() List[fastoad.models.performances.mission.mission_definition.mission_builder.input_definition.InputDefinition] [source]
List of InputDefinition instances in the structure.
- process_builder(builder: fastoad.models.performances.mission.mission_definition.mission_builder.structure_builders.AbstractStructureBuilder) dict [source]
Method to be used when another StructureBuilder object should be inserted in
structure
.Not using this method will prevent a correct processing of
input_definitions
.Note
The returned object is always an empty dict. It is actually a memory reference that will allow to fill this “placeholder” later with the final result of the builder, that cannot be completely known when builder is created from read definition.
- Parameters
builder – the builder object
- Returns
the object that has to be put at location where the builder result should be used
- property qualified_name
).
- Type
Name of the current structure, preceded by the parent names, separated by colons (
- class fastoad.models.performances.mission.mission_definition.mission_builder.structure_builders.DefaultStructureBuilder(definition: dataclasses.InitVar[dict], name: str, parent_name: Optional[str] = None, variable_prefix: str = '')[source]
-
Builder for structures that do not need to process the given definition.
- Parameters
definition – the definition for the part only
- type = None
Defined by subclass
- class fastoad.models.performances.mission.mission_definition.mission_builder.structure_builders.PolarStructureBuilder(definition: dataclasses.InitVar[dict], name: str, parent_name: Optional[str] = None, variable_prefix: str = '')[source]
-
Structure builder for polar definition.
- Parameters
definition – the definition for the polar only
- type = 'polar'
Defined by subclass
- class fastoad.models.performances.mission.mission_definition.mission_builder.structure_builders.SegmentStructureBuilder(definition: dataclasses.InitVar[dict], name: str, parent_name: Optional[str] = None, variable_prefix: str = '')[source]
-
Structure builder for segment definition.
- Parameters
definition – the definition for the segment only
- type = 'segment'
Defined by subclass
- class fastoad.models.performances.mission.mission_definition.mission_builder.structure_builders.PhaseStructureBuilder(definition: dataclasses.InitVar[dict], name: str, parent_name: Optional[str] = None, variable_prefix: str = '')[source]
-
Structure builder for phase definition.
- Parameters
definition – the whole content of definition file
- type = 'phase'
Defined by subclass
- class fastoad.models.performances.mission.mission_definition.mission_builder.structure_builders.RouteStructureBuilder(definition: dataclasses.InitVar[dict], name: str, parent_name: Optional[str] = None, variable_prefix: str = '')[source]
-
Structure builder for route definition.
- Parameters
definition – the whole content of definition file
- type = 'route'
Defined by subclass
- class fastoad.models.performances.mission.mission_definition.mission_builder.structure_builders.MissionStructureBuilder(definition: dataclasses.InitVar[dict], name: str, parent_name: Optional[str] = None, variable_prefix: str = '')[source]
-
Structure builder for mission definition.
- Parameters
definition – the whole content of definition file
- property qualified_name
).
- Type
Name of the current structure, preceded by the parent names, separated by colons (
- type = 'mission'
Defined by subclass