Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial clean-up to produce glue-qt #1

Merged
merged 26 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e405350
Remove files unrelated to Qt
astrofrog Aug 15, 2023
91dbf27
Renamed glue to glue_qt
astrofrog Aug 10, 2023
d20a41d
Updated imports from glue to glue_qt wherever relevant
astrofrog Aug 10, 2023
ae6709b
Remove content from __init__.py files
astrofrog Aug 10, 2023
4b6a67b
Update paths in ui files, remove more code not dependent on qt
astrofrog Aug 10, 2023
3aa449c
Fix codestyle
astrofrog Aug 11, 2023
cc23fa4
Fixed entry points
astrofrog Aug 11, 2023
4928b67
Clean up dependencies
astrofrog Aug 11, 2023
36e53bb
Fix imports and remaining tests
astrofrog Aug 11, 2023
3b783ca
Remove unused code
astrofrog Aug 11, 2023
d65c3fe
Moved files out of qt/ sub-directories
astrofrog Aug 11, 2023
02ede08
Updated imports
astrofrog Aug 11, 2023
00bc1f4
Move .ui files
astrofrog Aug 11, 2023
806d43a
Fixed paths inside .ui files
astrofrog Aug 11, 2023
ca5df70
Moved .glu files out of qt/ folders
astrofrog Aug 11, 2023
0a9afa2
Update setup.cfg
astrofrog Aug 11, 2023
ce43cc8
Fixed tox config
astrofrog Aug 11, 2023
717dc41
Moved baseline plot out of qt/
astrofrog Aug 11, 2023
fef4722
Fixed data paths in setup.cfg
astrofrog Aug 11, 2023
8458e11
Fixed warnings in docs build
astrofrog Aug 11, 2023
64391bc
Updated setup.cfg data config
astrofrog Aug 11, 2023
c5c735b
Fixed documentation warnings
astrofrog Aug 11, 2023
38bec20
Fix more imports
astrofrog Aug 11, 2023
72e633e
Fixed more imports
astrofrog Aug 15, 2023
330980b
Moved remaining test and data
astrofrog Aug 15, 2023
f23b24a
Fixed import
astrofrog Aug 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,6 @@ jobs:
# Setup PyQt5 deps and headless X server as per pyvista/setup-headless-display-action@v1
libraries: '^libxcb.*-dev libxkbcommon-x11-dev libgl1-mesa-glx libopenblas-dev libhdf5-dev xvfb'
test_extras: 'test,qt'
test_command: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & sleep 3; DISPLAY=:99.0 pytest --pyargs glue
test_command: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & sleep 3; DISPLAY=:99.0 pytest --pyargs glue_qt
secrets:
pypi_token: ${{ secrets.pypi_token }}
16 changes: 6 additions & 10 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
'echo': ('https://echo.readthedocs.io/en/latest/', None),
'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None),
'PyQt5': ('https://www.riverbankcomputing.com/static/Docs/PyQt5/', None),
'glue': ('http://docs.glueviz.org/en/latest/', None),
}

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -131,15 +132,10 @@
todo_include_todos = True
autoclass_content = 'both'

nitpick_ignore = [('py:obj', 'glue.viewers.common.qt.toolbar.BasicToolbar.insertAction'),
('py:obj', 'glue.viewers.common.qt.toolbar.BasicToolbar.setTabOrder'),
('py:class', 'glue.viewers.histogram.layer_artist.HistogramLayerBase'),
('py:class', 'glue.viewers.scatter.layer_artist.ScatterLayerBase'),
('py:class', 'glue.viewers.image.layer_artist.ImageLayerBase'),
('py:class', 'glue.viewers.image.layer_artist.RGBImageLayerBase'),
('py:class', 'glue.viewers.image.state.BaseImageLayerState'),
('py:class', 'glue.viewers.common.qt.toolbar.BasicToolbar'),
('py:class', 'glue.viewers.common.qt.base_widget.BaseQtViewerWidget'),
nitpick_ignore = [('py:obj', 'glue_qt.viewers.common.toolbar.BasicToolbar.insertAction'),
('py:obj', 'glue_qt.viewers.common.toolbar.BasicToolbar.setTabOrder'),
('py:class', 'glue_qt.viewers.common.toolbar.BasicToolbar'),
('py:class', 'glue_qt.viewers.common.base_widget.BaseQtViewerWidget'),
('py:class', 'sip.voidptr'),
('py:class', 'PyQt5.sip.voidptr'),
('py:class', 'PYQT_SLOT')]
Expand All @@ -155,7 +151,7 @@

# coax Sphinx into treating descriptors as attributes
# see https://bitbucket.org/birkenfeld/sphinx/issue/1254/#comment-7587063
from glue.utils.qt.widget_properties import WidgetProperty
from glue_qt.utils.widget_properties import WidgetProperty
WidgetProperty.__get__ = lambda self, *args, **kwargs: self

viewcode_follow_imported_members = False
Expand Down
12 changes: 6 additions & 6 deletions doc/customizing_guide/customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ object, and the data collection object), and decorate it with the
``@menubar_plugin`` decorator, giving it the label that will appear in the
**Tools** menubar::

from glue.config import menubar_plugin
from glue_qt.config import menubar_plugin

@menubar_plugin("Do something")
def my_plugin(session, data_collection):
Expand Down Expand Up @@ -282,7 +282,7 @@ groups or subsets in the data collection. To do this, you should define a
function to be called when the menu item is selected, and use the
``@layer_action`` decorator::

from glue.config import layer_action
from glue_qt.config import layer_action

@layer_action('Do something')
def callback(selected_layers, data_collection):
Expand Down Expand Up @@ -321,7 +321,7 @@ that will get called when the preferences dialog is closed. This method should
then set any settings appropriately in the application state. The following is
an example of a custom preference pane::

from glue.config import settings, preference_panes
from glue_qt.config import settings, preference_panes
from qtpy import QtWidgets


Expand Down Expand Up @@ -617,7 +617,7 @@ component/functionality until it is actually needed. To do this:
Imagine that you have created a data viewer ``MyQtViewer``. You could
directly register it using::

from glue.config import qt_client
from glue_qt.config import qt_client
qt_client.add(MyQtViewer)

but if you want to defer the loading of the ``MyQtViewer`` class, you can
Expand All @@ -629,12 +629,12 @@ place the definition of ``MyQtViewer`` in a file called e.g.
...

def setup():
from glue.config import qt_client
from glue_qt.config import qt_client
qt_client.add(MyQtViewer)

then in ``config.py``, you can do::

from glue.config import qt_client
from glue_qt.config import qt_client
qt_client.lazy_add('my_qt_viewer')

With this in place, the ``setup`` in your plugin will only get called if the
Expand Down
2 changes: 1 addition & 1 deletion doc/customizing_guide/full_custom_qt_viewer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ that will show ``MyWidget`` is::
self.setCentralWidget(self.my_widget)

# Register the viewer with glue
from glue.config import qt_client
from glue_qt.config import qt_client
qt_client.add(MyGlueWidget)

If you put the contents above into a ``config.py`` file then launch glue in
Expand Down
6 changes: 3 additions & 3 deletions doc/customizing_guide/mpl_viewer/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from qtpy.QtWidgets import QWidget, QVBoxLayout, QCheckBox

from glue.config import qt_client
from glue_qt.config import qt_client
from glue.core.data_combo_helper import ComponentIDComboHelper

from echo import CallbackProperty, SelectionCallbackProperty
Expand All @@ -13,9 +13,9 @@

from glue.viewers.matplotlib.layer_artist import MatplotlibLayerArtist
from glue.viewers.matplotlib.state import MatplotlibDataViewerState, MatplotlibLayerState
from glue.viewers.matplotlib.qt.data_viewer import MatplotlibDataViewer
from glue_qt.viewers.matplotlib.data_viewer import MatplotlibDataViewer

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


class TutorialViewerState(MatplotlibDataViewerState):
Expand Down
2 changes: 1 addition & 1 deletion doc/customizing_guide/scripts/bball_viewer_class.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from glue.viewers.custom.qt import CustomViewer
from glue_qt.viewers.custom import CustomViewer

from glue.core.subset import RoiSubsetState

Expand Down
6 changes: 3 additions & 3 deletions doc/customizing_guide/state_viewer/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
from matplotlib import pyplot as plt
from qtpy.QtWidgets import QWidget, QVBoxLayout, QCheckBox

from glue.config import qt_client
from glue_qt.config import qt_client
from glue.core.data_combo_helper import ComponentIDComboHelper

from echo import CallbackProperty, SelectionCallbackProperty
from echo.qt import connect_checkable_button, autoconnect_callbacks_to_qt

from glue.viewers.common.layer_artist import LayerArtist
from glue.viewers.common.state import ViewerState, LayerState
from glue.viewers.common.qt.data_viewer import DataViewer
from glue.viewers.common.data_viewer import DataViewer

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


class TutorialViewerState(ViewerState):
Expand Down
2 changes: 1 addition & 1 deletion doc/customizing_guide/toolbar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ tools that should be present in the toolbar:

In the example above, the viewer will include an toolbar with one tool (the one
we defined above). Currently the only toolbar class that is defined
is :class:`~glue.viewers.common.qt.toolbar.BasicToolbar`.
is :class:`~glue_qt.viewers.common.toolbar.BasicToolbar`.

Note that the toolbar is set up after ``__init__`` has run. Therefore, if you
want to do any custom set-up to the toolbar after it has been set up, you
Expand Down
2 changes: 1 addition & 1 deletion doc/customizing_guide/writing_plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ also do the registration - in the template, this looks like::

def setup():
from .data_viewer import MyViewer
from glue.config import qt_client
from glue_qt.config import qt_client
qt_client.add(MyViewer)

Finally, at the root of the package, you will need a ``setup.py`` file similar
Expand Down
Loading