fastoad.gui package

Subpackages

Submodules

Module contents

Package for GUI items.

class fastoad.gui.MissionViewer[source]

Bases: object

A class for facilitating the post-processing of mission and trajectories

add_mission(mission_data: str | PathLike | DataFrame, name=None)[source]

Adds the mission to the mission database (self.missions) :param mission_data: path of the mission file or Dataframe containing the mission data :param name: name to give to the mission

display(layout_dict=None, layout_overwrite=False, **kwargs)[source]

Display the user interface

Parameters:
  • layout_dict – Dictionary of properties to be updated

  • layout_overwrite – If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing properties that are not specified in the update operation.

  • kwargs – Keyword/value pair of properties to be updated

:return the display object

class fastoad.gui.OptimizationViewer[source]

Bases: object

A class for interacting with FAST-OAD Problem optimization information.

problem_configuration: FASTOADProblemConfigurator

Instance of the FAST-OAD problem configuration

dataframe

The dataframe which is the mirror of self.file

load(problem_configuration: FASTOADProblemConfigurator)[source]

Loads the FAST-OAD problem and stores its data.

Parameters:

problem_configuration – the FASTOADProblem instance.

save()[source]

Save the optimization to the files. Possible files modified are:

  • the .yml configuration file

  • the input file (initial values)

  • the output file (values)

display()[source]

Displays the datasheet. load() must be ran before.

Returns:

display of the user interface:

load_variables(variables: VariableList, attribute_to_column: dict[str, str] | None = None)[source]

Loads provided variable list and replace current data set.

Parameters:
  • variables – the variables to load

  • attribute_to_column – dictionary keys tell what variable attributes are kept and the values tell what name will be displayed. If not provided, default translation will apply.

get_variables(column_to_attribute: dict[str, str] | None = None) VariableList[source]
Parameters:

column_to_attribute – dictionary keys tell what columns are kept and the values tell whatvariable attribute it corresponds to. If not provided, default translation will apply.

Returns:

a variable list from current data set

class fastoad.gui.VariableViewer[source]

Bases: object

A class for interacting with FAST-OAD files. The file data is stored in a pandas DataFrame. The class built so that a modification of the DataFrame is instantly replicated on the file file. The interaction is achieved using a user interface built with widgets from ipywidgets and Sheets from ipysheet.

A classical usage of this class will be:

df = VariableViewer()  # instantiation of dataframe
file = AbstractOMFileIO('problem_outputs.file') #  instantiation of file io
df.load(file)  # load the file
df.display()  # renders a ui for reading/modifying the file
file

The path of the data file that will be viewed/edited

dataframe

The dataframe which is the mirror of self.file

load(file_path: str | PathLike, file_formatter: IVariableIOFormatter = None)[source]

Loads the file and stores its data.

Parameters:
  • file_path – the path of file to interact with

  • file_formatter – the formatter that defines file format. If not provided, default format will be assumed.

save(file_path: str | PathLike | None = None, file_formatter: IVariableIOFormatter = None)[source]

Save the dataframe to the file.

Parameters:
  • file_path – the path of file to save. If not given, the initially read file will be overwritten.

  • file_formatter – the formatter that defines file format. If not provided, default format will be assumed.

display()[source]

Displays the datasheet :return display of the user interface:

load_variables(variables: VariableList, attribute_to_column: dict[str, str] | None = None)[source]

Loads provided variable list and replace current data set.

Parameters:
  • variables – the variables to load

  • attribute_to_column – dictionary keys tell what variable attributes are kept and the values tell what name will be displayed. If not provided, default translation will apply.

get_variables(column_to_attribute: dict[str, str] | None = None) VariableList[source]
Parameters:

column_to_attribute – dictionary keys tell what columns are kept and the values tell what variable attribute it corresponds to. If not provided, default translation will apply.

Returns:

a variable list from current data set

fastoad.gui.aircraft_geometry_plot(aircraft_file_path: str | PathLike, name=None, fig=None, *, file_formatter=None) FigureWidget[source]

Returns a figure plot of the top view of the wing. Different designs can be superposed by providing an existing fig. Each design can be provided a name.

Parameters:
  • aircraft_file_path – path of data file

  • name – name to give to the trace added to the figure

  • fig – existing figure to which add the plot

  • file_formatter – the formatter that defines the format of data file. If not provided, default format will be assumed.

Returns:

wing plot figure

fastoad.gui.drag_polar_plot(aircraft_file_path: str | PathLike, name=None, fig=None, *, file_formatter=None) FigureWidget[source]

Returns a figure plot of the aircraft drag polar. Different designs can be superposed by providing an existing fig. Each design can be provided a name.

Parameters:
  • aircraft_file_path – path of data file

  • name – name to give to the trace added to the figure

  • fig – existing figure to which add the plot

  • file_formatter – the formatter that defines the format of data file. If not provided, default format will be assumed.

Returns:

wing plot figure

fastoad.gui.mass_breakdown_bar_plot(aircraft_file_path: str | PathLike, name=None, fig=None, *, file_formatter=None, input_mass_name='data:weight:aircraft:MTOW') FigureWidget[source]

Returns a figure plot of the aircraft mass breakdown using bar plots. Different designs can be superposed by providing an existing fig. Each design can be provided a name.

Parameters:
  • aircraft_file_path – path of data file

  • name – name to give to the trace added to the figure

  • fig – existing figure to which add the plot

  • file_formatter – the formatter that defines the format of data file. If not provided, default format will be assumed.

  • input_mass_name – the variable name for the mass input as defined in the mission definition file.

Returns:

bar plot figure

fastoad.gui.mass_breakdown_sun_plot(aircraft_file_path: str | PathLike, *, file_formatter=None, input_mass_name='data:weight:aircraft:MTOW', mission_name=None)[source]

Returns a figure sunburst plot of the mass breakdown of the aircraft of the sizing mission. On the left a MTOW sunburst and on the right a OWE sunburst. Different designs can be superposed by providing an existing fig. Each design can be provided a name.

Parameters:
  • aircraft_file_path – path of data file

  • file_formatter – the formatter that defines the format of data file. If not provided, default format will be assumed.

  • input_mass_name – the variable name for the mass input as defined in the mission definition file.

  • mission_name – the name of the specific mission for which the mass breakdown is plotted. If not provided, the sizing mission configuration is plotted.

Returns:

sunburst plot figure

fastoad.gui.payload_range_plot(aircraft_file_path: str | PathLike, name='Payload-Range', mission_name='operational', variable_of_interest: str | None = None, variable_of_interest_legend: str | None = None)[source]

Returns a figure of the payload-range diagram. The diagram contains by default only the contour but can also provide a heatmap of the grid points, if variable_of_interest is not None. Please note that the data for the contour are expected in the variables data:payload_range:{mission_name}:range and data:payload_range:{mission_name}:payload. Similarly, the data for the heatmap are expected in the variables data:payload_range:{mission_name}:grid:range, data:payload_range:{mission_name}:grid:payload and data:payload_range:{mission_name}:grid:{variable_of_interest}.

Parameters:
  • aircraft_file_path – path of data file

  • name – name to give to the trace added to the figure

  • mission_name – name of the mission present in the data file to be plotted.

  • variable_of_interest – variable of interest for the heatmap.

  • variable_of_interest_legend – name to give to variable of interest in plot legend.

Returns:

payload-range plot figure

fastoad.gui.wing_geometry_plot(aircraft_file_path: str | PathLike, name=None, fig=None, *, file_formatter=None) FigureWidget[source]

Returns a figure plot of the top view of the wing. Different designs can be superposed by providing an existing fig. Each design can be provided a name.

Parameters:
  • aircraft_file_path – path of data file

  • name – name to give to the trace added to the figure

  • fig – existing figure to which add the plot

  • file_formatter – the formatter that defines the format of data file. If not provided, default format will be assumed.

Returns:

wing plot figure