From 511c3be62224b110fdebdb376a2d0e6e35f56238 Mon Sep 17 00:00:00 2001 From: Ritchie Martori Date: Fri, 2 Aug 2024 09:18:06 -0700 Subject: [PATCH 1/2] rename PanelOperatorConfig to PanelConfig --- fiftyone/operators/panel.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fiftyone/operators/panel.py b/fiftyone/operators/panel.py index acb5b4b75c..96da9a5290 100644 --- a/fiftyone/operators/panel.py +++ b/fiftyone/operators/panel.py @@ -12,7 +12,7 @@ import pydash -class PanelOperatorConfig(OperatorConfig): +class PanelConfig(OperatorConfig): """A configuration for a panel operator.""" def __init__( @@ -49,6 +49,10 @@ def to_json(self): } +# Alias for backwards compatibility +PanelOperatorConfig = PanelConfig + + class Panel(Operator): """A panel operator.""" From 0212781dbfe7885131bdd7d58948d066d79e4a2e Mon Sep 17 00:00:00 2001 From: brimoor Date: Mon, 5 Aug 2024 08:49:48 -0400 Subject: [PATCH 2/2] rename PanelOperatorConfig to PanelConfig --- e2e-pw/src/shared/assets/plugins/e2e/__init__.py | 2 +- fiftyone/operators/__init__.py | 2 +- tests/unittests/panels/panel_tests.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/e2e-pw/src/shared/assets/plugins/e2e/__init__.py b/e2e-pw/src/shared/assets/plugins/e2e/__init__.py index a143a0b930..e8222bfa3d 100644 --- a/e2e-pw/src/shared/assets/plugins/e2e/__init__.py +++ b/e2e-pw/src/shared/assets/plugins/e2e/__init__.py @@ -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, diff --git a/fiftyone/operators/__init__.py b/fiftyone/operators/__init__.py index c1c2f13ae6..ecaf44aac8 100644 --- a/fiftyone/operators/__init__.py +++ b/fiftyone/operators/__init__.py @@ -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("_")] diff --git a/tests/unittests/panels/panel_tests.py b/tests/unittests/panels/panel_tests.py index deaae1e633..a55846b95c 100644 --- a/tests/unittests/panels/panel_tests.py +++ b/tests/unittests/panels/panel_tests.py @@ -2,7 +2,7 @@ from unittest.mock import MagicMock from fiftyone.operators.panel import ( Panel, - PanelOperatorConfig, + PanelConfig, PanelRef, PanelRefState, PanelRefData, @@ -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()