paidiverpy.frontend.widgets.app#

Paidiverpy App: Interactive Pipeline Builder and Image Processor.

Classes#

App

Main application class for the Paidiverpy frontend.

Module Contents#

class paidiverpy.frontend.widgets.app.App[source]#

Main application class for the Paidiverpy frontend.

create_pipeline_widget() None[source]#

Create the pipeline widget to display the current pipeline configuration.

create_modal(title: str = '', information: str = '', on_cancel: bool = False, on_confirm: collections.abc.Callable | None = None, visible: bool = False) panel.Column[source]#

Create a modal dialog for confirmation actions.

Parameters:
  • title (str) – The title of the modal.

  • information (str) – The information to display in the modal.

  • on_cancel (bool) – Whether to attach a cancel action.

  • on_confirm (Callable, optional) – A callback function for confirmation action.

  • visible (bool) – Whether the modal should be visible initially.

Returns:

A Panel Column containing the modal dialog.

Return type:

pn.Column

update_modal(title: str, information: str, on_confirm: collections.abc.Callable | None = None, on_cancel: collections.abc.Callable | None = None) None[source]#

Update the modal dialog with new content and callbacks.

Parameters:
  • title (str) – The new title for the modal.

  • information (str) – The new information message for the modal.

  • on_confirm (Callable, optional) – A callback function for confirmation action.

  • on_cancel (Callable, optional) – A callback function for cancellation action.

update_alert(information: str = '', title: str = '', alert_type: str = 'success', visible: bool = True) None[source]#

Update the alert widget with a message.

Parameters:
  • information (str) – The information message to display.

  • title (str) – The title of the alert.

  • alert_type (str) – The type of alert (e.g., “success”, “danger”).

  • visible (bool) – Whether the alert should be visible.

create_pipeline_functionality() None[source]#

Create the functionality for running the pipeline.

update_images() None[source]#

Update the images widget with the processed images from the pipeline.

update_images_widget() None[source]#

Update the images widget to display the processed images.

create_template() panel.template.BootstrapTemplate[source]#

Create the main application template with sidebar and main content.

Returns:

The main application template.

Return type:

pn.template.BootstrapTemplate

confirm_general_update(widgets: panel.Column) None[source]#

Confirm the update of the general configuration.

Parameters:

widgets (pn.Column) – The widgets containing the general configuration inputs.

create_general_widget() paidiverpy.frontend.widgets.config_general.AppGeneral[source]#

Create the general configuration widget to manage the pipeline’s general settings.

Returns:

An instance of the AppGeneral class containing the general configuration widget.

Return type:

AppGeneral

create_steps_widget() panel.Column[source]#

Create the steps widget to manage the steps in the pipeline.

Returns:

A Panel Column containing the steps configuration form.

Return type:

pn.Column

create_steps_form() panel.Column[source]#

Create the steps form for adding or updating steps in the pipeline.

Returns:

A Panel Column containing the steps form.

Return type:

pn.Column

create_form(step_number: int, step_parameters: dict | None = None) panel.Column[source]#

Create a form for adding or updating a step in the pipeline.

Parameters:
  • step_number (int) – The step number for the form.

  • step_parameters (dict | None) – Optional parameters for the step if updating.

Returns:

A Panel Column containing the form for the step.

Return type:

pn.Column

create_images_widget() panel.Column[source]#

Create the images widget to display the processed images.

Returns:

A Panel Column containing the images output editor.

Return type:

pn.Column

create_code_yaml_widget() panel.Column[source]#

Create the code and YAML output widget to display the generated configuration and code.

Returns:

A Panel Column containing the YAML and code output editors.

Return type:

pn.Column

create_yaml_widget() panel.Column[source]#

Create the YAML output widget to display the generated configuration.

Returns:

A Panel Column containing the YAML output editor and export button.

Return type:

pn.Column

create_code_widget() panel.Column[source]#

Create the code output widget to display the generated code.

Returns:

A Panel Column containing the code output editor.

Return type:

pn.Column

get_button_name(expanded: str, title: str) str[source]#

Get the button name based on the expansion state.

Parameters:
  • expanded (str) – The key in the self.expanded dictionary.

  • title (str) – The title of the section.

Returns:

The formatted button name with an arrow indicating expansion state.

Return type:

str

update_general_configuration(json_str: dict) bool[source]#

Update the general configuration of the pipeline.

Parameters:

json_str (dict) – The JSON string containing the general configuration.

Returns:

True if the configuration was updated successfully, False otherwise.

Return type:

bool

update_step_configuration(json_str: dict, idx: int | None = None) None[source]#

Update the step configuration in the pipeline.

Parameters:
  • json_str (dict) – The JSON string containing the step configuration.

  • idx (int | None) – The index of the step to update. If None, a new step is added.

show() None[source]#

Display the application.