App stage
AppStageCompute
¶
add_alert
¶
add_alert(headline, message, alert_style, visible=True, var_name=None)
Adds an alert banner to the report.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
Represents the headline of the alert in bold. |
required |
|
str
|
Represents the message the user would like to inform the user of. |
required |
|
str
|
Allowable entries: ["normal", "info", "success", "warning", "error"]. |
required |
|
bool
|
Define if the component is to be made visible in the "Detailed Output" section. Default = True. |
True
|
|
str
|
Optional, if None, then defaults to a GUID. Default = None. |
None
|
Returns:
Type | Description |
---|---|
None
|
None |
Examples:
1 2 3 4 5 |
|
add_calc
¶
add_calc(var_name, fullname, equation=None, reference='', unit='', format_str='{:.4g}', visible=True, override_previous=False, set_value=None)
Adds an input parameter to the calculation report.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The parameter name. Should be short and concise with no white spacing. |
required |
|
str
|
The full name of the parameter, can be descriptive. |
required |
|
str
|
The equation should be input as string with the parameters in the equation tagged with {} brackets either side. |
None
|
|
str
|
Reference to the code, website or book. Default = "". |
''
|
|
str
|
Should typically be "MPa" or other SI unit. Default = "". |
''
|
|
str
|
Default = '{:.3g}' automatically switches between fixed-point and scientific notation depending on the value, the 3 in this instance represents the number of digits to render. If you want to enforce scientific notation use the following format '{:.3e}'. If you wish to use a fixed decimal point value use '{:.3f}'. Other formats are permitted and are according to standard Python formatters. More information can be found at: https://peps.python.org/pep-3101/#standard-format-specifiers |
'{:.4g}'
|
|
bool
|
Define if the component is to be made visible in the "Detailed Output" section. Default = True |
True
|
|
bool
|
Allows the values of this calculation to be overridden. |
False
|
|
str or float
|
Sets the value of the variable without an equation. This can be set only if "equation=None". |
None
|
Returns:
Type | Description |
---|---|
None |
Examples:
1 |
|
add_collapsible
¶
add_collapsible(title='', end=False, visible=True)
Adds a collapsible element to the report. A Collapsible element will create a hidden/expandable section with the inputs defined within two add_collapsible calls.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
Gives a title to the collapsible element. Must be given in the start of a collapsible group. |
''
|
|
bool
|
Marks the end of a collapsible element if end = True. If there was an add_collapsible element with end = False set before, then there must be an add_collapsible(end=True) before the end of register_inputs(). |
False
|
|
bool
|
Set False to hide this collapsible element in the "Detailed output" section. |
True
|
Returns:
Type | Description |
---|---|
None |
Examples:
1 2 3 4 5 6 7 8 9 10 |
|
add_dataframe
¶
add_dataframe(var_name, dataframe, title='', show_index=False)
Adds a dataframe to the report.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
Provide a unique var_name so that it can be added to the report and referenced in the summary. |
required |
|
DataFrame
|
Provide a Pandas dataframe to be bound to the report. |
required |
|
str
|
Provide the fullname or title of the table. |
''
|
|
bool
|
Default = False, state whether the index items should be displayed in the table. |
False
|
Returns:
Type | Description |
---|---|
None
|
None |
Examples:
1 2 3 4 |
|
add_decision
¶
add_decision(calc_var_name, decision_var_name, headlines=None, messages=None, role_styles=None, util_bands=None, heading_style='h4', show_base_calc=False)
Adds a conditional decision to the calculation object that has been added to the report.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
This should be the unique identifier of the utilisation that you would like to style. The equation must return a numerical result. |
required |
|
str
|
This should be the unique identifier for the decision box itself. |
required |
|
Optional[List[str]]
|
This will appear at the head of the utilisation banner in the report. Default = ["Pass", "Pass", "Fail"]. |
None
|
|
Optional[List[str]]
|
This will appear below the calculation used to determine the utilisation. Default = None. |
None
|
|
Optional[List[str]]
|
List of alert styles that are synchronous with the "util_bands". Allowable entries: ["normal", "info", "success", "warning", "error"]. Default = ["success", "warning", "error"]. |
None
|
|
Optional[List[float, int]]
|
Must be greater than zero and list muse be same length / corresponding with "role_styles". Default = [0.95, 1.0, math.inf]. i.e. result<=0.95 = "success", 0.95<result<=1.0 = "warning", 1.0<result<=infinity = "danger". |
None
|
|
str
|
Must be one of the following h1, h2, h3, h4 or h5. Default = h4. |
'h4'
|
|
bool
|
(To be deprecated) This parameter will be deprecated. Default=False |
False
|
Returns: None
Examples:
1 2 3 4 |
|
add_download
¶
add_download(var_name, file=None, label='Download File', tooltip_text='', **kwargs)
Adds a download component to the detailed results section of the report.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The parameter name. Should be short and concise with no white spacing. |
required |
|
BaseFile
|
The file to be downloaded. |
None
|
|
str
|
The label of the download button. Default = "Download File". |
'Download File'
|
|
str
|
Text to display as a tooltip in the webapp. Default = "". |
''
|
Returns:
Type | Description |
---|---|
None |
add_format_option
¶
add_format_option(page_break_before)
Adds text element to the calculation report.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
bool
|
Provides a page break before the current section of the report. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Examples:
1 |
|
add_image
¶
add_image(cb_image=None, **kwargs)
Adds an image to the header of the calculation. Images will only be rendered in "html" type output. Supports images in the following formats ".png", ".jpg", ".jpeg". The images should be saved in a folder called "resources". The file will only be discovered if it is located within a folder called "resources" all files which are not in the "resources" folder will not be discovered. Avoid saved ancillary files such as ".pdf" files and other resources in this folder as these files will contribute to your file storage space.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Optional[CbImage]
|
(CbImage): Object containing the relevant data to render an image. |
None
|
Returns:
Type | Description |
---|---|
None |
Examples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
add_matplotlib
¶
add_matplotlib(var_name, fig, plot_width, fullname=None, visible=True, is_expanded=True, plot_description='')
Adds a matplotlib figure to the report.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
Provide a unique var_name so that it can be added to the report and referenced in the summary. |
required |
|
Figure
|
Provide a single figure to publish within the report. |
required |
|
str
|
The display image size in pixels. Recommended max width is 450. |
required |
|
Optional[str]
|
A verbose name for the var_name. |
None
|
|
bool
|
Define if the component is to be made visible in the "Detailed Output" section. Default = True. |
True
|
|
bool
|
Set to |
True
|
|
str
|
The text attributed to the image. Default = "". |
''
|
Returns:
Type | Description |
---|---|
None
|
None |
Examples:
1 2 3 4 5 6 7 8 |
|
add_plotly
¶
add_plotly(var_name, fig, fullname=None, title='', plot_description='', new_window_only=False)
Adds a plotly figure to the report. The default width of a plot is set to 700 pixels is set on the graph - use the plotly layout properties to update the width and height.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
Provide a unique var_name so that it can be added to the report and referenced in the summary. |
required |
|
Optional[str]
|
A verbose name for the var_name. |
None
|
|
Figure
|
Provide a single figure to publish within the report. |
required |
|
str
|
The title header of the plot. |
''
|
|
str
|
The description of the plot. |
''
|
|
bool
|
If True the plot will only show in a new window and not in the report mode. Default = False. |
False
|
Returns:
Type | Description |
---|---|
None
|
None |
Examples:
1 2 3 4 5 6 7 8 9 |
|
add_plotly_many
¶
add_plotly_many(var_name, figs, fullname=None, titles=None, plot_descriptions=None, new_window_only=False)
Adds a plotly figure to the report. The default width of a plot is set to 700 pixels is set on the graph - use the plotly layout properties to update the width and height.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
Provide a unique var_name so that it can be added to the report and referenced in the summary. NB: All graphs will be exported to the report as a result. |
required |
|
str
|
A verbose name to describe the collection of plots. |
None
|
|
List[Figure]
|
Provide a list of figures to publish within the report. |
required |
|
Optional[List[str]]
|
The list of titles relating to each of the plots. Default = None. |
None
|
|
Optional[List[str]]
|
The list of description relating to each of the plots. Default = None. |
None
|
|
bool
|
If True the plot will only show in a new window and not in the report mode. Default = False. |
False
|
Returns:
Type | Description |
---|---|
None
|
None |
Examples:
1 2 3 4 5 6 7 8 9 10 |
|
add_text
¶
add_text(text, style=None, visible=True, page_break_before=None, tooltip_text='')
Adds a text element to the calculation report.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
Provide the string to represent within the calculation report. |
required |
|
str
|
Provide either ["p", "h1", "h2", "h3", "h4", "h5", "h6"]. If no style is provided, the text will be rendered in Markdown. |
None
|
|
bool
|
Optional. Default = False for all format styles other than "h1". If set to True print formatting of the report will break before. Only relevant for "html" report style. Default = "". |
None
|
|
bool
|
Define if the component is to be made visible in the "Detailed Output" section. Default = True. |
True
|
|
str
|
Text to display as a tooltip in the webapp. Default = "". |
''
|
Returns:
Type | Description |
---|---|
None
|
None |
Examples:
1 |
|
add_visualizer
¶
add_visualizer(var_name, fullname, visualizer, title='', background_color_rgb=(1, 1, 1))
Adds a visualizer to the Visualizers section of the report.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The parameter name. Should be short and concise with no white spacing. |
required |
|
str
|
The full name of the parameter, can be descriptive. |
required |
|
VisualizerGeneric
|
Add the Visualizer object. |
required |
|
str
|
Title of the Visualizer object. |
''
|
|
Tuple[int, int, int]
|
Background color of the visualizer in RGB. Default "(1, 1, 1)". |
(1, 1, 1)
|
Returns:
Type | Description |
---|---|
None |
exec_app
¶
exec_app(inner_app, map_values=None, map_objs=None, return_vars=None, var_names_to_render=None, show_inner_app_results=True, allow_override=False)
Runs an application from the library given the inputs provided in map_values or map_objs which maps the
resulting values from the objects already created. Use return_vars
to map the variables created during the
inner_app
execution to new objects.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Type[AppStageCompute]
|
This is the app to be loaded as an instance into the app. |
required |
|
Dict[str, object] | None
|
Dictionary with the app's input arguments. e.g. {"fck":30, "fcm":50}. Default = None. |
None
|
|
Dict[str, str] | None
|
Map the |
None
|
|
Dict[str, str] | None
|
Map the variable |
None
|
|
List[str] | None
|
List with the variables (output) names to include in the report. If "None" all variable names will be rendered. If you want to exclude all output, enter and empty list. Default=None. |
None
|
|
bool
|
Show the calculations of the loaded app in the report. Default=True. |
True
|
|
bool
|
[DEPRECATED] |
False
|
Returns:
Type | Description |
---|---|
None
|
None |
Examples:
1 2 3 4 5 6 |
|
expose_all_parameters
¶
expose_all_parameters()
Exposes all parameters input parameters in the order that they are defined within the "register_parameters" section. If a custom order is required or to insert images between parameters the "expose_parameter" function may be more useful in this scenario.
Returns:
Type | Description |
---|---|
None
|
None |
Examples:
1 |
|
expose_parameter
¶
expose_parameter(var_name)
Exposes the parameter defined within the current host application.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The string that matches the parameter name. |
required |
Returns: None
Examples:
1 |
|
get_result
¶
get_result(var_name)
Retrieves the variable result that is stored within the calculation report object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The string that matches the parameter name. |
required |
Returns:
Type | Description |
---|---|
Str | Numeric | pd.DataFrame: Provides the result of the argument requested, either as a |
|
primitive numerical, string or table-like (DataFrame) object. |
Examples:
1 |
|
get_result_from_stage
¶
get_result_from_stage(stage_index, var_name, default)
Retrieves the result from a variable if available from the staged specified by stage_index. If the variable is not available, the default variable will be returned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
int
|
Index of the stage to get the result from. |
required |
|
str
|
The string that matches the parameter name. |
required |
|
Any
|
Default value required if the specified stage has not provided a result. |
required |
Returns:
Type | Description |
---|---|
Str or Numeric: Provides the result of the argument requested, either as a primitive numeric or string |
|
object. |
Examples:
1 |
|
get_result_history
¶
get_result_history(var_name)
AppStage.get_result_history Retrieves the variable result history that is stored within the calculation report object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The string that matches the parameter name. |
required |
Returns:
Type | Description |
---|---|
List[str] or List[float]: Provides the result of the argument requested, |
|
either as a primitive numeric or string. |
Examples:
1 |
|
input_file_upload
¶
input_file_upload(var_name, fullname, visible=True, tooltip_text='', description='', allowed_extensions=None, label=None, max_size_mb=20.0, is_multiple=False, is_dynamic=False)
AppStage.input_file_upload Adds a fragment_content file to the report data. Low-level function, returns the bytes of the input file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The parameter name. Should be short and concise with no white spacing. |
required |
|
str
|
The full name of the parameter, can be descriptive. |
required |
|
bool
|
This can be set to False if the component should be calculated / evaluated but not be displayed in the body of the report. Default = True. |
True
|
|
str
|
Text to display as a tooltip in the webapp. Default = "". |
''
|
|
str
|
Text to describe the documentation for the parameter. Only shown in the "App Details" section. |
''
|
|
List[str]
|
List with the allowed extensions for this input, if None then all extensions are allowed. Default = None. |
None
|
|
str
|
Text to be displayed on the file uploader. |
None
|
|
Union[int, float]
|
Maximum allowed file size in Megabytes per file. Must be less than 200 Megabytes. Default = 20.0. |
20.0
|
|
bool
|
Allow multiple files to be uploaded. Default = False. |
False
|
|
bool
|
If set to True this will allow the input parameter to be dynamically created within the register_parameters section rather than the register_parameters section which is responsible for caching static input variables that are subsequently used to generate the documentation for an application. If the is_dynamic is used - it must be noted that the input properties created will not form part of the documentation as the input properties will be generated dynamically. |
False
|
Returns:
Type | Description |
---|---|
None | BaseFile | List[BaseFile]
|
|
Examples:
1 2 3 4 5 6 7 8 |
|
input_filter_param
¶
input_filter_param(file_name, filter_columns, default_filter_spec, var_name, visible=True, is_local=True, fullname='', reference='', description='', tooltip_text='')
Adds an input parameter to the calculation report.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The name of the csv resource to load (including the extension, i.e. file.csv). |
required |
|
List[str]
|
List of the column names from the csv to filter the data on. |
required |
|
List[str]
|
A starting entry that must be provided to the filter. |
required |
|
str
|
The parameter name. Should be short and concise with no white spacing. |
required |
|
bool
|
Define if the component is to be made visible in the "Detailed Output" section. Default = True |
True
|
|
bool
|
Specifies if the resource is located locally to the app python file. Otherwise, the app will look within global resources folder for the file. Default = True. |
True
|
|
str
|
The full name of the parameter, can be descriptive. |
''
|
|
str
|
Reference to the code, website or book. Default = "". |
''
|
|
str
|
Text to display as a tooltip in the webapp. Default = "". |
''
|
|
str
|
Text to describe the documentation for the parameter. |
''
|
Returns:
Type | Description |
---|---|
None |
input_multi_selection
¶
input_multi_selection(var_name, fullname, list_vals, default=None, is_numeric=False, is_dynamic=False, visible=True, description='', tooltip_text='')
Adds a multi-selection input type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The parameter name. Should be short and concise with no white spacing. |
required |
|
str
|
The full name of the parameter, can be descriptive. |
required |
|
List
|
A list of string values which the user can select from. |
required |
|
List
|
List with the items selected by default. Default = None (no items selected by default). |
None
|
|
bool
|
Default = false, therefore it is assumed to be a string, otherwise a numerical value (i.e. float). Default = False. |
False
|
|
bool
|
If set to True this will allow the input parameter to be dynamically created within the register_parameters section rather than the register_parameters section which is responsible for caching static input variables that are subsequently used to generate the documentation for an application. If the is_dynamic is used - it must be noted that the input properties created will not form part of the documentation as the input properties will be generated dynamically. |
False
|
|
bool
|
Define if the component is to be made visible in the "Detailed Output" section. Default = True |
True
|
|
str
|
Text to describe the documentation for the parameter. |
''
|
|
str
|
Text to display as a tooltip in the webapp. Default = "". |
''
|
Returns:
Type | Description |
---|---|
None |
Examples:
1 2 3 4 |
|
input_parameter
¶
input_parameter(var_name, fullname, bind_ui, reference='', unit='', format_str='{:.2f}', visible=True, tooltip_text='', description='', is_dynamic=False, helper_images=None)
AppStage.input_parameter Adds an input parameter to the calculation report.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The parameter name. Should be short and concise with no white spacing. |
required |
|
str
|
The full name of the parameter, can be descriptive. |
required |
|
UiGeneric
|
Add either a UI object here to ensure that custom user inputs can be bound to this value. |
required |
|
str
|
Reference to the code, website or book. Default = "". |
''
|
|
str
|
Should typically be "MPa" or other SI unit. Default = "". |
''
|
|
str
|
Should be in the format '{:.2f}' or similar. Default = "{:.2f}" |
'{:.2f}'
|
|
bool
|
This can be set to False if the component should be calculated / evaluated but not be displayed in the body of the report. Default = True. |
True
|
|
str
|
Text to display as a tooltip in the webapp. Default = "". |
''
|
|
str
|
Text to describe the documentation for the parameter. Only shown in the "App Details" section. |
''
|
|
bool
|
If set to True this will allow the input parameter to be dynamically created within the register_parameters section rather than the register_parameters section which is responsible for caching static input variables that are subsequently used to generate the documentation for an application. If the is_dynamic is used - it must be noted that the input properties created will not form part of the documentation as the input properties will be generated dynamically. |
False
|
|
Optional[List[CbImage]]
|
Choose helper images for the input. This adds a button on the side of the input parameter which, when clicked, opens a pop-up window with the provided helper images and the input parameter itself. Default = None. |
None
|
Returns:
Type | Description |
---|---|
None |
Examples:
1 2 3 4 5 6 7 |
|
input_text
¶
input_text(var_name, fullname, reference='', default='', visible=True, max_chars=100, max_rows=1, description='', tooltip_text='', is_dynamic=False)
AppStage.input_text Adds a text field input parameter to the calculation report.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The parameter name. Should be short and concise with no white spacing. |
required |
|
str
|
The full name of the parameter, can be descriptive. |
required |
|
str
|
Reference to the code, website or book. Default = "". |
''
|
|
str
|
The default reference value for the input string. |
''
|
|
bool
|
This can be set to false if the equation should not be displayed in the calculation report. Default = True. |
True
|
|
int
|
Specifies the maximum number of characters that the user can enter. Default = 100. |
100
|
|
int
|
Specifies the maximum number of rows that the user can enter. Default = 1. Default = "". |
1
|
|
str
|
Text to display as a tooltip in the webapp. Default = "". |
''
|
|
str
|
Text to describe the documentation for the parameter. |
''
|
|
bool
|
If set to True this will allow the input parameter to be dynamically created within the register_parameters section rather than the register_parameters section which is responsible for caching static input variables that are subsequently used to generate the documentation for an application. If the is_dynamic is used - it must be noted that the input properties created will not form part of the documentation as the input properties will be generated dynamically. |
False
|
Returns:
Type | Description |
---|---|
None |
Examples:
1 |
|
input_upload_db
¶
input_upload_db(fullname, var_name, visible=True, max_file_size_mb=100, description='')
Gives the user the ability to upload an SQLite database which can then subsequently be read by a following stage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The full name of the parameter, can be descriptive. |
required |
|
str
|
The parameter name. Should be short and concise with no white spacing. |
required |
|
bool
|
Define if the component is to be made visible in the "Detailed Output" section. Default = True |
True
|
|
float
|
This by default is set to 100MB. |
100
|
|
str
|
Text to describe the documentation for the parameter. |
''
|
Returns:
Type | Description |
---|---|
None |
input_user_table
¶
input_user_table(var_name, fullname, col_formats, visible=True, default=None, title=None, min_rows=1, max_rows=100, is_file=False, description='', tooltip_text='')
AppStage.input_user_table Adds a table to the report that can be used to enter user data or copy data into the application from Excel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The parameter name. Should be short and concise with no white spacing. |
required |
|
str
|
The full name of the parameter, can be descriptive. |
required |
|
List[ColumnFormat]
|
Provide a list of column formats for the table. The column formats define the type of data input, and other constraining parameters. |
required |
|
bool
|
Define if the component is to be made visible in the "Detailed Output" section. Default = True |
True
|
|
List[List[]]
|
Default=None. The data can be of either, string or float type. None value can be provided since default values can be generated from the information provided by the col_formats. |
None
|
|
str
|
Set a specific longer title for the input table. |
None
|
|
int
|
Default=1 (>0). Specifies the minimum number of rows that should be supplied by the user. Default = 1. |
1
|
|
int
|
Default=100 (>0). Specifies the maximum number of rows that can be supplied by the user. "max_rows" must be greater than or equal to "min_rows". NB: min_rows and max_rows can be the same value, therefore fixing the total number of rows. Default = 100. |
100
|
|
bool
|
True if the table should be imported as a csv file or if the user should manually input data to the table. For tables larger than a few rows, import from a csv file is recommended. |
False
|
|
str
|
Text to describe the documentation for the parameter. |
''
|
|
str
|
Text to display as a tooltip in the webapp. Default = "". |
''
|
Returns:
Type | Description |
---|---|
None
|
None |
Examples:
1 2 3 |
|
load_csv_as_df
¶
load_csv_as_df(file_name, is_local=True)
Load the csv from the app resource collection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The filename of the resource to load. Accepts only .csv files. |
required |
|
bool
|
If local the file should reside within the parent folder of this app. Alternatively, this can be set to False and the file should be located within the "shared" folder. |
True
|
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: Returns the file as a Pandas.Dataframe object. |
Examples:
1 |
|
load_file_as_bytes
¶
load_file_as_bytes(file_name, is_local=True)
Load the file as bytes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The filename of the resource to load. |
required |
|
bool
|
If local the file should reside within the parent folder of this app. Alternatively, this can be set to False and the file should be located within the "shared" folder. |
True
|
Returns: bytes: Returns the file as bytes.
Examples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
map_vars_from_stage
¶
map_vars_from_stage(stage_index, var_mapping, var_names_to_render=None)
Maps variables from a previous stage defined by "stage_index" to the current stage using the mapping defined "var_mapping". This mapping creates a copy of the objects in the current stage. This function is only available in multi-stage apps.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
int
|
Index of the stage to get the results from. |
required |
|
Dict[str, str]
|
Map the variable |
required |
|
List[str] | None
|
List with the variables (output) names to include in the report. If "None" all variable names will be rendered. If you want to exclude all output, enter and empty list. Default=None. |
None
|
Returns:
Type | Description |
---|---|
None |
Examples:
1 2 3 4 |
|
ref_to_summary
¶
ref_to_summary(ref_var_name)
Adds the chart calculation, decision, to the summary tab of the report.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
Provide the string that matches the parameter name. |
required |
Returns: None
Examples:
1 |
|
run_batch
¶
run_batch(inner_app, df, var_names_to_append)
Runs other applications within your app collection in a batch mode. The variables provided in the form of a pandas dataframe.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Type[AppStageCompute]
|
Provide the type of the app to be executed within this host app |
required |
|
Dataframe
|
Provide a dataframe of all the input variables required to execute the "inner_app". Each column should be named identically with the variable name. NB: Default variables will be used if not all the parameters are supplied in the dataframe. |
required |
|
List[str]
|
Provide a list of strings that are the variable names generated when the "inner_app" is executed the resulting values are appended to the dataframe. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pd.Dataframe |