diff --git a/bec_widgets/cli/client.py b/bec_widgets/cli/client.py index 2974bce2..7df48c90 100644 --- a/bec_widgets/cli/client.py +++ b/bec_widgets/cli/client.py @@ -2196,7 +2196,7 @@ class MultiWaveform(RPCBase): """ @rpc_call - def plot(self, monitor: "str", color_palette: "str | None" = "magma"): + def plot(self, monitor: "str", color_palette: "str | None" = "plasma"): """ Create a plot for the given monitor. Args: @@ -2966,7 +2966,7 @@ class ScatterWaveform(RPCBase): x_entry: "None | str" = None, y_entry: "None | str" = None, z_entry: "None | str" = None, - color_map: "str | None" = "magma", + color_map: "str | None" = "plasma", label: "str | None" = None, validate_bec: "bool" = True, ) -> "ScatterCurve": diff --git a/bec_widgets/widgets/plots/image/image.py b/bec_widgets/widgets/plots/image/image.py index 29a48c1a..384c6b26 100644 --- a/bec_widgets/widgets/plots/image/image.py +++ b/bec_widgets/widgets/plots/image/image.py @@ -27,7 +27,7 @@ logger = bec_logger.logger # noinspection PyDataclass class ImageConfig(ConnectionConfig): color_map: str = Field( - "magma", description="The colormap of the figure widget.", validate_default=True + "plasma", description="The colormap of the figure widget.", validate_default=True ) color_bar: Literal["full", "simple"] | None = Field( None, description="The type of the color bar." @@ -142,8 +142,8 @@ class Image(PlotBase): self.plot_item.addItem(self._main_image) self.scan_id = None - # Default Color map to magma - self.color_map = "magma" + # Default Color map to plasma + self.color_map = "plasma" ################################################################################ # Widget Specific GUI interactions diff --git a/bec_widgets/widgets/plots/image/image_item.py b/bec_widgets/widgets/plots/image/image_item.py index 352a017d..8ead1599 100644 --- a/bec_widgets/widgets/plots/image/image_item.py +++ b/bec_widgets/widgets/plots/image/image_item.py @@ -24,7 +24,7 @@ class ImageItemConfig(ConnectionConfig): # TODO review config monitor: str | None = Field(None, description="The name of the monitor.") monitor_type: Literal["1d", "2d", "auto"] = Field("auto", description="The type of monitor.") source: str | None = Field(None, description="The source of the curve.") - color_map: str | None = Field("magma", description="The color map of the image.") + color_map: str | None = Field("plasma", description="The color map of the image.") downsample: bool | None = Field(True, description="Whether to downsample the image.") opacity: float | None = Field(1.0, description="The opacity of the image.") v_range: tuple[float | int, float | int] | None = Field( diff --git a/bec_widgets/widgets/plots/multi_waveform/multi_waveform.py b/bec_widgets/widgets/plots/multi_waveform/multi_waveform.py index 0e03d9e4..d0c6f5cb 100644 --- a/bec_widgets/widgets/plots/multi_waveform/multi_waveform.py +++ b/bec_widgets/widgets/plots/multi_waveform/multi_waveform.py @@ -25,7 +25,7 @@ logger = bec_logger.logger class MultiWaveformConfig(ConnectionConfig): color_palette: str | None = Field( - "magma", description="The color palette of the figure widget.", validate_default=True + "plasma", description="The color palette of the figure widget.", validate_default=True ) curve_limit: int | None = Field( 200, description="The maximum number of curves to display on the plot." @@ -308,7 +308,7 @@ class MultiWaveform(PlotBase): ################################################################################ @SafeSlot(popup_error=True) - def plot(self, monitor: str, color_palette: str | None = "magma"): + def plot(self, monitor: str, color_palette: str | None = "plasma"): """ Create a plot for the given monitor. Args: diff --git a/bec_widgets/widgets/plots/multi_waveform/toolbar_bundles/monitor_selection.py b/bec_widgets/widgets/plots/multi_waveform/toolbar_bundles/monitor_selection.py index 09d745c6..14198512 100644 --- a/bec_widgets/widgets/plots/multi_waveform/toolbar_bundles/monitor_selection.py +++ b/bec_widgets/widgets/plots/multi_waveform/toolbar_bundles/monitor_selection.py @@ -40,7 +40,7 @@ class MultiWaveformSelectionToolbarBundle(ToolbarBundle): self.add_action("monitor", WidgetAction(widget=self.monitor, adjust_size=False)) # Colormap Selection - self.colormap_widget = BECColorMapWidget(cmap="magma", parent_id=self.target_widget.gui_id) + self.colormap_widget = BECColorMapWidget(cmap="plasma", parent_id=self.target_widget.gui_id) self.add_action("color_map", WidgetAction(widget=self.colormap_widget, adjust_size=False)) # Connect slots, a device will be connected upon change of any combobox diff --git a/bec_widgets/widgets/plots/scatter_waveform/scatter_curve.py b/bec_widgets/widgets/plots/scatter_waveform/scatter_curve.py index da92ed9b..97884ca1 100644 --- a/bec_widgets/widgets/plots/scatter_waveform/scatter_curve.py +++ b/bec_widgets/widgets/plots/scatter_waveform/scatter_curve.py @@ -38,7 +38,7 @@ class ScatterCurveConfig(ConnectionConfig): "solid", description="The style of the pen of the curve." ) color_map: str | None = Field( - "magma", description="The color palette of the figure widget.", validate_default=True + "plasma", description="The color palette of the figure widget.", validate_default=True ) x_device: ScatterDeviceSignal | None = Field( None, description="The x device signal of the scatter waveform." diff --git a/bec_widgets/widgets/plots/scatter_waveform/scatter_waveform.py b/bec_widgets/widgets/plots/scatter_waveform/scatter_waveform.py index 45005792..75a303a8 100644 --- a/bec_widgets/widgets/plots/scatter_waveform/scatter_waveform.py +++ b/bec_widgets/widgets/plots/scatter_waveform/scatter_waveform.py @@ -30,7 +30,7 @@ logger = bec_logger.logger # noinspection PyDataclass class ScatterWaveformConfig(ConnectionConfig): color_map: str | None = Field( - "magma", + "plasma", description="The color map of the z scaling of scatter waveform.", validate_default=True, ) @@ -266,7 +266,7 @@ class ScatterWaveform(PlotBase): x_entry: None | str = None, y_entry: None | str = None, z_entry: None | str = None, - color_map: str | None = "magma", + color_map: str | None = "plasma", label: str | None = None, validate_bec: bool = True, ) -> ScatterCurve: diff --git a/bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_tree.py b/bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_tree.py index a2f96776..90e3f944 100644 --- a/bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_tree.py +++ b/bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_tree.py @@ -373,7 +373,7 @@ class CurveTree(BECWidget, QWidget): if self.waveform and hasattr(self.waveform, "color_palette"): self.color_palette = self.waveform.color_palette else: - self.color_palette = "magma" + self.color_palette = "plasma" self.get_bec_shortcuts() @@ -413,7 +413,7 @@ class CurveTree(BECWidget, QWidget): self.toolbar.add_action("renormalize_colors", renorm_action, self) renorm_action.action.triggered.connect(lambda checked: self.renormalize_colors()) - self.colormap_widget = BECColorMapWidget(cmap=self.color_palette or "magma") + self.colormap_widget = BECColorMapWidget(cmap=self.color_palette or "plasma") self.toolbar.addWidget(self.colormap_widget) self.colormap_widget.colormap_changed_signal.connect(self.handle_colormap_changed) diff --git a/bec_widgets/widgets/plots/waveform/waveform.py b/bec_widgets/widgets/plots/waveform/waveform.py index 8f7dee21..5c896ffc 100644 --- a/bec_widgets/widgets/plots/waveform/waveform.py +++ b/bec_widgets/widgets/plots/waveform/waveform.py @@ -30,7 +30,7 @@ logger = bec_logger.logger # noinspection PyDataclass class WaveformConfig(ConnectionConfig): color_palette: str | None = Field( - "magma", description="The color palette of the figure widget.", validate_default=True + "plasma", description="The color palette of the figure widget.", validate_default=True ) model_config: dict = {"validate_assignment": True} @@ -1748,12 +1748,10 @@ class Waveform(PlotBase): self.proxy_dap_request.cleanup() self.clear_all() if self.curve_settings_dialog is not None: - self.curve_settings_dialog.close() - self.curve_settings_dialog.deleteLater() + self.curve_settings_dialog.reject() self.curve_settings_dialog = None if self.dap_summary_dialog is not None: - self.dap_summary_dialog.close() - self.dap_summary_dialog.deleteLater() + self.dap_summary_dialog.reject() self.dap_summary_dialog = None super().cleanup() diff --git a/bec_widgets/widgets/progress/ring_progress_bar/ring_progress_bar.py b/bec_widgets/widgets/progress/ring_progress_bar/ring_progress_bar.py index 9fd9153b..e3db63f9 100644 --- a/bec_widgets/widgets/progress/ring_progress_bar/ring_progress_bar.py +++ b/bec_widgets/widgets/progress/ring_progress_bar/ring_progress_bar.py @@ -20,7 +20,7 @@ logger = bec_logger.logger class RingProgressBarConfig(ConnectionConfig): color_map: Optional[str] = Field( - "magma", description="Color scheme for the progress bars.", validate_default=True + "plasma", description="Color scheme for the progress bars.", validate_default=True ) min_number_of_bars: int | None = Field( 1, description="Minimum number of progress bars to display." diff --git a/bec_widgets/widgets/utility/visual/colormap_widget/colormap_widget.py b/bec_widgets/widgets/utility/visual/colormap_widget/colormap_widget.py index 47df2246..7ee2f688 100644 --- a/bec_widgets/widgets/utility/visual/colormap_widget/colormap_widget.py +++ b/bec_widgets/widgets/utility/visual/colormap_widget/colormap_widget.py @@ -12,7 +12,7 @@ class BECColorMapWidget(BECWidget, QWidget): PLUGIN = True RPC = False - def __init__(self, parent=None, cmap: str = "magma", **kwargs): + def __init__(self, parent=None, cmap: str = "plasma", **kwargs): super().__init__(parent=parent, **kwargs) # Create the ColorMapButton self.button = ColorMapButton() diff --git a/tests/unit_tests/test_colormap_widget.py b/tests/unit_tests/test_colormap_widget.py index 7cb2f6a3..959da969 100644 --- a/tests/unit_tests/test_colormap_widget.py +++ b/tests/unit_tests/test_colormap_widget.py @@ -16,10 +16,10 @@ def test_color_map_widget_init(color_map_widget): """Test that the widget initializes correctly.""" assert color_map_widget is not None assert isinstance(color_map_widget, BECColorMapWidget) - assert color_map_widget.colormap == "magma" + assert color_map_widget.colormap == "plasma" assert isinstance(color_map_widget.button, ColorMapButton) # Check that the button has the correct initial colormap - assert color_map_widget.button.colorMap().name == "magma" + assert color_map_widget.button.colorMap().name == "plasma" def test_color_map_widget_set_valid_colormap(color_map_widget): @@ -44,7 +44,7 @@ def test_color_map_widget_set_invalid_colormap(color_map_widget): def test_color_map_widget_signal_emitted(color_map_widget, qtbot): """Test that the signal is emitted when the colormap changes.""" - new_cmap = "plasma" + new_cmap = "magma" with qtbot.waitSignal(color_map_widget.colormap_changed_signal, timeout=1000) as blocker: color_map_widget.colormap = new_cmap assert blocker.signal_triggered @@ -58,7 +58,7 @@ def test_color_map_widget_signal_not_emitted_for_invalid_colormap(color_map_widg with qtbot.assertNotEmitted(color_map_widget.colormap_changed_signal): color_map_widget.colormap = invalid_cmap # The colormap should remain unchanged - assert color_map_widget.colormap == "magma" + assert color_map_widget.colormap == "plasma" def test_color_map_widget_resize(color_map_widget): diff --git a/tests/unit_tests/test_curve_settings.py b/tests/unit_tests/test_curve_settings.py index ff2f63d3..eb38fbb6 100644 --- a/tests/unit_tests/test_curve_settings.py +++ b/tests/unit_tests/test_curve_settings.py @@ -142,7 +142,7 @@ def curve_tree_fixture(qtbot, mocked_client_with_dap): Creates a CurveTree widget referencing a mocked or real Waveform. """ wf = create_widget(qtbot, Waveform, client=mocked_client_with_dap) - wf.color_palette = "magma" + wf.color_palette = "plasma" curve_tree = create_widget(qtbot, CurveTree, parent=None, waveform=wf) return curve_tree, wf @@ -154,7 +154,7 @@ def test_curve_tree_init(curve_tree_fixture): """ curve_tree, wf = curve_tree_fixture assert curve_tree.waveform == wf - assert curve_tree.color_palette == "magma" + assert curve_tree.color_palette == "plasma" assert curve_tree.tree.columnCount() == 7 assert "add" in curve_tree.toolbar.widgets diff --git a/tests/unit_tests/test_image_view_next_gen.py b/tests/unit_tests/test_image_view_next_gen.py index 68af7dab..9adf9485 100644 --- a/tests/unit_tests/test_image_view_next_gen.py +++ b/tests/unit_tests/test_image_view_next_gen.py @@ -13,7 +13,7 @@ from tests.unit_tests.conftest import create_widget def test_initialization_defaults(qtbot, mocked_client): bec_image_view = create_widget(qtbot, Image, client=mocked_client) - assert bec_image_view.color_map == "magma" + assert bec_image_view.color_map == "plasma" assert bec_image_view.autorange is True assert bec_image_view.autorange_mode == "mean" assert bec_image_view.config.lock_aspect_ratio is True diff --git a/tests/unit_tests/test_multi_waveform_next_gen.py b/tests/unit_tests/test_multi_waveform_next_gen.py index b5375bef..9ce768c9 100644 --- a/tests/unit_tests/test_multi_waveform_next_gen.py +++ b/tests/unit_tests/test_multi_waveform_next_gen.py @@ -25,7 +25,7 @@ def test_multiwaveform_initialization(qtbot, mocked_client): assert len(mw.plot_item.curves) == 0 # Multiwaveform specific assert mw.monitor is None - assert mw.color_palette == "magma" + assert mw.color_palette == "plasma" assert mw.max_trace == 200 assert mw.flush_buffer is False assert mw.highlight_last_curve is True @@ -50,7 +50,7 @@ def test_multiwaveform_set_properties(qtbot, mocked_client): mw = create_widget(qtbot, MultiWaveform, client=mocked_client) # Default checks - assert mw.color_palette == "magma" + assert mw.color_palette == "plasma" assert mw.max_trace == 200 assert mw.flush_buffer is False assert mw.highlight_last_curve is True @@ -162,7 +162,7 @@ def test_multiwaveform_set_colormap(qtbot, mocked_client): mw.on_monitor_1d_update(msg_data, metadata={"scan_id": "scan_1"}) # Default color_palette is "magma" - assert mw.color_palette == "magma" + assert mw.color_palette == "plasma" # Now change to a new colormap mw.color_palette = "viridis" assert mw.color_palette == "viridis" diff --git a/tests/unit_tests/test_scatter_waveform.py b/tests/unit_tests/test_scatter_waveform.py index 951a1a08..8476ebe5 100644 --- a/tests/unit_tests/test_scatter_waveform.py +++ b/tests/unit_tests/test_scatter_waveform.py @@ -40,7 +40,7 @@ def test_scatter_waveform_plot(qtbot, mocked_client): def test_scatter_waveform_color_map(qtbot, mocked_client): swf = create_widget(qtbot, ScatterWaveform, client=mocked_client) - assert swf.color_map == "magma" + assert swf.color_map == "plasma" swf.color_map = "plasma" assert swf.color_map == "plasma" diff --git a/tests/unit_tests/test_waveform_next_gen.py b/tests/unit_tests/test_waveform_next_gen.py index 2aa934d7..bc8e5316 100644 --- a/tests/unit_tests/test_waveform_next_gen.py +++ b/tests/unit_tests/test_waveform_next_gen.py @@ -180,8 +180,8 @@ def test_color_palette_update(qtbot, mocked_client): curve = wf.plot(x=[1, 2, 3], y=[4, 5, 6], label="test_curve") original_color = curve.config.color # Change to a different valid palette - wf.color_palette = "plasma" - assert wf.config.color_palette == "plasma" + wf.color_palette = "magma" + assert wf.config.color_palette == "magma" # After updating the palette, the curve's color should be re-generated. assert curve.config.color != original_color