Skip to content

Commit ff86be3

Browse files
committed
Squashed commit of the following:
commit adb8d1dc2b07764dfe5ee35e3bf5e96fcda03d7f Author: vld-codra <v.ledu@codra.fr> Date: Thu Jan 4 17:25:41 2024 +0100 small_tool_changes commit 67bc40b2e17426ff69c0622c2d6501e4b753ed7e Author: vld-codra <v.ledu@codra.fr> Date: Fri Dec 29 16:28:33 2023 +0100 new icons and small fixes commit 92398fca19efd89c7204ee5d67fcc948176986cf Author: vld-codra <v.ledu@codra.fr> Date: Fri Dec 29 11:20:17 2023 +0100 Squashed commit of the following: commit 2acc393c5087961ef5627293ed7549580f1969c5 Author: vld-codra <v.ledu@codra.fr> Date: Fri Dec 29 11:17:17 2023 +0100 edit point tool commit dceec0513f95316d3c3ac6cf6f83a92c720ad8fa Author: vld-codra <v.ledu@codra.fr> Date: Thu Dec 21 18:05:41 2023 +0100 remove file after name change commit cd11fe68c28aeaf0773b6bc9084e889b45f401e0 Author: vld-codra <v.ledu@codra.fr> Date: Thu Dec 21 18:05:10 2023 +0100 Numerous updates, still work in progress commit c8c6f47406cd1aca9364d287b13d4999ad0714b3 Author: vld-codra <v.ledu@codra.fr> Date: Mon Dec 18 16:17:26 2023 +0100 basic imlementation of curve decimation commit 72f293f87cfe3f9730f6a3d6b22c03aa91807c09 Author: vld-codra <v.ledu@codra.fr> Date: Mon Dec 18 14:34:12 2023 +0100 reduce number of points for editing points commit 6b06799b1b1706049aacf45d04efd7c52ef19769 Author: vld-codra <v.ledu@codra.fr> Date: Mon Dec 18 14:26:49 2023 +0100 new edit point tool
1 parent 4fe5af9 commit ff86be3

11 files changed

Lines changed: 21 additions & 10 deletions

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@
3838
"plotpy"
3939
],
4040
"python.analysis.autoFormatStrings": true,
41+
"python.analysis.typeCheckingMode": "basic",
4142
}

plotpy/images/curve_downsample.png

435 Bytes
Loading
758 Bytes
Loading
555 Bytes
Loading
793 Bytes
Loading
508 Bytes
Loading
729 Bytes
Loading

plotpy/styles/curve.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class CurveParam(DataSet):
5050
# )
5151
downsampling_factor = IntItem(_("Downsampling factor"), default=10, min=1)
5252

53-
def update_param(self, curve: CurveItem):
53+
def update_param(self, curve: CurveItem | PolygonMapItem):
5454
"""
5555
5656
:param curve:
@@ -66,6 +66,8 @@ def update_item(self, curve: CurveItem | PolygonMapItem):
6666
6767
:param curve:
6868
"""
69+
curve.update_data()
70+
6971
plot = curve.plot()
7072
if plot is not None:
7173
plot.blockSignals(True) # Avoid unwanted calls of update_param

plotpy/tests/unit/test_baseplot.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from plotpy.tests import vistools as ptv
1717
from plotpy.tests.features.test_auto_curve_image import make_curve_image_legend
18-
from plotpy.tools.curve import EditPointTool
18+
from plotpy.tools.curve import DownSampleCurveTool, EditPointTool, SelectPointsTool
1919

2020

2121
def test_baseplot_api():
@@ -24,8 +24,13 @@ def test_baseplot_api():
2424
items = make_curve_image_legend()
2525
win = ptv.show_items(items, wintitle=test_baseplot_api.__doc__)
2626
plot = win.get_plot()
27+
plot.manager.add_tool(SelectPointsTool)
2728
plot.manager.add_tool(EditPointTool)
29+
plot.manager.add_tool(DownSampleCurveTool) # noqa: F821
2830
plot.get_default_item()
31+
plot.manager.add_tool(SelectPointsTool)
32+
plot.manager.add_tool(EditPointTool)
33+
plot.manager.add_tool(DownsampleCurveTool)
2934
title = "Test title"
3035
plot.set_title(title)
3136
assert plot.get_title() == title

plotpy/tools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from .curve import (
3535
AntiAliasingTool,
3636
CurveStatsTool,
37-
DownsampleCurveTool,
37+
DownSampleCurveTool,
3838
EditPointTool,
3939
SelectPointsTool,
4040
SelectPointTool,

0 commit comments

Comments
 (0)