From 7ebbd97ea0b91ac4d8f2889ffa48bd2757188a69 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 10 Aug 2023 16:09:51 -0500 Subject: [PATCH] Update deephaven-plugin to latest, fixed API breaking changes (#47) --- setup.cfg | 2 +- src/deephaven/plot/express/__init__.py | 14 +++++++------- .../plot/express/data_mapping/DataMapping.py | 4 ++-- .../express/deephaven_figure/DeephavenFigure.py | 2 +- test/deephaven/plot/express/BaseTest.py | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/setup.cfg b/setup.cfg index e0a8164..a5a9c92 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,7 +25,7 @@ package_dir= =src packages=find_namespace: install_requires = - deephaven-plugin + deephaven-plugin>=0.5.0 plotly include_package_data = True diff --git a/src/deephaven/plot/express/__init__.py b/src/deephaven/plot/express/__init__.py index 638e925..0a49ecd 100644 --- a/src/deephaven/plot/express/__init__.py +++ b/src/deephaven/plot/express/__init__.py @@ -1,5 +1,5 @@ -from deephaven.plugin import Registration -from deephaven.plugin.object import Exporter, ObjectType +from deephaven.plugin import Registration, Callback +from deephaven.plugin.object_type import Exporter, FetchOnlyObjectType from .deephaven_figure import DeephavenFigure, export_figure @@ -39,7 +39,7 @@ NAME = "deephaven.plot.express.DeephavenFigure" -class DeephavenFigureType(ObjectType): +class DeephavenFigureType(FetchOnlyObjectType): """ DeephavenFigureType for plugin registration @@ -56,17 +56,17 @@ def name(self) -> str: """ return NAME - def is_type(self, object: any) -> bool: + def is_type(self, obj: any) -> bool: """ Check if an object is a DeephavenFigure Args: - object: any: The object to check + obj: any: The object to check Returns: bool: True if the object is of the correct type, False otherwise """ - return isinstance(object, DeephavenFigure) + return isinstance(obj, DeephavenFigure) def to_bytes(self, exporter: Exporter, figure: DeephavenFigure) -> bytes: """ @@ -89,7 +89,7 @@ class ChartRegistration(Registration): """ @classmethod - def register_into(cls, callback: Registration.Callback) -> None: + def register_into(cls, callback: Callback) -> None: """ Register the DeephavenFigureType diff --git a/src/deephaven/plot/express/data_mapping/DataMapping.py b/src/deephaven/plot/express/data_mapping/DataMapping.py index 0f2b96f..68d4c2c 100644 --- a/src/deephaven/plot/express/data_mapping/DataMapping.py +++ b/src/deephaven/plot/express/data_mapping/DataMapping.py @@ -4,7 +4,7 @@ from typing import Any from deephaven.table import Table -from deephaven.plugin.object import Exporter +from deephaven.plugin.object_type import Exporter from .json_conversion import json_link_mapping @@ -45,7 +45,7 @@ def get_links( """ return json_link_mapping( self._data_mapping, - exporter.reference(self._table)._index, + exporter.reference(self._table).index, self._start_index) def copy( diff --git a/src/deephaven/plot/express/deephaven_figure/DeephavenFigure.py b/src/deephaven/plot/express/deephaven_figure/DeephavenFigure.py index d8325e8..bcf0529 100644 --- a/src/deephaven/plot/express/deephaven_figure/DeephavenFigure.py +++ b/src/deephaven/plot/express/deephaven_figure/DeephavenFigure.py @@ -6,7 +6,7 @@ from plotly.graph_objects import Figure -from deephaven.plugin.object import Exporter +from deephaven.plugin.object_type import Exporter from ..data_mapping import DataMapping diff --git a/test/deephaven/plot/express/BaseTest.py b/test/deephaven/plot/express/BaseTest.py index 6df888e..94e8fc0 100644 --- a/test/deephaven/plot/express/BaseTest.py +++ b/test/deephaven/plot/express/BaseTest.py @@ -14,8 +14,8 @@ def setUpClass(cls): cls.setup_exporter_mock() @classmethod - @patch('deephaven.plugin.object.Exporter') - @patch('deephaven.plugin.object.Reference') + @patch('deephaven.plugin.object_type.Exporter') + @patch('deephaven.plugin.object_type.Reference') def setup_exporter_mock(cls, MockExporter, MockReference): cls.exporter = MockExporter() cls.reference = MockReference()