Skip to content

Commit

Permalink
Update deephaven-plugin to latest, fixed API breaking changes (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
niloc132 authored Aug 10, 2023
1 parent ef2445f commit 7ebbd97
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ package_dir=
=src
packages=find_namespace:
install_requires =
deephaven-plugin
deephaven-plugin>=0.5.0
plotly
include_package_data = True

Expand Down
14 changes: 7 additions & 7 deletions src/deephaven/plot/express/__init__.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -39,7 +39,7 @@
NAME = "deephaven.plot.express.DeephavenFigure"


class DeephavenFigureType(ObjectType):
class DeephavenFigureType(FetchOnlyObjectType):
"""
DeephavenFigureType for plugin registration
Expand All @@ -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:
"""
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/deephaven/plot/express/data_mapping/DataMapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/deephaven/plot/express/BaseTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 7ebbd97

Please sign in to comment.