From f943273f242c1c1c2ab1bef426d29f91b792cec8 Mon Sep 17 00:00:00 2001 From: Jonathan Foster Date: Wed, 29 Nov 2023 10:50:00 -0500 Subject: [PATCH 1/3] Add all viewers to the registry --- glue_jupyter/bqplot/histogram/__init__.py | 4 ++++ glue_jupyter/bqplot/image/__init__.py | 4 ++++ glue_jupyter/bqplot/profile/__init__.py | 4 ++++ glue_jupyter/bqplot/scatter/__init__.py | 4 ++++ glue_jupyter/ipyvolume/__init__.py | 4 ++++ glue_jupyter/ipyvolume/scatter/__init__.py | 4 ++++ glue_jupyter/ipyvolume/scatter/viewer.py | 3 +++ glue_jupyter/table/__init__.py | 4 ++++ setup.cfg | 10 ++++++++++ 9 files changed, 41 insertions(+) diff --git a/glue_jupyter/bqplot/histogram/__init__.py b/glue_jupyter/bqplot/histogram/__init__.py index f2efc8a1..e7fe8837 100644 --- a/glue_jupyter/bqplot/histogram/__init__.py +++ b/glue_jupyter/bqplot/histogram/__init__.py @@ -1,2 +1,6 @@ from .layer_artist import * # noqa from .viewer import * # noqa + + +def setup(): + from viewer import BqplotHistogramView # noqa diff --git a/glue_jupyter/bqplot/image/__init__.py b/glue_jupyter/bqplot/image/__init__.py index f2efc8a1..6b08bddc 100644 --- a/glue_jupyter/bqplot/image/__init__.py +++ b/glue_jupyter/bqplot/image/__init__.py @@ -1,2 +1,6 @@ from .layer_artist import * # noqa from .viewer import * # noqa + + +def setup(): + from viewer import BqplotImageView # noqa diff --git a/glue_jupyter/bqplot/profile/__init__.py b/glue_jupyter/bqplot/profile/__init__.py index f2efc8a1..ee6eb472 100644 --- a/glue_jupyter/bqplot/profile/__init__.py +++ b/glue_jupyter/bqplot/profile/__init__.py @@ -1,2 +1,6 @@ from .layer_artist import * # noqa from .viewer import * # noqa + + +def setup(): + from viewer import BqplotProfileView # noqa diff --git a/glue_jupyter/bqplot/scatter/__init__.py b/glue_jupyter/bqplot/scatter/__init__.py index f2efc8a1..fb952e01 100644 --- a/glue_jupyter/bqplot/scatter/__init__.py +++ b/glue_jupyter/bqplot/scatter/__init__.py @@ -1,2 +1,6 @@ from .layer_artist import * # noqa from .viewer import * # noqa + + +def setup(): + from viewer import BqplotScatterView # noqa diff --git a/glue_jupyter/ipyvolume/__init__.py b/glue_jupyter/ipyvolume/__init__.py index db578fb0..7a711d06 100644 --- a/glue_jupyter/ipyvolume/__init__.py +++ b/glue_jupyter/ipyvolume/__init__.py @@ -1,2 +1,6 @@ from .volume.viewer import IpyvolumeVolumeView # noqa from .scatter.viewer import IpyvolumeScatterView # noqa + + +def setup(): + from viewer import IpyvolumeVolumeView # noqa diff --git a/glue_jupyter/ipyvolume/scatter/__init__.py b/glue_jupyter/ipyvolume/scatter/__init__.py index 39dd5964..11304dab 100644 --- a/glue_jupyter/ipyvolume/scatter/__init__.py +++ b/glue_jupyter/ipyvolume/scatter/__init__.py @@ -1,3 +1,7 @@ from .layer_artist import * # noqa from .layer_style_widget import * # noqa from .viewer import * # noqa + + +def setup(): + from viewer import IpyvolumeScatterView # noqa diff --git a/glue_jupyter/ipyvolume/scatter/viewer.py b/glue_jupyter/ipyvolume/scatter/viewer.py index e82f3e72..81a61563 100644 --- a/glue_jupyter/ipyvolume/scatter/viewer.py +++ b/glue_jupyter/ipyvolume/scatter/viewer.py @@ -1,4 +1,6 @@ from glue_jupyter.common.state3d import Scatter3DViewerState +from glue_jupyter.registries import viewer_registry + from .layer_artist import IpyvolumeScatterLayerArtist from .layer_style_widget import Scatter3DLayerStateWidget from ..common.viewer_options_widget import Viewer3DStateWidget @@ -7,6 +9,7 @@ __all__ = ['IpyvolumeScatterView'] +@viewer_registry("scatter3d") class IpyvolumeScatterView(IpyvolumeBaseView): allow_duplicate_data = False diff --git a/glue_jupyter/table/__init__.py b/glue_jupyter/table/__init__.py index 53136ac4..7e675fc0 100644 --- a/glue_jupyter/table/__init__.py +++ b/glue_jupyter/table/__init__.py @@ -1 +1,5 @@ from .viewer import TableViewer # noqa + + +def setup(): + from viewer import TableViewer # noqa diff --git a/setup.cfg b/setup.cfg index 321657b1..0e3a7a72 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,6 +28,16 @@ install_requires = bqplot-gl scikit-image +[options.entry_points] +glue.plugins = + histogram = glue_jupyter.bqplot.histogram:setup + image = glue_jupyter.bqplot.image:setup + profile = glue_jupyter.bqplot.profile:setup + scatter = glue_jupyter.bqplot.scatter:setup + table = glue_jupyter.table:setup + scatter3d = glue_jupyter.ipyvolume.scatter:setup + volume = glue_jupyter.ipyvolume.volume:setup + [options.extras_require] test = pytest From 8f3126b36c14495d5dcc34baacdf9359941ea38c Mon Sep 17 00:00:00 2001 From: Jonathan Foster Date: Wed, 29 Nov 2023 20:05:07 -0500 Subject: [PATCH 2/3] Remove extra import from setup functions --- glue_jupyter/bqplot/histogram/__init__.py | 2 +- glue_jupyter/bqplot/image/__init__.py | 2 +- glue_jupyter/bqplot/profile/__init__.py | 2 +- glue_jupyter/bqplot/scatter/__init__.py | 2 +- glue_jupyter/ipyvolume/__init__.py | 2 +- glue_jupyter/ipyvolume/scatter/__init__.py | 2 +- glue_jupyter/table/__init__.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/glue_jupyter/bqplot/histogram/__init__.py b/glue_jupyter/bqplot/histogram/__init__.py index e7fe8837..21d133b4 100644 --- a/glue_jupyter/bqplot/histogram/__init__.py +++ b/glue_jupyter/bqplot/histogram/__init__.py @@ -3,4 +3,4 @@ def setup(): - from viewer import BqplotHistogramView # noqa + pass \ No newline at end of file diff --git a/glue_jupyter/bqplot/image/__init__.py b/glue_jupyter/bqplot/image/__init__.py index 6b08bddc..21d133b4 100644 --- a/glue_jupyter/bqplot/image/__init__.py +++ b/glue_jupyter/bqplot/image/__init__.py @@ -3,4 +3,4 @@ def setup(): - from viewer import BqplotImageView # noqa + pass \ No newline at end of file diff --git a/glue_jupyter/bqplot/profile/__init__.py b/glue_jupyter/bqplot/profile/__init__.py index ee6eb472..21d133b4 100644 --- a/glue_jupyter/bqplot/profile/__init__.py +++ b/glue_jupyter/bqplot/profile/__init__.py @@ -3,4 +3,4 @@ def setup(): - from viewer import BqplotProfileView # noqa + pass \ No newline at end of file diff --git a/glue_jupyter/bqplot/scatter/__init__.py b/glue_jupyter/bqplot/scatter/__init__.py index fb952e01..21d133b4 100644 --- a/glue_jupyter/bqplot/scatter/__init__.py +++ b/glue_jupyter/bqplot/scatter/__init__.py @@ -3,4 +3,4 @@ def setup(): - from viewer import BqplotScatterView # noqa + pass \ No newline at end of file diff --git a/glue_jupyter/ipyvolume/__init__.py b/glue_jupyter/ipyvolume/__init__.py index 7a711d06..56da19fb 100644 --- a/glue_jupyter/ipyvolume/__init__.py +++ b/glue_jupyter/ipyvolume/__init__.py @@ -3,4 +3,4 @@ def setup(): - from viewer import IpyvolumeVolumeView # noqa + pass \ No newline at end of file diff --git a/glue_jupyter/ipyvolume/scatter/__init__.py b/glue_jupyter/ipyvolume/scatter/__init__.py index 11304dab..5782f5ea 100644 --- a/glue_jupyter/ipyvolume/scatter/__init__.py +++ b/glue_jupyter/ipyvolume/scatter/__init__.py @@ -4,4 +4,4 @@ def setup(): - from viewer import IpyvolumeScatterView # noqa + pass \ No newline at end of file diff --git a/glue_jupyter/table/__init__.py b/glue_jupyter/table/__init__.py index 7e675fc0..94e0e466 100644 --- a/glue_jupyter/table/__init__.py +++ b/glue_jupyter/table/__init__.py @@ -2,4 +2,4 @@ def setup(): - from viewer import TableViewer # noqa + pass \ No newline at end of file From b01d4ac3e3f5cfb50515f7b9f668ce61193c3714 Mon Sep 17 00:00:00 2001 From: Jonathan Foster Date: Wed, 29 Nov 2023 21:16:12 -0500 Subject: [PATCH 3/3] Fix formatting --- glue_jupyter/bqplot/histogram/__init__.py | 2 +- glue_jupyter/bqplot/image/__init__.py | 2 +- glue_jupyter/bqplot/profile/__init__.py | 2 +- glue_jupyter/bqplot/scatter/__init__.py | 2 +- glue_jupyter/ipyvolume/__init__.py | 2 +- glue_jupyter/ipyvolume/scatter/__init__.py | 2 +- glue_jupyter/table/__init__.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/glue_jupyter/bqplot/histogram/__init__.py b/glue_jupyter/bqplot/histogram/__init__.py index 21d133b4..46c5195e 100644 --- a/glue_jupyter/bqplot/histogram/__init__.py +++ b/glue_jupyter/bqplot/histogram/__init__.py @@ -3,4 +3,4 @@ def setup(): - pass \ No newline at end of file + pass diff --git a/glue_jupyter/bqplot/image/__init__.py b/glue_jupyter/bqplot/image/__init__.py index 21d133b4..46c5195e 100644 --- a/glue_jupyter/bqplot/image/__init__.py +++ b/glue_jupyter/bqplot/image/__init__.py @@ -3,4 +3,4 @@ def setup(): - pass \ No newline at end of file + pass diff --git a/glue_jupyter/bqplot/profile/__init__.py b/glue_jupyter/bqplot/profile/__init__.py index 21d133b4..46c5195e 100644 --- a/glue_jupyter/bqplot/profile/__init__.py +++ b/glue_jupyter/bqplot/profile/__init__.py @@ -3,4 +3,4 @@ def setup(): - pass \ No newline at end of file + pass diff --git a/glue_jupyter/bqplot/scatter/__init__.py b/glue_jupyter/bqplot/scatter/__init__.py index 21d133b4..46c5195e 100644 --- a/glue_jupyter/bqplot/scatter/__init__.py +++ b/glue_jupyter/bqplot/scatter/__init__.py @@ -3,4 +3,4 @@ def setup(): - pass \ No newline at end of file + pass diff --git a/glue_jupyter/ipyvolume/__init__.py b/glue_jupyter/ipyvolume/__init__.py index 56da19fb..ea4ef9a7 100644 --- a/glue_jupyter/ipyvolume/__init__.py +++ b/glue_jupyter/ipyvolume/__init__.py @@ -3,4 +3,4 @@ def setup(): - pass \ No newline at end of file + pass diff --git a/glue_jupyter/ipyvolume/scatter/__init__.py b/glue_jupyter/ipyvolume/scatter/__init__.py index 5782f5ea..c9df7125 100644 --- a/glue_jupyter/ipyvolume/scatter/__init__.py +++ b/glue_jupyter/ipyvolume/scatter/__init__.py @@ -4,4 +4,4 @@ def setup(): - pass \ No newline at end of file + pass diff --git a/glue_jupyter/table/__init__.py b/glue_jupyter/table/__init__.py index 94e0e466..a700dc6a 100644 --- a/glue_jupyter/table/__init__.py +++ b/glue_jupyter/table/__init__.py @@ -2,4 +2,4 @@ def setup(): - pass \ No newline at end of file + pass