Skip to content

Commit

Permalink
Merge pull request #378 from astrofrog/glue-qt-imports
Browse files Browse the repository at this point in the history
Updated imports to glue_qt
  • Loading branch information
astrofrog authored Aug 18, 2023
2 parents 9b657ec + 0e71a43 commit de274b0
Show file tree
Hide file tree
Showing 23 changed files with 37 additions and 33 deletions.
7 changes: 2 additions & 5 deletions glue_vispy_viewers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from pkg_resources import get_distribution, DistributionNotFound
import importlib.metadata

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
__version__ = 'undefined'
__version__ = importlib.metadata.version('glue-vispy-viewers')

try:
import OpenGL # noqa
Expand Down
2 changes: 1 addition & 1 deletion glue_vispy_viewers/common/tests/test_vispy_toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
from mock import patch

from glue.app.qt import GlueApplication
from glue_qt.app import GlueApplication
from glue.core import Data

from ...scatter.scatter_viewer import VispyScatterViewer
Expand Down
2 changes: 1 addition & 1 deletion glue_vispy_viewers/common/tests/test_vispy_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from mock import patch

from glue.core import Data, DataCollection
from glue.app.qt import GlueApplication
from glue_qt.app import GlueApplication

from glue.core.tests.util import simple_session

Expand Down
2 changes: 1 addition & 1 deletion glue_vispy_viewers/common/toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""


from glue.viewers.common.qt.toolbar import BasicToolbar
from glue_qt.viewers.common.toolbar import BasicToolbar

from .selection_tools import VispyMouseMode

Expand Down
2 changes: 1 addition & 1 deletion glue_vispy_viewers/common/viewer_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from echo.qt import autoconnect_callbacks_to_qt

from glue.utils.qt import load_ui
from glue_qt.utils import load_ui

__all__ = ["VispyOptionsWidget"]

Expand Down
2 changes: 1 addition & 1 deletion glue_vispy_viewers/common/vispy_data_viewer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from glue.viewers.common.qt.data_viewer_with_state import DataViewerWithState
from glue_qt.viewers.common.data_viewer_with_state import DataViewerWithState
from echo import delay_callback

from qtpy import QtWidgets
Expand Down
6 changes: 5 additions & 1 deletion glue_vispy_viewers/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
if sys.platform.startswith('win'):
import vispy.gloo.gl # noqa

from glue.utils.qt import get_qapp # noqa
from glue_qt.utils import get_qapp # noqa

try:
import objgraph
Expand Down Expand Up @@ -56,6 +56,10 @@ def pytest_runtest_teardown(item, nextitem):
# not properly garbage collected, which in turn meant they still reacted
# in some cases to events.

# Temporarily skip this test for test_add_viewer while trying to determine cause
if item.name == 'test_add_viewer':
return

if OBJGRAPH_INSTALLED and hasattr(item, '_viewer_count'):

app.processEvents()
Expand Down
4 changes: 2 additions & 2 deletions glue_vispy_viewers/isosurface/layer_style_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from qtpy import QtWidgets

from glue.utils.qt import load_ui
from glue_qt.utils import load_ui
from echo.qt import autoconnect_callbacks_to_qt


Expand All @@ -27,7 +27,7 @@ def __init__(self, layer_artist):

# if __name__ == "__main__":
#
# from glue.utils.qt import get_qapp
# from glue_qt.utils import get_qapp
# from echo import CallbackProperty
#
# app = get_qapp()
Expand Down
2 changes: 1 addition & 1 deletion glue_vispy_viewers/isosurface/layer_style_widget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<customwidget>
<class>QColormapCombo</class>
<extends>QComboBox</extends>
<header>glue.utils.qt.colors</header>
<header>glue_qt.utils.colors</header>
</customwidget>
</customwidgets>
<resources/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np

from glue.core import DataCollection, Data
from glue.app.qt.application import GlueApplication
from glue_qt.app.application import GlueApplication
from glue.core.component import Component

from ..isosurface_viewer import VispyIsosurfaceViewer
Expand Down
2 changes: 1 addition & 1 deletion glue_vispy_viewers/scatter/layer_style_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from qtpy import QtWidgets

from glue.utils.qt import load_ui
from glue_qt.utils import load_ui
from echo.qt import autoconnect_callbacks_to_qt

from glue_vispy_viewers.utils import fix_tab_widget_fontsize
Expand Down
4 changes: 2 additions & 2 deletions glue_vispy_viewers/scatter/layer_style_widget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -814,12 +814,12 @@
<customwidget>
<class>QColorBox</class>
<extends>QLabel</extends>
<header>glue.utils.qt.colors</header>
<header>glue_qt.utils.colors</header>
</customwidget>
<customwidget>
<class>QColormapCombo</class>
<extends>QComboBox</extends>
<header>glue.utils.qt.colors</header>
<header>glue_qt.utils.colors</header>
</customwidget>
</customwidgets>
<resources/>
Expand Down
2 changes: 1 addition & 1 deletion glue_vispy_viewers/scatter/tests/test_scatter_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys

from glue.core import DataCollection, Data
from glue.app.qt.application import GlueApplication
from glue_qt.app.application import GlueApplication
from glue.core.component import Component

from matplotlib import cm
Expand Down
2 changes: 1 addition & 1 deletion glue_vispy_viewers/tests/data/multiple_volumes_v1.glu
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@
"label": "World 2"
},
"__main__": {
"_type": "glue.app.qt.application.GlueApplication",
"_type": "glue_qt.app.application.GlueApplication",
"data": "DataCollection",
"plugins": [
"glue.viewers.profile.qt",
Expand Down
2 changes: 1 addition & 1 deletion glue_vispy_viewers/tests/data/multiple_volumes_v2.glu
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"label": "World 2"
},
"__main__": {
"_type": "glue.app.qt.application.GlueApplication",
"_type": "glue_qt.app.application.GlueApplication",
"data": "DataCollection",
"plugins": [
"glue.plugins.coordinate_helpers",
Expand Down
2 changes: 1 addition & 1 deletion glue_vispy_viewers/tests/data/scatter_volume_selection.glu
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@
"label": "World 2"
},
"__main__": {
"_type": "glue.app.qt.application.GlueApplication",
"_type": "glue_qt.app.application.GlueApplication",
"data": "DataCollection",
"plugins": [
"glue.io.formats.fits",
Expand Down
4 changes: 2 additions & 2 deletions glue_vispy_viewers/tests/data/scatter_volume_v0.glu
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
"VispyVolumeViewer"
]
],
"_type": "glue.app.qt.application.GlueApplication",
"_type": "glue_qt.app.application.GlueApplication",
"data": "DataCollection"
},
"CoordinateComponent_2": {
Expand Down Expand Up @@ -540,4 +540,4 @@
"_type": "matplotlib.colors.LinearSegmentedColormap",
"cmap": "hot"
}
}
}
2 changes: 1 addition & 1 deletion glue_vispy_viewers/tests/data/scatter_volume_v1.glu
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@
"label": "World 2"
},
"__main__": {
"_type": "glue.app.qt.application.GlueApplication",
"_type": "glue_qt.app.application.GlueApplication",
"data": "DataCollection",
"plugins": [
"glue.core.data_exporters",
Expand Down
4 changes: 2 additions & 2 deletions glue_vispy_viewers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ def as_matrix_transform(transform):

try:

from glue.utils.qt import fix_tab_widget_fontsize # noqa
from glue_qt.utils import fix_tab_widget_fontsize # noqa

except ImportError:

import platform
from glue.utils.qt import get_qapp
from glue_qt.utils import get_qapp

def fix_tab_widget_fontsize(tab_widget):
"""
Expand Down
2 changes: 1 addition & 1 deletion glue_vispy_viewers/volume/layer_style_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from qtpy import QtWidgets

from glue.utils.qt import load_ui
from glue_qt.utils import load_ui
from echo.qt import autoconnect_callbacks_to_qt


Expand Down
2 changes: 1 addition & 1 deletion glue_vispy_viewers/volume/layer_style_widget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<customwidget>
<class>QColorBox</class>
<extends>QLabel</extends>
<header>glue.utils.qt.colors</header>
<header>glue_qt.utils.colors</header>
</customwidget>
</customwidgets>
<resources/>
Expand Down
2 changes: 1 addition & 1 deletion glue_vispy_viewers/volume/tests/test_volume_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np

from glue.core import DataCollection, Data
from glue.app.qt.application import GlueApplication
from glue_qt.app.application import GlueApplication
from glue.core.component import Component
from glue.core.link_helpers import LinkSame
from glue.core.fixed_resolution_buffer import PIXEL_CACHE, ARRAY_CACHE
Expand Down
9 changes: 6 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ setup_requires = setuptools_scm
install_requires =
numpy
pyopengl
glue-core>=1.0
glue-core>=1.13.1
glue-qt>=0.1.0
echo>=0.6
qtpy
scipy
astropy>=4.0
pillow
matplotlib
vispy>=0.9.1
importlib_metadata>=3.6; python_version<'3.10'
python_requires = >=3.8

[options.entry_points]
Expand All @@ -38,6 +39,8 @@ test =
mock
qt =
PyQt5>=5.9
all =
imageio

[options.package_data]
glue_vispy_viewers.common = *.ui, *.png
Expand Down

0 comments on commit de274b0

Please sign in to comment.