«
class documentation

class Operations(object): (source)

Constructor: Operations(ctx)

View In Hierarchy

Interface to trigger builtin operations on an execution context.

Parameters
ctxan fiftyone.operators.executor.ExecutionContext
Method __init__ Undocumented
Method apply_panel_state_path Force update the state for path in the specified panel in the App.
Method clear_all_stages Clear all selections, filters, and view stages from the App.
Method clear_panel_data Clear the data of the specified panel in the App.
Method clear_panel_state Clear the state of the specified panel in the App.
Method clear_sample_field Clear the contents of a sample field.
Method clear_selected_labels Clear the selected labels in the App.
Method clear_selected_samples Clear selected samples in the App.
Method clear_sidebar_filters Clear all filters in the App's sidebar.
Method clear_view Clear the view bar in the App.
Method clone_sample_field Clone a sample field to a new field name.
Method clone_selected_samples Clone the selected samples in the App.
Method close_all_panels Close all open panels in the App.
Method close_panel Close the given panel in the App.
Method close_sample Closes the App's sample modal.
Method console_log Log a message to the console.
Method convert_extended_selection_to_selected_samples Convert the extended selection to selected samples in the App.
Method copy_view_as_json Copy the current view in the App as JSON.
Method delete_sample_field Delete a sample field.
Method delete_selected_labels Delete the selected labels in the App.
Method delete_selected_samples Delete the selected samples in the App.
Method hide_sidebar Hide the App's sidebar.
Method list_files List files in a directory or list filesystems.
Method notify Show a notification in the App.
Method open_all_panels Open all available panels in the App.
Method open_dataset Open the specified dataset in the App.
Method open_panel Open a panel with the given name and layout options in the App.
Method open_sample Opens the specified sample or group in the App's sample modal.
Method patch_panel_data Patch the state of the specified panel in the App.
Method patch_panel_state Patch the state of the specified panel in the App.
Method print_stdout Print a message to the standard output.
Method reduce_panel_state Reduce the state of the specified panel in the App.
Method refresh_colors Refresh the colors used in the App's UI.
Method register_panel Registers a panel with the given name and lifecycle callbacks.
Method reload_dataset Reload the dataset in the App.
Method reload_samples Reload the sample grid in the App.
Method rename_sample_field Rename a sample field to a new field name.
Method set_active_fields Set the active fields in the App.
Method set_extended_selection Sets the extended selection in the App.
Method set_group_slice Set the active group slice in the App.
Method set_panel_data Set the entire data of the specified panel in the App.
Method set_panel_state Set the entire state of the specified panel in the App.
Method set_panel_title Set the title of the specified panel in the App.
Method set_progress Set the progress indicator in the App's UI.
Method set_selected_labels Set the selected labels in the App.
Method set_selected_samples Select the specified samples in the App.
Method set_spaces Sets the current spaces in the App.
Method set_view Set the current view in the App.
Method show_output Show output in the App's UI.
Method show_panel_output Show output in the specified panel in the App.
Method show_samples Show specific samples, optionally using extended selection in the App.
Method show_selected_samples Show the samples that are currently selected in the App.
Method show_sidebar Show the App's sidebar.
Method split_panel Split the panel with the given layout in the App.
Method test_operator Test the operator with given parameters.
Method toggle_sidebar Toggle the visibility of the App's sidebar.
Method track_event Track an event in the App.
Method view_from_json Set the view in the App from JSON present in clipboard.
Method _create_panel_params Undocumented
Instance Variable _ctx Undocumented
def __init__(self, ctx): (source)

Undocumented

def apply_panel_state_path(self, path, panel_id=None): (source)

Force update the state for path in the specified panel in the App.

Parameters
path:strthe path to force update
panel_idUndocumented
def clear_all_stages(self): (source)

Clear all selections, filters, and view stages from the App.

def clear_panel_data(self, panel_id=None): (source)

Clear the data of the specified panel in the App.

Parameters
panel_id:Nonethe optional ID of the panel to clear. If not provided, the ctx.panel_id will be used
def clear_panel_state(self, panel_id=None): (source)

Clear the state of the specified panel in the App.

Parameters
panel_id:Nonethe optional ID of the panel to clear. If not provided, the ctx.panel_id will be used
def clear_sample_field(self, field_name): (source)

Clear the contents of a sample field.

Parameters
field_namethe name of the field to clear
def clear_selected_labels(self): (source)

Clear the selected labels in the App.

def clear_selected_samples(self): (source)

Clear selected samples in the App.

def clear_sidebar_filters(self): (source)

Clear all filters in the App's sidebar.

def clear_view(self): (source)

Clear the view bar in the App.

def clone_sample_field(self, field_name, new_field_name): (source)

Clone a sample field to a new field name.

Parameters
field_namethe name of the field to clone
new_field_namethe name for the new field
def clone_selected_samples(self): (source)

Clone the selected samples in the App.

def close_all_panels(self): (source)

Close all open panels in the App.

def close_panel(self, name=None, id=None): (source)

Close the given panel in the App.

Parameters
name:Nonethe name of the panel to close
id:Nonethe ID of the panel to close
def close_sample(self): (source)

Closes the App's sample modal.

def console_log(self, message): (source)

Log a message to the console.

Parameters
messagethe message to log
def convert_extended_selection_to_selected_samples(self): (source)

Convert the extended selection to selected samples in the App.

def copy_view_as_json(self): (source)

Copy the current view in the App as JSON.

def delete_sample_field(self, field_name): (source)

Delete a sample field.

Parameters
field_namethe name of the field to delete
def delete_selected_labels(self): (source)

Delete the selected labels in the App.

def delete_selected_samples(self): (source)

Delete the selected samples in the App.

def hide_sidebar(self): (source)

Hide the App's sidebar.

def list_files(self, path=None, list_filesystems=False): (source)

List files in a directory or list filesystems.

Parameters
path:Nonethe path to list files from, or None to list filesystems
list_filesystems:Falsewhether to list filesystems instead of files
def notify(self, message, variant='info'): (source)

Show a notification in the App.

Variants are "info", "success", "warning", and "error".

Parameters
messagethe message to show
variant:"info"the type of notification
def open_all_panels(self): (source)

Open all available panels in the App.

def open_dataset(self, dataset_name): (source)

Open the specified dataset in the App.

Parameters
dataset_namethe name of the dataset to open
def open_panel(self, name, is_active=True, layout=None, force=False, force_duplicate=False): (source)

Open a panel with the given name and layout options in the App.

Parameters
namethe name of the panel to open
is_active:Truewhether to activate the panel immediately
layout:Nonethe layout orientation ("horizontal", "vertical"), if applicable
force:Falsewhether to force open the panel. Skips the check to see if a panel with the same name exists or whether the panel declares allow_multiple=False
force_duplicate:Falsewhether to force open the panel even if it is already open. Only applicable if force is True
def open_sample(self, id=None, group_id=None): (source)

Opens the specified sample or group in the App's sample modal.

Parameters
id:Nonea sample ID to open in the modal
group_id:Nonea group ID to open in the modal
def patch_panel_data(self, data, panel_id=None): (source)

Patch the state of the specified panel in the App.

Parameters
datathe data to set
panel_id:Nonethe optional ID of the panel to clear. If not provided, the ctx.panel_id will be used
def patch_panel_state(self, state, panel_id=None): (source)

Patch the state of the specified panel in the App.

Parameters
statethe state to set
panel_id:Nonethe optional ID of the panel to clear. If not provided, the ctx.panel_id will be used
def print_stdout(self, message): (source)

Print a message to the standard output.

Parameters
messagethe message to print
def reduce_panel_state(self, reducer, panel_id=None): (source)

Reduce the state of the specified panel in the App.

Parameters
reducerthe reducer to apply
panel_id:Nonethe optional ID of the panel to clear. If not provided, the ctx.panel_id will be used
def refresh_colors(self): (source)

Refresh the colors used in the App's UI.

def register_panel(self, name, label, help_markdown=None, category=Categories.CUSTOM, beta=False, is_new=False, icon=None, light_icon=None, dark_icon=None, surfaces='grid', on_load=None, on_unload=None, on_change=None, on_change_ctx=None, on_change_dataset=None, on_change_view=None, on_change_spaces=None, on_change_current_sample=None, on_change_selected=None, on_change_selected_labels=None, on_change_extended_selection=None, on_change_group_slice=None, on_change_query_performance=None, allow_duplicates=False, priority=None, _builtin=False): (source)

Registers a panel with the given name and lifecycle callbacks.

Parameters
namethe name of the panel
labelthe display name of the panel
help_markdown:Nonehelp text associated with the panel in markdown format
category:Categories.CUSTOMthe category of the panel
beta:Falsewhether the panel is in beta
is_new:Falsewhether the panel is new
icon:Nonethe icon to show in the panel's tab
light_icon:Nonethe icon to show in the panel's tab when the App is in light mode
dark_icon:Nonethe icon to show in the panel's tab when the App is in dark mode
surfaces:'grid'surfaces in which to show the panel. Must be one of 'grid', 'modal', or 'grid modal'
on_load:Nonean operator to invoke when the panel is loaded
on_unload:Nonean operator to invoke when the panel is unloaded
on_change:Nonean operator to invoke when the panel state changes
on_change_ctx:Nonean operator to invoke when the panel execution context changes
on_change_dataset:Nonean operator to invoke when the current dataset changes
on_change_view:Nonean operator to invoke when the current view changes
on_change_spaces:Nonean operator to invoke when the current spaces layout changes
on_change_current_sample:Nonean operator to invoke when the current sample changes
on_change_selected:Nonean operator to invoke when the current selected samples changes
on_change_selected_labels:Nonean operator to invoke when the current selected labels changes
on_change_extended_selection:Nonean operator to invoke when the current extended selection changes
on_change_group_slice:Nonean operator to invoke when the group slice changes
on_change_query_performance:Nonean operator to invoke when the query performance changes
allow_duplicates:Falsewhether to allow multiple instances of the panel to the opened
priority:Nonethe priority of the panel, used for sort order
_builtin:Falsewhether the panel is a builtin panel
def reload_dataset(self): (source)

Reload the dataset in the App.

def reload_samples(self): (source)

Reload the sample grid in the App.

def rename_sample_field(self, field_name, new_field_name): (source)

Rename a sample field to a new field name.

Parameters
field_namethe name of the field to rename
new_field_namethe new name for the field
def set_active_fields(self, fields=None): (source)

Set the active fields in the App.

Parameters
fields:Nonethe possibly-empty list of fields or embedded.fields to set
def set_extended_selection(self, selection=None, scope=None, clear=False, reset=False): (source)

Sets the extended selection in the App.

Parameters
selection:Nonethe selection to set
scope:Nonethe scope of the selection
clear:Nonewhether to clear the selection
reset:Nonewhether to reset the selection
def set_group_slice(self, slice): (source)

Set the active group slice in the App.

Parameters
slicethe group slice to activate
def set_panel_data(self, data, panel_id=None): (source)

Set the entire data of the specified panel in the App.

Parameters
datathe data to set
panel_id:Nonethe optional ID of the panel to clear. If not provided, the ctx.panel_id will be used
def set_panel_state(self, state, panel_id=None): (source)

Set the entire state of the specified panel in the App.

Parameters
statethe state to set
panel_id:Nonethe optional ID of the panel to clear. If not provided, the ctx.panel_id will be used
def set_panel_title(self, id=None, title=None): (source)

Set the title of the specified panel in the App.

Parameters
id:Nonethe ID of the panel to set the title
title:Nonethe title to set
def set_progress(self, label=None, progress=None, variant=None): (source)

Set the progress indicator in the App's UI.

Parameters
label:Nonea label for the progress indicator
progress:Nonea progress value to set
variant:Nonethe type of indicator ("linear", "circular")
def set_selected_labels(self, labels): (source)

Set the selected labels in the App.

Parameters
labelsthe labels to select
def set_selected_samples(self, samples): (source)

Select the specified samples in the App.

Parameters
samplesa list of sample IDs to select
def set_spaces(self, spaces=None, name=None): (source)

Sets the current spaces in the App.

Parameters
spaces:Nonea fiftyone.core.odm.workspace.Space to load
name:Nonethe name of the workspace to load
def set_view(self, view=None, name=None): (source)

Set the current view in the App.

Parameters
view:Nonea fiftyone.core.view.DatasetView to load
name:Nonethe name of a saved view to load
def show_output(self, outputs, results): (source)

Show output in the App's UI.

Parameters
outputsoutputs to show
resultsresults to display
def show_panel_output(self, output, panel_id=None): (source)

Show output in the specified panel in the App.

Parameters
outputthe output to show
panel_id:Nonethe optional ID of the panel to clear. If not provided, the ctx.panel_id will be used
def show_samples(self, samples, use_extended_selection=False): (source)

Show specific samples, optionally using extended selection in the App.

Parameters
samplesa list of sample IDs to show
use_extended_selection:Falsewhether to use the extended selection feature
def show_selected_samples(self): (source)

Show the samples that are currently selected in the App.

def show_sidebar(self): (source)

Show the App's sidebar.

def split_panel(self, name, layout): (source)

Split the panel with the given layout in the App.

Parameters
namethe name of the panel to split
layoutthe layout orientation ("horizontal", "vertical")
def test_operator(self, operator, raw_params): (source)

Test the operator with given parameters.

Parameters
operatorthe operator to test
raw_paramsraw parameters for the operator
def toggle_sidebar(self): (source)

Toggle the visibility of the App's sidebar.

def track_event(self, event, properties=None): (source)

Track an event in the App.

Parameters
eventthe event to track
properties:Nonethe properties to track
def view_from_json(self): (source)

Set the view in the App from JSON present in clipboard.

def _create_panel_params(self, panel_id, state=None, data=None): (source)

Undocumented

Undocumented