diff --git a/examples/presets_widget.py b/examples/presets_widget.py index 5b88e1c5d..cd7683666 100644 --- a/examples/presets_widget.py +++ b/examples/presets_widget.py @@ -15,11 +15,12 @@ mmc.loadSystemConfiguration() wdg = QWidget() -wdg.setLayout(QFormLayout()) +layout = QFormLayout(wdg) +layout.setSpacing(4) for group in mmc.getAvailableConfigGroups(): gp_wdg = PresetsWidget(group) - wdg.layout().addRow(f"{group}:", gp_wdg) + layout.addRow(f"{group}:", gp_wdg) wdg.show() diff --git a/src/pymmcore_widgets/__init__.py b/src/pymmcore_widgets/__init__.py index 3946021a1..23cbbadb7 100644 --- a/src/pymmcore_widgets/__init__.py +++ b/src/pymmcore_widgets/__init__.py @@ -8,25 +8,28 @@ except PackageNotFoundError: __version__ = "uninstalled" -from ._camera_roi_widget import CameraRoiWidget -from ._channel_group_widget import ChannelGroupWidget -from ._channel_widget import ChannelWidget -from ._device_widget import DeviceWidget, StateDeviceWidget -from ._exposure_widget import DefaultCameraExposureWidget, ExposureWidget -from ._group_preset_widget._group_preset_table_widget import GroupPresetTableWidget -from ._image_widget import ImagePreview +from ._deprecated._device_widget import DeviceWidget, StateDeviceWidget from ._install_widget import InstallWidget -from ._live_button_widget import LiveButton -from ._load_system_cfg_widget import ConfigurationWidget -from ._objective_widget import ObjectivesWidget -from ._objectives_pixel_configuration_widget import ObjectivesPixelConfigurationWidget -from ._pixel_configuration_widget import PixelConfigurationWidget -from ._presets_widget import PresetsWidget -from ._properties_widget import PropertiesWidget -from ._property_browser import PropertyBrowser -from ._shutter_widget import ShuttersWidget -from ._snap_button_widget import SnapButton -from ._stage_widget import StageWidget +from .config_presets._group_preset_widget._group_preset_table_widget import ( + GroupPresetTableWidget, +) +from .config_presets._objectives_pixel_configuration_widget import ( + ObjectivesPixelConfigurationWidget, +) +from .config_presets._pixel_configuration_widget import PixelConfigurationWidget +from .control._camera_roi_widget import CameraRoiWidget +from .control._channel_group_widget import ChannelGroupWidget +from .control._channel_widget import ChannelWidget +from .control._exposure_widget import DefaultCameraExposureWidget, ExposureWidget +from .control._live_button_widget import LiveButton +from .control._load_system_cfg_widget import ConfigurationWidget +from .control._objective_widget import ObjectivesWidget +from .control._presets_widget import PresetsWidget +from .control._shutter_widget import ShuttersWidget +from .control._snap_button_widget import SnapButton +from .control._stage_widget import StageWidget +from .device_properties._properties_widget import PropertiesWidget +from .device_properties._property_browser import PropertyBrowser from .device_properties._property_widget import PropertyWidget from .hcwizard import ConfigWizard from .mda import MDAWidget @@ -38,6 +41,7 @@ TimePlanWidget, ZPlanWidget, ) +from .views._image_widget import ImagePreview def __getattr__(name: str) -> object: diff --git a/src/pymmcore_widgets/_core.py b/src/pymmcore_widgets/_core.py deleted file mode 100644 index 4ab372732..000000000 --- a/src/pymmcore_widgets/_core.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Functions and utils for managing the global mmcore singleton.""" - -from __future__ import annotations - -from pymmcore_plus import CMMCorePlus - - -def load_system_config(config: str = "", mmcore: CMMCorePlus | None = None) -> None: - """Internal convenience for `loadSystemConfiguration(config)`. - - This also unloads all devices first and resets the STATE. - If config is `None` or empty string, will load the MMConfig_demo. - Note that it should also always be fine for the end-user to use something like - `CMMCorePlus.instance().loadSystemConfiguration(...)` (instead of this function) - and we need to handle that as well. So this function shouldn't get too complex. - """ - mmc = mmcore or CMMCorePlus.instance() - mmc.unloadAllDevices() - mmc.loadSystemConfiguration(config or "MMConfig_demo.cfg") diff --git a/src/pymmcore_widgets/_group_preset_widget/__init__.py b/src/pymmcore_widgets/_deprecated/__init__.py similarity index 100% rename from src/pymmcore_widgets/_group_preset_widget/__init__.py rename to src/pymmcore_widgets/_deprecated/__init__.py diff --git a/src/pymmcore_widgets/_device_widget.py b/src/pymmcore_widgets/_deprecated/_device_widget.py similarity index 100% rename from src/pymmcore_widgets/_device_widget.py rename to src/pymmcore_widgets/_deprecated/_device_widget.py diff --git a/src/pymmcore_widgets/_icons.py b/src/pymmcore_widgets/_icons.py new file mode 100644 index 000000000..3620d5278 --- /dev/null +++ b/src/pymmcore_widgets/_icons.py @@ -0,0 +1,22 @@ +from fonticon_mdi6 import MDI6 +from pymmcore_plus import DeviceType + +ICONS: dict[DeviceType, str] = { + DeviceType.Any: MDI6.devices, + DeviceType.AutoFocus: MDI6.auto_upload, + DeviceType.Camera: MDI6.camera, + DeviceType.Core: MDI6.checkbox_blank_circle_outline, + DeviceType.Galvo: MDI6.mirror_variant, + DeviceType.Generic: MDI6.dev_to, + DeviceType.Hub: MDI6.hubspot, + DeviceType.ImageProcessor: MDI6.image_auto_adjust, + DeviceType.Magnifier: MDI6.magnify_plus, + DeviceType.Shutter: MDI6.camera_iris, + DeviceType.SignalIO: MDI6.signal, + DeviceType.SLM: MDI6.view_comfy, + DeviceType.Stage: MDI6.arrow_up_down, + DeviceType.State: MDI6.state_machine, + DeviceType.Unknown: MDI6.dev_to, + DeviceType.XYStage: MDI6.arrow_all, + DeviceType.Serial: MDI6.serial_port, +} diff --git a/src/pymmcore_widgets/_install_widget.py b/src/pymmcore_widgets/_install_widget.py index 6264caf80..48533d7a1 100644 --- a/src/pymmcore_widgets/_install_widget.py +++ b/src/pymmcore_widgets/_install_widget.py @@ -25,9 +25,6 @@ LOC_ROLE = Qt.ItemDataRole.UserRole + 1 -# src/pymmcore_widgets/_install_widget.py -# 83-98, 101-105, 144-148, 152-170, 180-182, 186-199, 203-204, 209-214 - class InstallWidget(QWidget): """Widget to manage installation of MicroManager. diff --git a/src/pymmcore_widgets/_util.py b/src/pymmcore_widgets/_util.py index 251251d23..b312b90d0 100644 --- a/src/pymmcore_widgets/_util.py +++ b/src/pymmcore_widgets/_util.py @@ -208,3 +208,17 @@ def resizeEvent(self, event: QResizeEvent | None) -> None: margins = QMarginsF(xmargin, ymargin, xmargin, ymargin) self.fitInView(rect.marginsAdded(margins), Qt.AspectRatioMode.KeepAspectRatio) super().resizeEvent(event) + + +def load_system_config(config: str = "", mmcore: CMMCorePlus | None = None) -> None: + """Internal convenience for `loadSystemConfiguration(config)`. + + This also unloads all devices first and resets the STATE. + If config is `None` or empty string, will load the MMConfig_demo. + Note that it should also always be fine for the end-user to use something like + `CMMCorePlus.instance().loadSystemConfiguration(...)` (instead of this function) + and we need to handle that as well. So this function shouldn't get too complex. + """ + mmc = mmcore or CMMCorePlus.instance() + mmc.unloadAllDevices() + mmc.loadSystemConfiguration(config or "MMConfig_demo.cfg") diff --git a/src/pymmcore_widgets/config_presets/_group_preset_widget/__init__.py b/src/pymmcore_widgets/config_presets/_group_preset_widget/__init__.py new file mode 100644 index 000000000..8c550e6a8 --- /dev/null +++ b/src/pymmcore_widgets/config_presets/_group_preset_widget/__init__.py @@ -0,0 +1,15 @@ +from ._add_first_preset_widget import AddFirstPresetWidget +from ._add_group_widget import AddGroupWidget +from ._add_preset_widget import AddPresetWidget +from ._edit_group_widget import EditGroupWidget +from ._edit_preset_widget import EditPresetWidget +from ._group_preset_table_widget import GroupPresetTableWidget + +__all__ = [ + "AddGroupWidget", + "AddFirstPresetWidget", + "AddPresetWidget", + "EditGroupWidget", + "EditPresetWidget", + "GroupPresetTableWidget", +] diff --git a/src/pymmcore_widgets/_group_preset_widget/_add_first_preset_widget.py b/src/pymmcore_widgets/config_presets/_group_preset_widget/_add_first_preset_widget.py similarity index 100% rename from src/pymmcore_widgets/_group_preset_widget/_add_first_preset_widget.py rename to src/pymmcore_widgets/config_presets/_group_preset_widget/_add_first_preset_widget.py diff --git a/src/pymmcore_widgets/_group_preset_widget/_add_group_widget.py b/src/pymmcore_widgets/config_presets/_group_preset_widget/_add_group_widget.py similarity index 96% rename from src/pymmcore_widgets/_group_preset_widget/_add_group_widget.py rename to src/pymmcore_widgets/config_presets/_group_preset_widget/_add_group_widget.py index 69c1e1fb6..2c607a18a 100644 --- a/src/pymmcore_widgets/_group_preset_widget/_add_group_widget.py +++ b/src/pymmcore_widgets/config_presets/_group_preset_widget/_add_group_widget.py @@ -16,8 +16,10 @@ QWidget, ) -from pymmcore_widgets._device_property_table import DevicePropertyTable -from pymmcore_widgets._device_type_filter import DeviceTypeFilters +from pymmcore_widgets.device_properties._device_property_table import ( + DevicePropertyTable, +) +from pymmcore_widgets.device_properties._device_type_filter import DeviceTypeFilters from ._add_first_preset_widget import AddFirstPresetWidget diff --git a/src/pymmcore_widgets/_group_preset_widget/_add_preset_widget.py b/src/pymmcore_widgets/config_presets/_group_preset_widget/_add_preset_widget.py similarity index 100% rename from src/pymmcore_widgets/_group_preset_widget/_add_preset_widget.py rename to src/pymmcore_widgets/config_presets/_group_preset_widget/_add_preset_widget.py diff --git a/src/pymmcore_widgets/_group_preset_widget/_edit_group_widget.py b/src/pymmcore_widgets/config_presets/_group_preset_widget/_edit_group_widget.py similarity index 97% rename from src/pymmcore_widgets/_group_preset_widget/_edit_group_widget.py rename to src/pymmcore_widgets/config_presets/_group_preset_widget/_edit_group_widget.py index 1ba16c199..5e36be26b 100644 --- a/src/pymmcore_widgets/_group_preset_widget/_edit_group_widget.py +++ b/src/pymmcore_widgets/config_presets/_group_preset_widget/_edit_group_widget.py @@ -13,9 +13,11 @@ QWidget, ) -from pymmcore_widgets._device_property_table import DevicePropertyTable -from pymmcore_widgets._device_type_filter import DeviceTypeFilters from pymmcore_widgets._util import block_core +from pymmcore_widgets.device_properties._device_property_table import ( + DevicePropertyTable, +) +from pymmcore_widgets.device_properties._device_type_filter import DeviceTypeFilters class EditGroupWidget(QDialog): diff --git a/src/pymmcore_widgets/_group_preset_widget/_edit_preset_widget.py b/src/pymmcore_widgets/config_presets/_group_preset_widget/_edit_preset_widget.py similarity index 100% rename from src/pymmcore_widgets/_group_preset_widget/_edit_preset_widget.py rename to src/pymmcore_widgets/config_presets/_group_preset_widget/_edit_preset_widget.py diff --git a/src/pymmcore_widgets/_group_preset_widget/_group_preset_table_widget.py b/src/pymmcore_widgets/config_presets/_group_preset_widget/_group_preset_table_widget.py similarity index 98% rename from src/pymmcore_widgets/_group_preset_widget/_group_preset_table_widget.py rename to src/pymmcore_widgets/config_presets/_group_preset_widget/_group_preset_table_widget.py index b8f95bebe..5490bdba8 100644 --- a/src/pymmcore_widgets/_group_preset_widget/_group_preset_table_widget.py +++ b/src/pymmcore_widgets/config_presets/_group_preset_widget/_group_preset_table_widget.py @@ -19,9 +19,8 @@ QWidget, ) -from pymmcore_widgets._core import load_system_config -from pymmcore_widgets._presets_widget import PresetsWidget -from pymmcore_widgets._util import block_core +from pymmcore_widgets._util import block_core, load_system_config +from pymmcore_widgets.control._presets_widget import PresetsWidget from pymmcore_widgets.device_properties._property_widget import PropertyWidget from ._add_group_widget import AddGroupWidget diff --git a/src/pymmcore_widgets/_objectives_pixel_configuration_widget.py b/src/pymmcore_widgets/config_presets/_objectives_pixel_configuration_widget.py similarity index 99% rename from src/pymmcore_widgets/_objectives_pixel_configuration_widget.py rename to src/pymmcore_widgets/config_presets/_objectives_pixel_configuration_widget.py index e961369e5..9fb6df066 100644 --- a/src/pymmcore_widgets/_objectives_pixel_configuration_widget.py +++ b/src/pymmcore_widgets/config_presets/_objectives_pixel_configuration_widget.py @@ -27,7 +27,7 @@ ) from superqt.utils import signals_blocked -from ._util import block_core, guess_objective_or_prompt +from pymmcore_widgets._util import block_core, guess_objective_or_prompt OBJECTIVE_LABEL = 0 RESOLUTION_ID = 1 diff --git a/src/pymmcore_widgets/_pixel_configuration_widget.py b/src/pymmcore_widgets/config_presets/_pixel_configuration_widget.py similarity index 99% rename from src/pymmcore_widgets/_pixel_configuration_widget.py rename to src/pymmcore_widgets/config_presets/_pixel_configuration_widget.py index ee87ba362..0442ba580 100644 --- a/src/pymmcore_widgets/_pixel_configuration_widget.py +++ b/src/pymmcore_widgets/config_presets/_pixel_configuration_widget.py @@ -27,8 +27,10 @@ ) from superqt.utils import signals_blocked -from pymmcore_widgets._device_property_table import DevicePropertyTable -from pymmcore_widgets._device_type_filter import DeviceTypeFilters +from pymmcore_widgets.device_properties._device_property_table import ( + DevicePropertyTable, +) +from pymmcore_widgets.device_properties._device_type_filter import DeviceTypeFilters from pymmcore_widgets.device_properties._property_widget import PropertyWidget from pymmcore_widgets.useq_widgets import DataTable, DataTableWidget from pymmcore_widgets.useq_widgets._column_info import FloatColumn, TextColumn diff --git a/src/pymmcore_widgets/control/__init__.py b/src/pymmcore_widgets/control/__init__.py new file mode 100644 index 000000000..6c1e972f6 --- /dev/null +++ b/src/pymmcore_widgets/control/__init__.py @@ -0,0 +1 @@ +"""Widgets that control various devices at runtime.""" diff --git a/src/pymmcore_widgets/_camera_roi_widget.py b/src/pymmcore_widgets/control/_camera_roi_widget.py similarity index 100% rename from src/pymmcore_widgets/_camera_roi_widget.py rename to src/pymmcore_widgets/control/_camera_roi_widget.py diff --git a/src/pymmcore_widgets/_channel_group_widget.py b/src/pymmcore_widgets/control/_channel_group_widget.py similarity index 100% rename from src/pymmcore_widgets/_channel_group_widget.py rename to src/pymmcore_widgets/control/_channel_group_widget.py diff --git a/src/pymmcore_widgets/_channel_widget.py b/src/pymmcore_widgets/control/_channel_widget.py similarity index 97% rename from src/pymmcore_widgets/_channel_widget.py rename to src/pymmcore_widgets/control/_channel_widget.py index 27979118f..b389493af 100644 --- a/src/pymmcore_widgets/_channel_widget.py +++ b/src/pymmcore_widgets/control/_channel_widget.py @@ -3,8 +3,8 @@ from pymmcore_plus import CMMCorePlus from qtpy.QtWidgets import QComboBox, QVBoxLayout, QWidget -from ._presets_widget import PresetsWidget -from ._util import ComboMessageBox +from pymmcore_widgets._util import ComboMessageBox +from pymmcore_widgets.control._presets_widget import PresetsWidget class ChannelWidget(QWidget): diff --git a/src/pymmcore_widgets/_exposure_widget.py b/src/pymmcore_widgets/control/_exposure_widget.py similarity index 100% rename from src/pymmcore_widgets/_exposure_widget.py rename to src/pymmcore_widgets/control/_exposure_widget.py diff --git a/src/pymmcore_widgets/_live_button_widget.py b/src/pymmcore_widgets/control/_live_button_widget.py similarity index 100% rename from src/pymmcore_widgets/_live_button_widget.py rename to src/pymmcore_widgets/control/_live_button_widget.py diff --git a/src/pymmcore_widgets/_load_system_cfg_widget.py b/src/pymmcore_widgets/control/_load_system_cfg_widget.py similarity index 76% rename from src/pymmcore_widgets/_load_system_cfg_widget.py rename to src/pymmcore_widgets/control/_load_system_cfg_widget.py index 01bbf1c28..7fe11a069 100644 --- a/src/pymmcore_widgets/_load_system_cfg_widget.py +++ b/src/pymmcore_widgets/control/_load_system_cfg_widget.py @@ -1,15 +1,9 @@ from __future__ import annotations from pymmcore_plus import CMMCorePlus -from qtpy.QtWidgets import ( - QFileDialog, - QHBoxLayout, - QLineEdit, - QPushButton, - QWidget, -) +from qtpy.QtWidgets import QFileDialog, QHBoxLayout, QLineEdit, QPushButton, QWidget -from ._core import load_system_config +from pymmcore_widgets._util import load_system_config class ConfigurationWidget(QWidget): @@ -62,21 +56,3 @@ def _browse_cfg(self) -> None: def _load_cfg(self) -> None: """Load the config path currently in the line_edit.""" load_system_config(self.cfg_LineEdit.text(), self._mmc) - - def setTitle(self, title: str) -> None: - _show_deprecation("setTitle") - - def title(self) -> str: - _show_deprecation("title") - return "" - - -def _show_deprecation(name: str) -> None: - import warnings - - warnings.warn( - "ConfigurationWidget is no longer a QGroupBox. " - f"Please place it in a groupbox if you need {name}", - DeprecationWarning, - stacklevel=3, - ) diff --git a/src/pymmcore_widgets/_objective_widget.py b/src/pymmcore_widgets/control/_objective_widget.py similarity index 97% rename from src/pymmcore_widgets/_objective_widget.py rename to src/pymmcore_widgets/control/_objective_widget.py index 68e92cde6..f8264d139 100644 --- a/src/pymmcore_widgets/_objective_widget.py +++ b/src/pymmcore_widgets/control/_objective_widget.py @@ -3,8 +3,8 @@ from pymmcore_plus import CMMCorePlus from qtpy.QtWidgets import QComboBox, QHBoxLayout, QLabel, QSizePolicy, QWidget -from ._device_widget import StateDeviceWidget -from ._util import guess_objective_or_prompt +from pymmcore_widgets._deprecated._device_widget import StateDeviceWidget +from pymmcore_widgets._util import guess_objective_or_prompt class ObjectivesWidget(QWidget): diff --git a/src/pymmcore_widgets/_presets_widget.py b/src/pymmcore_widgets/control/_presets_widget.py similarity index 98% rename from src/pymmcore_widgets/_presets_widget.py rename to src/pymmcore_widgets/control/_presets_widget.py index fdbb278ab..8d73a2d63 100644 --- a/src/pymmcore_widgets/_presets_widget.py +++ b/src/pymmcore_widgets/control/_presets_widget.py @@ -8,11 +8,11 @@ from qtpy.QtWidgets import QComboBox, QHBoxLayout, QWidget from superqt.utils import signals_blocked -from ._util import block_core +from pymmcore_widgets._util import block_core class PresetsWidget(QWidget): - """A Widget to create a QCombobox containing the presets of the specified group. + """Combobox widget to select the current preset for a given config group. Parameters ---------- diff --git a/src/pymmcore_widgets/_shutter_widget.py b/src/pymmcore_widgets/control/_shutter_widget.py similarity index 100% rename from src/pymmcore_widgets/_shutter_widget.py rename to src/pymmcore_widgets/control/_shutter_widget.py diff --git a/src/pymmcore_widgets/_snap_button_widget.py b/src/pymmcore_widgets/control/_snap_button_widget.py similarity index 100% rename from src/pymmcore_widgets/_snap_button_widget.py rename to src/pymmcore_widgets/control/_snap_button_widget.py diff --git a/src/pymmcore_widgets/_stage_widget.py b/src/pymmcore_widgets/control/_stage_widget.py similarity index 100% rename from src/pymmcore_widgets/_stage_widget.py rename to src/pymmcore_widgets/control/_stage_widget.py diff --git a/src/pymmcore_widgets/_device_property_table.py b/src/pymmcore_widgets/device_properties/_device_property_table.py similarity index 91% rename from src/pymmcore_widgets/_device_property_table.py rename to src/pymmcore_widgets/device_properties/_device_property_table.py index 3d630e00b..4a8318462 100644 --- a/src/pymmcore_widgets/_device_property_table.py +++ b/src/pymmcore_widgets/device_properties/_device_property_table.py @@ -3,37 +3,20 @@ from logging import getLogger from typing import Iterable, cast -from fonticon_mdi6 import MDI6 from pymmcore_plus import CMMCorePlus, DeviceProperty, DeviceType from qtpy.QtCore import Qt from qtpy.QtGui import QColor from qtpy.QtWidgets import QAbstractScrollArea, QTableWidget, QTableWidgetItem, QWidget from superqt.fonticon import icon -from pymmcore_widgets.device_properties._property_widget import PropertyWidget - -ICONS: dict[DeviceType, str] = { - DeviceType.Any: MDI6.devices, - DeviceType.AutoFocus: MDI6.auto_upload, - DeviceType.Camera: MDI6.camera, - DeviceType.Core: MDI6.checkbox_blank_circle_outline, - DeviceType.Galvo: MDI6.mirror_variant, - DeviceType.Generic: MDI6.dev_to, - DeviceType.Hub: MDI6.hubspot, - DeviceType.ImageProcessor: MDI6.image_auto_adjust, - DeviceType.Magnifier: MDI6.magnify_plus, - DeviceType.Shutter: MDI6.camera_iris, - DeviceType.SignalIO: MDI6.signal, - DeviceType.SLM: MDI6.view_comfy, - DeviceType.Stage: MDI6.arrow_up_down, - DeviceType.State: MDI6.state_machine, - DeviceType.Unknown: MDI6.dev_to, - DeviceType.XYStage: MDI6.arrow_all, - DeviceType.Serial: MDI6.serial_port, -} +from pymmcore_widgets._icons import ICONS + +from ._property_widget import PropertyWidget logger = getLogger(__name__) +__all__ = ["DevicePropertyTable"] + class DevicePropertyTable(QTableWidget): """Table of all currently loaded device properties. diff --git a/src/pymmcore_widgets/_device_type_filter.py b/src/pymmcore_widgets/device_properties/_device_type_filter.py similarity index 100% rename from src/pymmcore_widgets/_device_type_filter.py rename to src/pymmcore_widgets/device_properties/_device_type_filter.py diff --git a/src/pymmcore_widgets/_properties_widget.py b/src/pymmcore_widgets/device_properties/_properties_widget.py similarity index 98% rename from src/pymmcore_widgets/_properties_widget.py rename to src/pymmcore_widgets/device_properties/_properties_widget.py index ae744c4a0..de3ed2854 100644 --- a/src/pymmcore_widgets/_properties_widget.py +++ b/src/pymmcore_widgets/device_properties/_properties_widget.py @@ -10,7 +10,7 @@ from pymmcore_plus import CMMCorePlus from qtpy.QtWidgets import QGridLayout, QLabel, QWidget -from .device_properties._property_widget import PropertyWidget +from ._property_widget import PropertyWidget if TYPE_CHECKING: import re diff --git a/src/pymmcore_widgets/_property_browser.py b/src/pymmcore_widgets/device_properties/_property_browser.py similarity index 96% rename from src/pymmcore_widgets/_property_browser.py rename to src/pymmcore_widgets/device_properties/_property_browser.py index d89ed5202..2a432c880 100644 --- a/src/pymmcore_widgets/_property_browser.py +++ b/src/pymmcore_widgets/device_properties/_property_browser.py @@ -3,8 +3,9 @@ from pymmcore_plus import CMMCorePlus from qtpy.QtWidgets import QDialog, QHBoxLayout, QLineEdit, QVBoxLayout, QWidget +from pymmcore_widgets.device_properties._device_type_filter import DeviceTypeFilters + from ._device_property_table import DevicePropertyTable -from ._device_type_filter import DeviceTypeFilters class PropertyBrowser(QDialog): diff --git a/src/pymmcore_widgets/experimental.py b/src/pymmcore_widgets/experimental.py index 3a704297b..3e311a4aa 100644 --- a/src/pymmcore_widgets/experimental.py +++ b/src/pymmcore_widgets/experimental.py @@ -1,3 +1,3 @@ -from ._stack_viewer import StackViewer +from .views._stack_viewer import StackViewer __all__ = ["StackViewer"] diff --git a/src/pymmcore_widgets/hcwizard/devices_page.py b/src/pymmcore_widgets/hcwizard/devices_page.py index 62b0fdc2f..b35562208 100644 --- a/src/pymmcore_widgets/hcwizard/devices_page.py +++ b/src/pymmcore_widgets/hcwizard/devices_page.py @@ -26,7 +26,7 @@ from superqt.fonticon import icon, setTextIcon from superqt.utils import exceptions_as_dialog, signals_blocked -from pymmcore_widgets._device_property_table import ICONS +from pymmcore_widgets._icons import ICONS from ._base_page import ConfigWizardPage from ._dev_setup_dialog import DeviceSetupDialog diff --git a/src/pymmcore_widgets/views/__init__.py b/src/pymmcore_widgets/views/__init__.py new file mode 100644 index 000000000..2c124b3cc --- /dev/null +++ b/src/pymmcore_widgets/views/__init__.py @@ -0,0 +1 @@ +"""Widgets that view images and other states.""" diff --git a/src/pymmcore_widgets/_image_widget.py b/src/pymmcore_widgets/views/_image_widget.py similarity index 100% rename from src/pymmcore_widgets/_image_widget.py rename to src/pymmcore_widgets/views/_image_widget.py diff --git a/src/pymmcore_widgets/_stack_viewer/__init__.py b/src/pymmcore_widgets/views/_stack_viewer/__init__.py similarity index 100% rename from src/pymmcore_widgets/_stack_viewer/__init__.py rename to src/pymmcore_widgets/views/_stack_viewer/__init__.py diff --git a/src/pymmcore_widgets/_stack_viewer/_channel_row.py b/src/pymmcore_widgets/views/_stack_viewer/_channel_row.py similarity index 100% rename from src/pymmcore_widgets/_stack_viewer/_channel_row.py rename to src/pymmcore_widgets/views/_stack_viewer/_channel_row.py diff --git a/src/pymmcore_widgets/_stack_viewer/_datastore.py b/src/pymmcore_widgets/views/_stack_viewer/_datastore.py similarity index 100% rename from src/pymmcore_widgets/_stack_viewer/_datastore.py rename to src/pymmcore_widgets/views/_stack_viewer/_datastore.py diff --git a/src/pymmcore_widgets/_stack_viewer/_labeled_slider.py b/src/pymmcore_widgets/views/_stack_viewer/_labeled_slider.py similarity index 100% rename from src/pymmcore_widgets/_stack_viewer/_labeled_slider.py rename to src/pymmcore_widgets/views/_stack_viewer/_labeled_slider.py diff --git a/src/pymmcore_widgets/_stack_viewer/_save_button.py b/src/pymmcore_widgets/views/_stack_viewer/_save_button.py similarity index 100% rename from src/pymmcore_widgets/_stack_viewer/_save_button.py rename to src/pymmcore_widgets/views/_stack_viewer/_save_button.py diff --git a/src/pymmcore_widgets/_stack_viewer/_stack_viewer.py b/src/pymmcore_widgets/views/_stack_viewer/_stack_viewer.py similarity index 100% rename from src/pymmcore_widgets/_stack_viewer/_stack_viewer.py rename to src/pymmcore_widgets/views/_stack_viewer/_stack_viewer.py diff --git a/tests/test_camera_roi_widget.py b/tests/test_camera_roi_widget.py index 1b0282cb5..7e32a2152 100644 --- a/tests/test_camera_roi_widget.py +++ b/tests/test_camera_roi_widget.py @@ -5,7 +5,7 @@ from pymmcore_plus import CMMCorePlus -from pymmcore_widgets._camera_roi_widget import CameraRoiWidget +from pymmcore_widgets.control._camera_roi_widget import CameraRoiWidget if TYPE_CHECKING: from pytestqt.qtbot import QtBot diff --git a/tests/test_channel_widget.py b/tests/test_channel_widget.py index 655fa76d4..5460f64da 100644 --- a/tests/test_channel_widget.py +++ b/tests/test_channel_widget.py @@ -4,9 +4,9 @@ from qtpy.QtWidgets import QComboBox -from pymmcore_widgets._channel_widget import ChannelWidget -from pymmcore_widgets._presets_widget import PresetsWidget from pymmcore_widgets._util import block_core +from pymmcore_widgets.control._channel_widget import ChannelWidget +from pymmcore_widgets.control._presets_widget import PresetsWidget if TYPE_CHECKING: from pymmcore_plus import CMMCorePlus diff --git a/tests/test_datastore.py b/tests/test_datastore.py index a31df07b7..e2465ea76 100644 --- a/tests/test_datastore.py +++ b/tests/test_datastore.py @@ -1,7 +1,7 @@ from pymmcore_plus import CMMCorePlus from useq import MDAEvent, MDASequence -from pymmcore_widgets._stack_viewer._datastore import QOMEZarrDatastore +from pymmcore_widgets.views._stack_viewer._datastore import QOMEZarrDatastore sequence = MDASequence( channels=[{"config": "DAPI", "exposure": 10}], diff --git a/tests/test_group_preset_widget.py b/tests/test_group_preset_widget.py index feb45b254..93d72d87a 100644 --- a/tests/test_group_preset_widget.py +++ b/tests/test_group_preset_widget.py @@ -11,11 +11,11 @@ from qtpy.QtWidgets import QFileDialog from pymmcore_widgets import PresetsWidget -from pymmcore_widgets._group_preset_widget._add_group_widget import AddGroupWidget -from pymmcore_widgets._group_preset_widget._add_preset_widget import AddPresetWidget -from pymmcore_widgets._group_preset_widget._edit_group_widget import EditGroupWidget -from pymmcore_widgets._group_preset_widget._edit_preset_widget import EditPresetWidget -from pymmcore_widgets._group_preset_widget._group_preset_table_widget import ( +from pymmcore_widgets.config_presets._group_preset_widget import ( + AddGroupWidget, + AddPresetWidget, + EditGroupWidget, + EditPresetWidget, GroupPresetTableWidget, ) diff --git a/tests/test_live_button.py b/tests/test_live_button.py index 06891ffbf..d8263ca73 100644 --- a/tests/test_live_button.py +++ b/tests/test_live_button.py @@ -4,7 +4,7 @@ from qtpy.QtCore import QSize -from pymmcore_widgets._live_button_widget import LiveButton +from pymmcore_widgets.control._live_button_widget import LiveButton if TYPE_CHECKING: from pymmcore_plus import CMMCorePlus diff --git a/tests/test_load_system_cfg_widget.py b/tests/test_load_system_cfg_widget.py index 58ad910b0..8fafaa3eb 100644 --- a/tests/test_load_system_cfg_widget.py +++ b/tests/test_load_system_cfg_widget.py @@ -2,7 +2,7 @@ from typing import TYPE_CHECKING -from pymmcore_widgets._load_system_cfg_widget import ConfigurationWidget +from pymmcore_widgets.control._load_system_cfg_widget import ConfigurationWidget if TYPE_CHECKING: from pymmcore_plus import CMMCorePlus diff --git a/tests/test_objective_pixel_config_widget.py b/tests/test_objective_pixel_config_widget.py index e248dcc13..b573e07c4 100644 --- a/tests/test_objective_pixel_config_widget.py +++ b/tests/test_objective_pixel_config_widget.py @@ -4,7 +4,7 @@ from pymmcore_plus import CMMCorePlus -from pymmcore_widgets._objectives_pixel_configuration_widget import ( +from pymmcore_widgets.config_presets._objectives_pixel_configuration_widget import ( ObjectivesPixelConfigurationWidget, PixelSizeTable, ) diff --git a/tests/test_objective_widget.py b/tests/test_objective_widget.py index 21aca25cb..dd7b82a9e 100644 --- a/tests/test_objective_widget.py +++ b/tests/test_objective_widget.py @@ -6,8 +6,8 @@ import pytest from qtpy.QtWidgets import QDialog -from pymmcore_widgets._objective_widget import ObjectivesWidget from pymmcore_widgets._util import ComboMessageBox +from pymmcore_widgets.control._objective_widget import ObjectivesWidget if TYPE_CHECKING: from pymmcore_plus import CMMCorePlus diff --git a/tests/test_pixel_config_widget.py b/tests/test_pixel_config_widget.py index 03705ff28..8581990c3 100644 --- a/tests/test_pixel_config_widget.py +++ b/tests/test_pixel_config_widget.py @@ -7,7 +7,7 @@ from pymmcore_plus.model import PixelSizePreset, Setting from qtpy.QtCore import Qt -from pymmcore_widgets._pixel_configuration_widget import ( +from pymmcore_widgets.config_presets._pixel_configuration_widget import ( ID, NEW, PixelConfigurationWidget, diff --git a/tests/test_presets_widget.py b/tests/test_presets_widget.py index ef44b5801..1499bc0c3 100644 --- a/tests/test_presets_widget.py +++ b/tests/test_presets_widget.py @@ -4,7 +4,7 @@ import pytest -from pymmcore_widgets._presets_widget import PresetsWidget +from pymmcore_widgets.control._presets_widget import PresetsWidget if TYPE_CHECKING: from pymmcore_plus import CMMCorePlus diff --git a/tests/test_shutter_widget.py b/tests/test_shutter_widget.py index 54176a21a..e6f3dfac7 100644 --- a/tests/test_shutter_widget.py +++ b/tests/test_shutter_widget.py @@ -5,7 +5,7 @@ import pytest from pymmcore_plus import CMMCorePlus -from pymmcore_widgets._shutter_widget import ShuttersWidget +from pymmcore_widgets.control._shutter_widget import ShuttersWidget if TYPE_CHECKING: from pytestqt.qtbot import QtBot diff --git a/tests/test_snap_button_widget.py b/tests/test_snap_button_widget.py index ead9b7364..9e0ad72e1 100644 --- a/tests/test_snap_button_widget.py +++ b/tests/test_snap_button_widget.py @@ -4,7 +4,7 @@ from qtpy.QtCore import QSize -from pymmcore_widgets._snap_button_widget import SnapButton +from pymmcore_widgets.control._snap_button_widget import SnapButton if TYPE_CHECKING: from pymmcore_plus import CMMCorePlus diff --git a/tests/test_stack_viewer.py b/tests/test_stack_viewer.py index 672fe422d..6f7bc4c66 100644 --- a/tests/test_stack_viewer.py +++ b/tests/test_stack_viewer.py @@ -12,8 +12,8 @@ from vispy.app.canvas import MouseEvent from vispy.scene.events import SceneMouseEvent -from pymmcore_widgets._stack_viewer import CMAPS from pymmcore_widgets.experimental import StackViewer +from pymmcore_widgets.views._stack_viewer import CMAPS if TYPE_CHECKING: from pytestqt.qtbot import QtBot diff --git a/tests/test_stage_widget.py b/tests/test_stage_widget.py index a5eba7ddf..1b0abb0dc 100644 --- a/tests/test_stage_widget.py +++ b/tests/test_stage_widget.py @@ -2,7 +2,7 @@ from typing import TYPE_CHECKING -from pymmcore_widgets._stage_widget import StageWidget +from pymmcore_widgets.control._stage_widget import StageWidget if TYPE_CHECKING: from pymmcore_plus import CMMCorePlus