<!-- # hard line break macro for HTML -->

# fiftyone.operators.operations

FiftyOne operator execution.

Copyright 2017-2026, Voxel51, Inc.
<br/>
[voxel51.com](https://voxel51.com/)
<br/>
<br/>

**Functions:**

| [`build_register_panel_params`](#fiftyone.operators.operations.build_register_panel_params)(name, label[, ...])   | Builds the params for the `register_panel` operation.   |
|-------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|

**Classes:**

| [`Operations`](#fiftyone.operators.operations.Operations)(ctx)   | Interface to trigger builtin operations on an execution context.   |
|------------------------------------------------------------------|--------------------------------------------------------------------|

### fiftyone.operators.operations.build_register_panel_params(name, label, help_markdown=None, category=Categories.CUSTOM, alpha=False, 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, on_change_active_fields=None, allow_duplicates=False, priority=None, \_builtin=False)

Builds the params for the `register_panel` operation.

### *class* fiftyone.operators.operations.Operations(ctx)

Bases: `object`

Interface to trigger builtin operations on an execution context.

* **Parameters:**
  **ctx** – an [`fiftyone.operators.executor.ExecutionContext`](fiftyone.operators.executor.md#fiftyone.operators.executor.ExecutionContext)

**Methods:**

| [`clone_selected_samples`](#fiftyone.operators.operations.Operations.clone_selected_samples)()                                                 | Clone the selected samples in the App.                                  |
|------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|
| [`clone_sample_field`](#fiftyone.operators.operations.Operations.clone_sample_field)(field_name, new_field_name)                               | Clone a sample field to a new field name.                               |
| [`rename_sample_field`](#fiftyone.operators.operations.Operations.rename_sample_field)(field_name, new_field_name)                             | Rename a sample field to a new field name.                              |
| [`clear_sample_field`](#fiftyone.operators.operations.Operations.clear_sample_field)(field_name)                                               | Clear the contents of a sample field.                                   |
| [`delete_selected_samples`](#fiftyone.operators.operations.Operations.delete_selected_samples)()                                               | Delete the selected samples in the App.                                 |
| [`delete_selected_labels`](#fiftyone.operators.operations.Operations.delete_selected_labels)()                                                 | Delete the selected labels in the App.                                  |
| [`delete_sample_field`](#fiftyone.operators.operations.Operations.delete_sample_field)(field_name)                                             | Delete a sample field.                                                  |
| [`print_stdout`](#fiftyone.operators.operations.Operations.print_stdout)(message)                                                              | Print a message to the standard output.                                 |
| [`list_files`](#fiftyone.operators.operations.Operations.list_files)([path, list_filesystems])                                                 | List files in a directory or list filesystems.                          |
| [`reload_samples`](#fiftyone.operators.operations.Operations.reload_samples)()                                                                 | Reload the sample grid in the App.                                      |
| [`reload_dataset`](#fiftyone.operators.operations.Operations.reload_dataset)()                                                                 | Reload the dataset in the App.                                          |
| [`clear_selected_samples`](#fiftyone.operators.operations.Operations.clear_selected_samples)()                                                 | Clear selected samples in the App.                                      |
| [`copy_view_as_json`](#fiftyone.operators.operations.Operations.copy_view_as_json)()                                                           | Copy the current view in the App as JSON.                               |
| [`view_from_json`](#fiftyone.operators.operations.Operations.view_from_json)()                                                                 | Set the view in the App from JSON present in clipboard.                 |
| [`clear_panel_state`](#fiftyone.operators.operations.Operations.clear_panel_state)([panel_id])                                                 | Clear the state of the specified panel in the App.                      |
| [`clear_panel_data`](#fiftyone.operators.operations.Operations.clear_panel_data)([panel_id])                                                   | Clear the data of the specified panel in the App.                       |
| [`set_panel_state`](#fiftyone.operators.operations.Operations.set_panel_state)(state[, panel_id])                                              | Set the entire state of the specified panel in the App.                 |
| [`set_panel_data`](#fiftyone.operators.operations.Operations.set_panel_data)(data[, panel_id])                                                 | Set the entire data of the specified panel in the App.                  |
| [`patch_panel_state`](#fiftyone.operators.operations.Operations.patch_panel_state)(state[, panel_id])                                          | Patch the state of the specified panel in the App.                      |
| [`patch_panel_data`](#fiftyone.operators.operations.Operations.patch_panel_data)(data[, panel_id])                                             | Patch the state of the specified panel in the App.                      |
| [`reduce_panel_state`](#fiftyone.operators.operations.Operations.reduce_panel_state)(reducer[, panel_id])                                      | Reduce the state of the specified panel in the App.                     |
| [`apply_panel_state_path`](#fiftyone.operators.operations.Operations.apply_panel_state_path)(path[, panel_id])                                 | Force update the state for path in the specified panel in the App.      |
| [`show_panel_output`](#fiftyone.operators.operations.Operations.show_panel_output)(output[, panel_id])                                         | Show output in the specified panel in the App.                          |
| [`open_panel`](#fiftyone.operators.operations.Operations.open_panel)(name[, is_active, layout, force, ...])                                    | Open a panel with the given name and layout options in the App.         |
| [`register_panel`](#fiftyone.operators.operations.Operations.register_panel)(name, label[, help_markdown, ...])                                | Registers a panel with the given name and lifecycle callbacks.          |
| [`open_all_panels`](#fiftyone.operators.operations.Operations.open_all_panels)()                                                               | Open all available panels in the App.                                   |
| [`close_panel`](#fiftyone.operators.operations.Operations.close_panel)([name, id])                                                             | Close the given panel in the App.                                       |
| [`close_all_panels`](#fiftyone.operators.operations.Operations.close_all_panels)()                                                             | Close all open panels in the App.                                       |
| [`split_panel`](#fiftyone.operators.operations.Operations.split_panel)(name, layout)                                                           | Split the panel with the given layout in the App.                       |
| [`open_dataset`](#fiftyone.operators.operations.Operations.open_dataset)(dataset_name)                                                         | Open the specified dataset in the App.                                  |
| [`clear_view`](#fiftyone.operators.operations.Operations.clear_view)()                                                                         | Clear the view bar in the App.                                          |
| [`clear_sidebar_filters`](#fiftyone.operators.operations.Operations.clear_sidebar_filters)()                                                   | Clear all filters in the App's sidebar.                                 |
| [`clear_all_stages`](#fiftyone.operators.operations.Operations.clear_all_stages)()                                                             | Clear all selections, filters, and view stages from the App.            |
| [`refresh_colors`](#fiftyone.operators.operations.Operations.refresh_colors)()                                                                 | Refresh the colors used in the App's UI.                                |
| [`show_selected_samples`](#fiftyone.operators.operations.Operations.show_selected_samples)()                                                   | Show the samples that are currently selected in the App.                |
| [`convert_extended_selection_to_selected_samples`](#fiftyone.operators.operations.Operations.convert_extended_selection_to_selected_samples)() | Convert the extended selection to selected samples in the App.          |
| [`set_selected_samples`](#fiftyone.operators.operations.Operations.set_selected_samples)(samples)                                              | Select the specified samples in the App.                                |
| [`set_sample_selection_style`](#fiftyone.operators.operations.Operations.set_sample_selection_style)([default, alt])                           | Set the sample grid selection style in the App.                         |
| [`clear_sample_selection_style`](#fiftyone.operators.operations.Operations.clear_sample_selection_style)()                                     | Clear the sample grid selection style in the App, reverting to default. |
| [`set_label_selection_style`](#fiftyone.operators.operations.Operations.set_label_selection_style)([default, alt])                             | Set the label selection style in the App.                               |
| [`clear_label_selection_style`](#fiftyone.operators.operations.Operations.clear_label_selection_style)()                                       | Clear the label selection style in the App, reverting to default.       |
| [`set_view`](#fiftyone.operators.operations.Operations.set_view)([view, name])                                                                 | Set the current view in the App.                                        |
| [`show_samples`](#fiftyone.operators.operations.Operations.show_samples)(samples[, use_extended_selection])                                    | Show specific samples, optionally using extended selection in the App.  |
| [`console_log`](#fiftyone.operators.operations.Operations.console_log)(message)                                                                | Log a message to the console.                                           |
| [`show_output`](#fiftyone.operators.operations.Operations.show_output)(outputs, results)                                                       | Show output in the App's UI.                                            |
| [`set_progress`](#fiftyone.operators.operations.Operations.set_progress)([label, progress, variant])                                           | Set the progress indicator in the App's UI.                             |
| [`test_operator`](#fiftyone.operators.operations.Operations.test_operator)(operator, raw_params)                                               | Test the operator with given parameters.                                |
| [`set_selected_labels`](#fiftyone.operators.operations.Operations.set_selected_labels)(labels)                                                 | Set the selected labels in the App.                                     |
| [`clear_selected_labels`](#fiftyone.operators.operations.Operations.clear_selected_labels)()                                                   | Clear the selected labels in the App.                                   |
| [`notify`](#fiftyone.operators.operations.Operations.notify)(message[, variant])                                                               | Show a notification in the App.                                         |
| [`set_extended_selection`](#fiftyone.operators.operations.Operations.set_extended_selection)([selection, scope, ...])                          | Sets the extended selection in the App.                                 |
| [`set_spaces`](#fiftyone.operators.operations.Operations.set_spaces)([spaces, name])                                                           | Sets the current spaces in the App.                                     |
| [`set_active_fields`](#fiftyone.operators.operations.Operations.set_active_fields)([fields])                                                   | Set the active fields in the App.                                       |
| [`clear_active_fields`](#fiftyone.operators.operations.Operations.clear_active_fields)()                                                       | Clear the active fields in the App.                                     |
| [`track_event`](#fiftyone.operators.operations.Operations.track_event)(event[, properties])                                                    | Track an event in the App.                                              |
| [`set_panel_title`](#fiftyone.operators.operations.Operations.set_panel_title)([id, title])                                                    | Set the title of the specified panel in the App.                        |
| [`set_group_slice`](#fiftyone.operators.operations.Operations.set_group_slice)(slice)                                                          | Set the active group slice in the App.                                  |
| [`open_sample`](#fiftyone.operators.operations.Operations.open_sample)([id, group_id])                                                         | Opens the specified sample or group in the App's sample modal.          |
| [`close_sample`](#fiftyone.operators.operations.Operations.close_sample)()                                                                     | Closes the App's sample modal.                                          |
| [`show_sidebar`](#fiftyone.operators.operations.Operations.show_sidebar)()                                                                     | Show the App's sidebar.                                                 |
| [`hide_sidebar`](#fiftyone.operators.operations.Operations.hide_sidebar)()                                                                     | Hide the App's sidebar.                                                 |
| [`toggle_sidebar`](#fiftyone.operators.operations.Operations.toggle_sidebar)()                                                                 | Toggle the visibility of the App's sidebar.                             |
| [`browser_download`](#fiftyone.operators.operations.Operations.browser_download)(url[, filename])                                              | Download a file from a URL using the browser's download functionality.  |

#### clone_selected_samples()

Clone the selected samples in the App.

#### clone_sample_field(field_name, new_field_name)

Clone a sample field to a new field name.

* **Parameters:**
  * **field_name** – the name of the field to clone
  * **new_field_name** – the name for the new field

#### rename_sample_field(field_name, new_field_name)

Rename a sample field to a new field name.

* **Parameters:**
  * **field_name** – the name of the field to rename
  * **new_field_name** – the new name for the field

#### clear_sample_field(field_name)

Clear the contents of a sample field.

* **Parameters:**
  **field_name** – the name of the field to clear

#### delete_selected_samples()

Delete the selected samples in the App.

#### delete_selected_labels()

Delete the selected labels in the App.

#### delete_sample_field(field_name)

Delete a sample field.

* **Parameters:**
  **field_name** – the name of the field to delete

#### print_stdout(message)

Print a message to the standard output.

* **Parameters:**
  **message** – the message to print

#### list_files(path=None, list_filesystems=False)

List files in a directory or list filesystems.

* **Parameters:**
  * **path** (*None*) – the path to list files from, or None to list
    filesystems
  * **list_filesystems** (*False*) – whether to list filesystems instead of
    files

#### reload_samples()

Reload the sample grid in the App.

#### reload_dataset()

Reload the dataset in the App.

#### clear_selected_samples()

Clear selected samples in the App.

#### copy_view_as_json()

Copy the current view in the App as JSON.

#### view_from_json()

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

#### clear_panel_state(panel_id=None)

Clear the state of the specified panel in the App.

* **Parameters:**
  **panel_id** (*None*) – the optional ID of the panel to clear.
  If not provided, the `ctx.panel_id` will be used

#### clear_panel_data(panel_id=None)

Clear the data of the specified panel in the App.

* **Parameters:**
  **panel_id** (*None*) – the optional ID of the panel to clear.
  If not provided, the `ctx.panel_id` will be used

#### set_panel_state(state, panel_id=None)

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

* **Parameters:**
  * **state** – the state to set
  * **panel_id** (*None*) – the optional ID of the panel to clear.
    If not provided, the `ctx.panel_id` will be used

#### set_panel_data(data, panel_id=None)

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

* **Parameters:**
  * **data** – the data to set
  * **panel_id** (*None*) – the optional ID of the panel to clear.
    If not provided, the `ctx.panel_id` will be used

#### patch_panel_state(state, panel_id=None)

Patch the state of the specified panel in the App.

* **Parameters:**
  * **state** – the state to set
  * **panel_id** (*None*) – the optional ID of the panel to clear.
    If not provided, the `ctx.panel_id` will be used

#### patch_panel_data(data, panel_id=None)

Patch the state of the specified panel in the App.

* **Parameters:**
  * **data** – the data to set
  * **panel_id** (*None*) – the optional ID of the panel to clear.
    If not provided, the `ctx.panel_id` will be used

#### reduce_panel_state(reducer, panel_id=None)

Reduce the state of the specified panel in the App.

* **Parameters:**
  * **reducer** – the reducer to apply
  * **panel_id** (*None*) – the optional ID of the panel to clear.
    If not provided, the `ctx.panel_id` will be used

#### apply_panel_state_path(path, panel_id=None)

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

* **Parameters:**
  **path** (*str*) – the path to force update

#### show_panel_output(output, panel_id=None)

Show output in the specified panel in the App.

* **Parameters:**
  * **output** – the output to show
  * **panel_id** (*None*) – the optional ID of the panel to clear.
    If not provided, the `ctx.panel_id` will be used

#### open_panel(name, is_active=True, layout=None, force=False, force_duplicate=False, state=None, data=None)

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

* **Parameters:**
  * **name** – the name of the panel to open
  * **is_active** (*True*) – whether to activate the panel immediately
  * **layout** (*None*) – the layout orientation
    `("horizontal", "vertical")`, if applicable
  * **force** (*False*) – whether 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** (*False*) – whether to force open the panel even if it
    is already open. Only applicable if force is `True`
  * **state** (*None*) – optional initial state to set for the panel
  * **data** (*None*) – optional initial data to set for the panel

#### register_panel(name, label, help_markdown=None, category=Categories.CUSTOM, alpha=False, 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, on_change_active_fields=None, allow_duplicates=False, priority=None, \_builtin=False)

Registers a panel with the given name and lifecycle callbacks.

* **Parameters:**
  * **name** – the name of the panel
  * **help_markdown** (*None*) – help text associated with the panel in
    markdown format
  * **label** – the display name of the panel
  * **icon** (*None*) – the icon to show in the panel’s tab
  * **light_icon** (*None*) – the icon to show in the panel’s tab when the App
    is in light mode
  * **dark_icon** (*None*) – the 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’
  * **alpha** (*False*) – whether the panel is in alpha
  * **beta** (*False*) – whether the panel is in beta
  * **is_new** (*False*) – whether the panel is new
  * **category** ([*Categories.CUSTOM*](fiftyone.operators.md#fiftyone.operators.Categories.CUSTOM)) – the category of the panel
  * **on_load** (*None*) – an operator to invoke when the panel is loaded
  * **on_unload** (*None*) – an operator to invoke when the panel is unloaded
  * **on_change** (*None*) – an operator to invoke when the panel state
    changes
  * **on_change_ctx** (*None*) – an operator to invoke when the panel
    execution context changes
  * **on_change_dataset** (*None*) – an operator to invoke when the current
    dataset changes
  * **on_change_view** (*None*) – an operator to invoke when the current view
    changes
  * **on_change_spaces** (*None*) – an operator to invoke when the current
    spaces layout changes
  * **on_change_current_sample** (*None*) – an operator to invoke when the
    current sample changes
  * **on_change_selected** (*None*) – an operator to invoke when the current
    selected samples changes
  * **on_change_selected_labels** (*None*) – an operator to invoke when the
    current selected labels changes
  * **on_change_extended_selection** (*None*) – an operator to invoke when the
    current extended selection changes
  * **on_change_group_slice** (*None*) – an operator to invoke when the group
    slice changes
  * **on_change_query_performance** (*None*) – an operator to invoke when the
    query performance changes
  * **on_change_active_fields** (*None*) – an operator to invoke when the
    active fields change
  * **allow_duplicates** (*False*) – whether to allow multiple instances of
    the panel to the opened
  * **priority** (*None*) – the priority of the panel, used for sort order
  * **\_builtin** (*False*) – whether the panel is a builtin panel

#### open_all_panels()

Open all available panels in the App.

#### close_panel(name=None, id=None)

Close the given panel in the App.

* **Parameters:**
  * **name** (*None*) – the name of the panel to close
  * **id** (*None*) – the ID of the panel to close

#### close_all_panels()

Close all open panels in the App.

#### split_panel(name, layout)

Split the panel with the given layout in the App.

* **Parameters:**
  * **name** – the name of the panel to split
  * **layout** – the layout orientation `("horizontal", "vertical")`

#### open_dataset(dataset_name)

Open the specified dataset in the App.

* **Parameters:**
  **dataset_name** – the name of the dataset to open

#### clear_view()

Clear the view bar in the App.

#### clear_sidebar_filters()

Clear all filters in the App’s sidebar.

#### clear_all_stages()

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

#### refresh_colors()

Refresh the colors used in the App’s UI.

#### show_selected_samples()

Show the samples that are currently selected in the App.

#### convert_extended_selection_to_selected_samples()

Convert the extended selection to selected samples in the App.

#### set_selected_samples(samples)

Select the specified samples in the App.

Despite its name, `selected_samples` represents whatever sample grid
items are in the current view: samples, patches, clips, or frames.

* **Parameters:**
  **samples** – a list of IDs (strings) or dicts of the form
  `{"id": "...", "type": "default"|"alt"}`, where
  type corresponds to a key in `sample_selection_style`

#### set_sample_selection_style(default='checkmark', alt='checkmark')

Set the sample grid selection style in the App.

* **Parameters:**
  * **default** ( *"checkmark"*) – the default selection icon style. Supported
    values are `"checkmark"`, `"green-checkmark"`,
    `"red-checkmark"`, `"thumbsup"`, `"thumbsdown"`,
    `"pin"`, `"star"`, `"x"`, `"bookmark"`
  * **alt** ( *"checkmark"*) – the alt selection icon style

#### clear_sample_selection_style()

Clear the sample grid selection style in the App, reverting to default.

#### set_label_selection_style(default='dashed', alt='dashed')

Set the label selection style in the App.

* **Parameters:**
  * **default** ( *"dashed"*) – the default label selection style. Supported
    values are `"dashed"`, `"dashed-green"`, `"dashed-red"`
  * **alt** ( *"dashed"*) – the alt label selection style

#### clear_label_selection_style()

Clear the label selection style in the App, reverting to default.

#### set_view(view=None, name=None)

Set the current view in the App.

* **Parameters:**
  * **view** (*None*) – a [`fiftyone.core.view.DatasetView`](fiftyone.core.view.md#fiftyone.core.view.DatasetView) to load
  * **name** (*None*) – the name of a saved view to load

#### show_samples(samples, use_extended_selection=False)

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

* **Parameters:**
  * **samples** – a list of sample IDs to show
  * **use_extended_selection** (*False*) – whether to use the extended
    selection feature

#### console_log(message)

Log a message to the console.

* **Parameters:**
  **message** – the message to log

#### show_output(outputs, results)

Show output in the App’s UI.

* **Parameters:**
  * **outputs** – outputs to show
  * **results** – results to display

#### set_progress(label=None, progress=None, variant=None)

Set the progress indicator in the App’s UI.

* **Parameters:**
  * **label** (*None*) – a label for the progress indicator
  * **progress** (*None*) – a progress value to set
  * **variant** (*None*) – the type of indicator `("linear", "circular")`

#### test_operator(operator, raw_params)

Test the operator with given parameters.

* **Parameters:**
  * **operator** – the operator to test
  * **raw_params** – raw parameters for the operator

#### set_selected_labels(labels)

Set the selected labels in the App.

* **Parameters:**
  **labels** – the labels to select

#### clear_selected_labels()

Clear the selected labels in the App.

#### notify(message, variant='info')

Show a notification in the App.

Variants are “info”, “success”, “warning”, and “error”.

* **Parameters:**
  * **message** – the message to show
  * **variant** ( *"info"*) – the type of notification

#### set_extended_selection(selection=None, scope=None, clear=False, reset=False)

Sets the extended selection in the App.

* **Parameters:**
  * **selection** (*None*) – the selection to set
  * **scope** (*None*) – the scope of the selection
  * **clear** (*None*) – whether to clear the selection
  * **reset** (*None*) – whether to reset the selection

#### set_spaces(spaces=None, name=None)

Sets the current spaces in the App.

* **Parameters:**
  * **spaces** (*None*) – a [`fiftyone.core.odm.workspace.Space`](fiftyone.core.odm.workspace.md#fiftyone.core.odm.workspace.Space) to load
  * **name** (*None*) – the name of the workspace to load

#### set_active_fields(fields=None)

Set the active fields in the App.

* **Parameters:**
  **fields** (*None*) – the possibly-empty list of fields or
  `embedded.fields` to set

#### clear_active_fields()

Clear the active fields in the App.

#### track_event(event, properties=None)

Track an event in the App.

* **Parameters:**
  * **event** – the event to track
  * **properties** (*None*) – the properties to track

#### set_panel_title(id=None, title=None)

Set the title of the specified panel in the App.

* **Parameters:**
  * **id** (*None*) – the ID of the panel to set the title
  * **title** (*None*) – the title to set

#### set_group_slice(slice)

Set the active group slice in the App.

* **Parameters:**
  **slice** – the group slice to activate

#### open_sample(id=None, group_id=None)

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

* **Parameters:**
  * **id** (*None*) – a sample ID to open in the modal
  * **group_id** (*None*) – a group ID to open in the modal

#### close_sample()

Closes the App’s sample modal.

#### show_sidebar()

Show the App’s sidebar.

#### hide_sidebar()

Hide the App’s sidebar.

#### toggle_sidebar()

Toggle the visibility of the App’s sidebar.

#### browser_download(url, filename=None)

Download a file from a URL using the browser’s download functionality.

* **Parameters:**
  * **url** – the URL of the file to download
  * **filename** – optional filename for the download (will use URL filename if not provided)
