fastoad.cmd.api module¶
API
-
fastoad.cmd.api.
evaluate_problem
(configuration_file_path: str, overwrite: bool = False) → fastoad.openmdao.problem.FASTOADProblem[source]¶ Runs model according to provided problem file
- Parameters
configuration_file_path – problem definition
overwrite – if True, output file will be overwritten
- Returns
the OpenMDAO problem after run
-
fastoad.cmd.api.
generate_configuration_file
(configuration_file_path: str, overwrite: bool = False)[source]¶ Generates a sample configuration file.
- Parameters
configuration_file_path – the path of file to be written
overwrite – if True, the file will be written, even if it already exists
- Raises
FastFileExistsError – if overwrite==False and configuration_file_path already exists
-
fastoad.cmd.api.
generate_inputs
(configuration_file_path: str, source_path: str = None, source_path_schema='native', overwrite: bool = False)[source]¶ Generates input file for the
FASTOADProblem
specified in configuration_file_path.- Parameters
configuration_file_path – where the path of input file to write is set
source_path – path of file data will be taken from
source_path_schema – set to ‘legacy’ if the source file come from legacy FAST
overwrite – if True, file will be written even if one already exists
- Raises
FastFileExistsError – if overwrite==False and configuration_file_path already exists
-
fastoad.cmd.api.
list_systems
(configuration_file_path: str = None, out: Union[IO, str] = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>, overwrite: bool = False)[source]¶ Writes list of available systems. If configuration_file_path is given and if it defines paths where there are registered systems, they will be listed too.
- Parameters
configuration_file_path –
out – the output stream or a path for the output file
overwrite – if True and out is a file path, the file will be written even if one already exists
- Raises
FastFileExistsError – if overwrite==False and out is a file path and the file exists
-
fastoad.cmd.api.
list_variables
(configuration_file_path: str, out: Union[IO, str] = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>, overwrite: bool = False, force_text_output: bool = False)[source]¶ Writes list of variables for the
FASTOADProblem
specified in configuration_file_path.List is generally written as text. It can be displayed as a scrollable table view if: - function is used in an interactive IPython shell - out == sys.stdout - force_text_output == False
- Parameters
configuration_file_path –
out – the output stream or a path for the output file
overwrite – if True and out parameter is a file path, the file will be written even if one already exists
force_text_output – if True, list will be written as text, even if command is used in an interactive IPython shell (Jupyter notebook). Has no effect in other shells or if out parameter is not sys.stdout
- Raises
FastFileExistsError – if overwrite==False and out parameter is a file path and the file exists
-
fastoad.cmd.api.
optimization_viewer
(configuration_file_path: str)[source]¶ Displays optimization information and enables its editing
- Parameters
configuration_file_path – problem definition
- Returns
display of the OptimizationViewer
-
fastoad.cmd.api.
optimize_problem
(configuration_file_path: str, overwrite: bool = False, auto_scaling: bool = False) → fastoad.openmdao.problem.FASTOADProblem[source]¶ Runs driver according to provided problem file
- Parameters
configuration_file_path – problem definition
overwrite – if True, output file will be overwritten
auto_scaling – if True, automatic scaling is performed for design variables and constraints
- Returns
the OpenMDAO problem after run
-
fastoad.cmd.api.
variable_viewer
(file_path: str, file_formatter: fastoad.io.formatter.IVariableIOFormatter = None, editable=True)[source]¶ Displays a widget that enables to visualize variables information and edit their values.
- 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.
editable – if True, an editable table with variable filters will be displayed. If False, the table will not be editable nor searchable, but can be stored in an HTML file.
- Returns
display handle of the VariableViewer