From 42915bfe062cda06af338c657dda8e02b37ce3f0 Mon Sep 17 00:00:00 2001 From: Duy Anh Philippe PHAM Date: Fri, 17 Apr 2026 16:00:32 +0200 Subject: [PATCH 1/4] Fix: Sort Y values and use abs(delta) in YRangeCursorTool LABELFUNCS * [FIX] Sort ymin/ymax in range label to ensure correct inequality * [FIX] Use abs() for delta-y to prevent negative range width --- plotpy/tools/curve.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plotpy/tools/curve.py b/plotpy/tools/curve.py index 3285dcb..c92ea4a 100644 --- a/plotpy/tools/curve.py +++ b/plotpy/tools/curve.py @@ -212,8 +212,8 @@ class YRangeCursorTool(BaseRangeCursorTool): TITLE = _("Y-range") ICON = "yrange.png" LABELFUNCS: tuple[tuple[str, Callable[..., Any]], ...] = ( - ("%g < y < %g", lambda ymin, ymax: (ymin, ymax)), - ("∆y=%g", lambda ymin, ymax: ymax - ymin), + ("%g < y < %g", lambda ymin, ymax: (min(ymin, ymax), max(ymin, ymax))), + ("∆y=%g", lambda ymin, ymax: abs(ymax - ymin)), ) SHAPECLASS = YRangeSelection From 38d0e27346a74f581064787556e8c80e9a5810b0 Mon Sep 17 00:00:00 2001 From: Duy Anh Philippe PHAM Date: Mon, 18 May 2026 13:51:10 +0200 Subject: [PATCH 2/4] Fix plot nan values --- plotpy/tools/curve.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plotpy/tools/curve.py b/plotpy/tools/curve.py index c92ea4a..9ea68f8 100644 --- a/plotpy/tools/curve.py +++ b/plotpy/tools/curve.py @@ -142,13 +142,13 @@ class CurveStatsTool(BaseRangeCursorTool): TITLE = _("Signal statistics") ICON = "xrange.png" LABELFUNCS: tuple[tuple[str, Callable[..., Any]], ...] = ( - ("%g < x < %g", lambda *args: (args[0].min(), args[0].max())), - ("%g < y < %g", lambda *args: (args[1].min(), args[1].max())), - ("∆x=%g", lambda *args: args[0].max() - args[0].min()), - ("∆y=%g", lambda *args: args[1].max() - args[1].min()), - ("<y>=%g", lambda *args: args[1].mean()), - ("σ(y)=%g", lambda *args: args[1].std()), - ("∑(y)=%g", lambda *args: np.sum(args[1])), + ("%g < x < %g", lambda *args: (np.nanmin(args[0]), np.nanmax(args[0]))), + ("%g < y < %g", lambda *args: (np.nanmin(args[1]), np.nanmax(args[1]))), + ("∆x=%g", lambda *args: np.nanmax(args[0]) - np.nanmin(args[0])), + ("∆y=%g", lambda *args: np.nanmax(args[1]) - np.nanmin(args[1])), + ("<y>=%g", lambda *args: np.nanmean(args[1])), + ("σ(y)=%g", lambda *args: np.nanstd(args[1])), + ("∑(y)=%g", lambda *args: np.nansum(args[1])), ("∫ydx=%g", lambda *args: spt.trapezoid(args[1], args[0])), ) SHAPECLASS = XRangeSelection From 6fb84f439390cecb38581996a6d04894c77850d8 Mon Sep 17 00:00:00 2001 From: Thomas MALLET Date: Fri, 22 May 2026 15:01:49 +0200 Subject: [PATCH 3/4] fix linter warnings --- scripts/reinstall_dev.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/reinstall_dev.py b/scripts/reinstall_dev.py index 532477d..1ea0e6c 100644 --- a/scripts/reinstall_dev.py +++ b/scripts/reinstall_dev.py @@ -3,7 +3,8 @@ Reinstall multiple local libraries in editable mode for development. Workflow: - 1) Try to uninstall all target libraries in one command (ignore errors if some are not installed). + 1) Try to uninstall all target libraries in one command (ignore errors if some are + not installed). 2) Reinstall each library in editable mode from a sibling folder: ../. This script uses the same Python interpreter that runs it (sys.executable), From 51bca46b8d5c41c0bfa51b0983d2b7aff130afc3 Mon Sep 17 00:00:00 2001 From: Thomas MALLET Date: Fri, 22 May 2026 15:06:31 +0200 Subject: [PATCH 4/4] update translation --- plotpy/locale/fr/LC_MESSAGES/plotpy.po | 41 +++++++++++++++++++------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/plotpy/locale/fr/LC_MESSAGES/plotpy.po b/plotpy/locale/fr/LC_MESSAGES/plotpy.po index 97dd6c4..01b23a0 100644 --- a/plotpy/locale/fr/LC_MESSAGES/plotpy.po +++ b/plotpy/locale/fr/LC_MESSAGES/plotpy.po @@ -355,15 +355,15 @@ msgstr "Police des valeurs" msgid "Scale" msgstr "Échelle" +msgid "logarithmic" +msgstr "logarithmique" + msgid "linear" msgstr "linéaire" msgid "date/time" msgstr "date/heure" -msgid "logarithmic" -msgstr "logarithmique" - msgid "Lower axis limit" msgstr "Borne inférieure de l'axe" @@ -630,12 +630,12 @@ msgstr "Classes" msgid "Number of bins" msgstr "Nombre de classes" -msgid "Minimum value" -msgstr "Valeur minimale" - msgid "Min" msgstr "Min" +msgid "Minimum value" +msgstr "Valeur minimale" + msgid "Maximum value" msgstr "Valeur maximale" @@ -1422,12 +1422,11 @@ msgid "" "Keyboard/mouse shortcuts:

\n" " - single left-click: item (curve, image, ...) selection
\n" " - single right-click: context-menu relative to selected item
\n" -" - shift: on-active-curve (or image) cursor (+ control to maintain\n" -"cursor visible)
\n" -" - shift + control: on-active-curve cursor (+ control to maintain\n" -"cursor visible)
\n" +" - shift: on-active-curve (or image) cursor
\n" +" - shift + control: on-active-curve cursor (maintained visible)
\n" " - alt: free cursor
\n" " - left-click + mouse move: move item (when available)
\n" +" - control + left-click + mouse move: move label on markers and range selections
\n" " - middle-click + mouse move: pan
\n" " - right-click + mouse move: zoom" msgstr "" @@ -1687,3 +1686,25 @@ msgstr "Rotation et rognage" msgid "Show cropping rectangle" msgstr "Afficher le rectangle de rognage" +msgid "" +"Keyboard/mouse shortcuts:

\n" +" - single left-click: item (curve, image, ...) selection
\n" +" - single right-click: context-menu relative to selected item
\n" +" - shift: on-active-curve (or image) cursor (+ control to maintain\n" +"cursor visible)
\n" +" - shift + control: on-active-curve cursor (+ control to maintain\n" +"cursor visible)
\n" +" - alt: free cursor
\n" +" - left-click + mouse move: move item (when available)
\n" +" - middle-click + mouse move: pan
\n" +" - right-click + mouse move: zoom" +msgstr "" +"Raccourcis clavier et souris :

\n" +" - clique gauche : sélection d'un objet (courbe, image, ...)
\n" +" - clique droit : menu contextuel relatif à l'objet sélectionné
\n" +" - shift : curseur sur la courbe (ou l'image) active (+ control pour maintenir le curseur visible)
\n" +" - shift + control : curseur sur la courbe (ou l'image) active (+ control pour maintenir le curseur visible)
\n" +" - alt : curseur libre
\n" +" - clique gauche + déplacement souris : déplacement de l'objet actif (si possible)
\n" +" - clique du milieu + déplacement souris : translation dans le plan ('pan')
\n" +" - clique droit + déplacement souris : agrandissement ('zoom')"