Skip to content

Commit 5e67d0e

Browse files
committed
typing, merge fixes, activable downsampling item, remove print logging
1 parent ff86be3 commit 5e67d0e

6 files changed

Lines changed: 7 additions & 11 deletions

File tree

plotpy/items/image/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ def set_color_map(self, name_or_table: str | CustomQwtLinearColormap) -> None:
421421
Args:
422422
name_or_table: Colormap name or colormap
423423
"""
424-
print(f"set_color_map to {name_or_table=}")
425424
if name_or_table is self.cmap_table:
426425
# This avoids rebuilding the LUT all the time
427426
return

plotpy/styles/curve.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ class CurveParam(DataSet):
4545
use_downsampling = BoolItem(_("Use downsampling"), default=False).set_prop(
4646
"display", store=_downsampling_prop
4747
)
48-
# downsampling_factor = IntItem(_("Downsampling factor"), default=10, min=1).set_prop(
49-
# "display", active=GetAttrProp(_downsampling_prop)
50-
# )
51-
downsampling_factor = IntItem(_("Downsampling factor"), default=10, min=1)
48+
downsampling_factor = IntItem(_("Downsampling factor"), default=10, min=1).set_prop(
49+
"display", active=_downsampling_prop
50+
)
5251

5352
def update_param(self, curve: CurveItem | PolygonMapItem):
5453
"""

plotpy/tests/unit/test_baseplot.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ def test_baseplot_api():
2828
plot.manager.add_tool(EditPointTool)
2929
plot.manager.add_tool(DownSampleCurveTool) # noqa: F821
3030
plot.get_default_item()
31-
plot.manager.add_tool(SelectPointsTool)
32-
plot.manager.add_tool(EditPointTool)
33-
plot.manager.add_tool(DownsampleCurveTool)
3431
title = "Test title"
3532
plot.set_title(title)
3633
assert plot.get_title() == title

plotpy/tools/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self, manager, toolbar_id=DefaultToolbarID):
2727

2828
# pylint: disable=assignment-from-none
2929
self.action = self.create_action(manager)
30-
self.menu = self.create_action_menu(manager)
30+
self.menu: QW.QMenu | None = self.create_action_menu(manager)
3131

3232
if self.menu is not None:
3333
self.action.setMenu(self.menu)

plotpy/tools/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def __init__(self, manager, toolbar_id=DefaultToolbarID):
363363
self.default_icon = build_icon_from_cmap_name(self._active_colormap)
364364
self.action.setIcon(self.default_icon)
365365

366-
def create_action_menu(self, manager):
366+
def create_action_menu(self, manager) -> QW.QMenu:
367367
"""Create and return menu for the tool's action"""
368368
menu = QW.QMenu()
369369

plotpy/widgets/colormap_manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ def close(self):
237237
)
238238
if save:
239239
self.cmap_manager.saveColormap()
240-
super().close()
240+
if self.cmap_manager._changes_saved:
241+
super().close()
241242

242243
def show(self) -> None:
243244
return super().show()

0 commit comments

Comments
 (0)