Skip to content

Commit

Permalink
Merge pull request #4612 from voxel51/panel-config
Browse files Browse the repository at this point in the history
rename PanelOperatorConfig to PanelConfig
  • Loading branch information
brimoor authored Aug 5, 2024
2 parents 4b3c94a + 0212781 commit 00337b6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion e2e-pw/src/shared/assets/plugins/e2e/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async def execute(self, ctx):
class E2ECounterPythonPanel(foo.Panel):
@property
def config(self):
return foo.PanelOperatorConfig(
return foo.PanelConfig(
name="e2e_counter_python_panel",
label="E2E: Counter Python Panel",
allow_multiple=True,
Expand Down
2 changes: 1 addition & 1 deletion fiftyone/operators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
ExecutionOptions,
)
from .utils import ProgressHandler
from .panel import PanelOperatorConfig, Panel
from .panel import Panel, PanelConfig, PanelOperatorConfig

# This enables Sphinx refs to directly use paths imported here
__all__ = [k for k, v in globals().items() if not k.startswith("_")]
6 changes: 5 additions & 1 deletion fiftyone/operators/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import pydash


class PanelOperatorConfig(OperatorConfig):
class PanelConfig(OperatorConfig):
"""A configuration for a panel operator."""

def __init__(
Expand Down Expand Up @@ -49,6 +49,10 @@ def to_json(self):
}


# Alias for backwards compatibility
PanelOperatorConfig = PanelConfig


class Panel(Operator):
"""A panel operator."""

Expand Down
4 changes: 2 additions & 2 deletions tests/unittests/panels/panel_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from unittest.mock import MagicMock
from fiftyone.operators.panel import (
Panel,
PanelOperatorConfig,
PanelConfig,
PanelRef,
PanelRefState,
PanelRefData,
Expand All @@ -19,7 +19,7 @@ def simulate_event(panel, mock_ctx, event_name):
class TestPanel(Panel):
@property
def config(self):
return PanelOperatorConfig(name="test_panel", label="Test Panel")
return PanelConfig(name="test_panel", label="Test Panel")

def render(self, ctx):
panel = Object()
Expand Down

0 comments on commit 00337b6

Please sign in to comment.