195 Commits
Author SHA1 Message Date
markusro 42a4f9e2b9 Release v0.32
Build Debian Packages / build (bookworm, debian12) (push) Successful in 11m50s
Build Debian Packages / build (trixie, debian13) (push) Successful in 12m24s
v0.32
2026-10-22 16:52:02 +02:00
markusro ed5ddde2e3 fix removal of plot artists: Axes.lines/collections are read-only ArtistLists since matplotlib 3.5 2026-10-22 16:51:20 +02:00
markusro 959f17ee33 Release v0.31
Build Debian Packages / build (bookworm, debian12) (push) Successful in 26m15s
Build Debian Packages / build (trixie, debian13) (push) Successful in 26m41s
v0.31
2026-10-22 01:01:18 +02:00
markusro 63da240504 crosshair and pan toolbar buttons are mutually exclusive 2026-10-22 00:54:21 +02:00
markusro 9d60eeabf6 added phasng for signal 2026-10-22 00:17:01 +02:00
markusro 12d7323851 added persistent ADC overflow warning 2026-10-21 22:48:46 +02:00
markusro dcf3ec0f2d Release v0.30
Build Debian Packages / build (bookworm, debian12) (push) Successful in 19m5s
Build Debian Packages / build (trixie, debian13) (push) Successful in 21m11s
v0.30
2026-10-21 00:52:30 +02:00
markusro 03e1155ae1 ignoring kilo and podman folders 2026-10-21 00:50:25 +02:00
markusro dda8ae7df0 script for release added, pyrefly checks are fixed for now 2026-10-21 00:48:06 +02:00
markusro 428af30c30 expanded features in res_test.py 2026-10-21 00:21:39 +02:00
markusroandJunie f9fa03e312 Fix Sphinx documentation warnings
Co-authored-by: Junie <junie@jetbrains.com>
2026-10-21 00:18:58 +02:00
markusro 0e796a800b Replace temperature monitoring with proxy history 2026-10-21 00:08:26 +02:00
markusro bd060dc4d0 create base class MeasurementData for ADC_Result and Accumulation 2026-10-20 23:21:43 +02:00
markusro 5a18e48c2d New functions: get_mean and get_phase, added better documentation 2026-10-20 22:48:30 +02:00
markusro 9111e546e0 fixes and new tag 2026-10-19 23:22:11 +02:00
markusro 7164531351 add toolbar-free mouse panning and zooming to the plot
Build Debian Packages / build (bookworm, debian12) (push) Successful in 11m52s
Build Debian Packages / build (trixie, debian13) (push) Successful in 12m3s
Connect matplotlib event handlers on the plot canvas so the display
can be navigated without engaging the toolbar modes: left button
drag pans the view, the mouse wheel zooms both axes around the
pointer, and right button drag zooms single axes (horizontal motion
zooms x, vertical motion zooms y, like the right button in the
toolbar pan mode). Linear (including inverted ppm) and logarithmic
axes are handled, the latter in log space. While a toolbar pan/zoom
mode is active the handlers stand back so the toolbar behavior is
unchanged. Documented in doc/manual.rst.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
v0.28 v0.29
2026-10-19 23:16:43 +02:00
markusro 1bed381639 add toolbar buttons copying the plot as PNG and SVG to the clipboard
Two new buttons below the plot copy the current figure to the
clipboard. The PNG copy renders off-screen on a temporary Agg canvas
at a fixed 12:8 inches and 800 px width, independent of the window
size, and restores figure canvas, size and dpi afterwards so the
on-screen plot is untouched. The RGBA buffer is wrapped in GLib.Bytes
for GdkPixbuf.Pixbuf.new_from_bytes, which current PyGObject requires
(fixes the 'Expected GLib.Bytes, but got bytes' error). The SVG copy
keeps using savefig into a text buffer; both report through logger.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-10-19 23:16:34 +02:00
markusro 0135f9b7a3 route the unknown-data-type message through the logger
save_display_data_as_text printed via the removed log() helper;
use logger.warning instead so the message lands in the log window.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-10-19 23:16:26 +02:00
markusro 0135504de2 remove the canvas context menu
The middle-click context menu (crosshair toggle, copy as PNG/SVG)
duplicated functionality that is now reachable elsewhere: the
crosshair is toggled by its own toolbar button and the PNG/SVG
clipboard copies get dedicated toolbar buttons. Removing it frees the
middle mouse button on the plot canvas.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-10-19 23:16:22 +02:00
markusro d539a27423 ignore duplicate quit events when the window is closed twice
quit_event ran its cleanup path again when a second delete-event
arrived after the state had already switched to Quit_State, hanging
the application on shutdown. Return early instead.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-10-19 23:16:14 +02:00
markusro 34eb7b2728 cap matplotlib canvas at logical resolution for fast HiDPI rendering
The stock GTK3Agg canvas renders one buffer pixel per physical pixel,
so on a scaled (HiDPI) screen every full redraw rasterizes four times
the pixel count, which makes the interactive plot sluggish. Override
_update_device_pixel_ratio in BlitSafeCanvas to pin the device pixel
ratio at 1: the plot renders at logical resolution and the window
system scales the output up. Measured ~2.3x faster full redraws on a
2x-scaled screen; non-scaled screens are unaffected.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-10-19 23:15:30 +02:00
markusro e5e1a111d8 added release upload to workflow
Build Debian Packages / build (bookworm, debian12) (push) Successful in 9m9s
Build Debian Packages / build (trixie, debian13) (push) Successful in 9m14s
v0.25 0.25
2026-10-18 19:36:21 +02:00
markusro 458715c19a bump version to 0.25 and add changelog entry
Build Debian Packages / build (bookworm, debian12) (push) Successful in 9m44s
Build Debian Packages / build (trixie, debian13) (push) Successful in 9m49s
2026-10-18 19:13:47 +02:00
markusro 18e085d3ee make the crosshair cursor fast on HiDPI screens with dirty-strip blitting
The previous blit path converted the whole axes bbox (several megapixels
on HiDPI displays) from RGBA to premultiplied ARGB on every motion
event, costing about 84 ms per frame on a maximized window. Per frame
now only the thin strips around the old and new line positions are
erased from a cached full-figure background, redrawn and blitted,
which brings the frame cost below 1 ms.

- BlitSafeCanvas paints blitted regions immediately instead of queueing
  them, which kept regular paints partial and wiped the axis labels
- CrosshairCursor coalesces motion events to 60 fps and erases strips
  by direct numpy copy from the background; matplotlib's restore_region
  with a bbox argument addresses a different coordinate frame and
  restores the wrong area, so it is avoided
- after a full render the old line positions are blitted right away,
  otherwise motion events processed before the pending repaint drew the
  cursor at its new position next to the stale one on screen
- clear_display recreates the crosshair so it survives plot switches

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-10-18 19:10:17 +02:00
markusro fe65073988 draw the crosshair toolbar icon from inline XPM data
The crosshair toggle button loaded the "crosshairs" icon from the
icon theme inside a bare try/except, so on systems without that
icon the button was empty and invisible. Replace it with a
self-contained red reticle (circle, center dot, cross arms) drawn
from inline XPM data, and set always-show-image so the desktop
default gtk-button-images=False cannot hide it.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-10-18 17:47:59 +02:00
markusro 9cc449d6e1 build HTML docs at package build time and open them from the Help menu
Build Debian Packages / build (bookworm, debian12) (push) Successful in 8m30s
Build Debian Packages / build (trixie, debian13) (push) Successful in 9m14s
- debian/rules: build sphinx HTML into build/html
- debian/install: install it as usr/share/doc/python3-damaris/html/
  instead of shipping the raw doc/ source tree (whose gitignored
  doc/_build never existed on CI checkouts)
- debian/control: declare ${sphinxdoc:Depends} and python3-sphinx
  (provides sphinx-build) explicitly
- requirements.debian: install python3-sphinx explicitly
- DamarisGUI: point the manual at the packaged HTML path with a
  source-tree fallback, populate the Help dropdown menu, and open
  the DAMARIS manual on a plain toolbar click
- doc/manual.rst: document the Help menu

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-10-18 17:20:33 +02:00
markusro ab943c30ae add FitResult fit overlays and close leaked HDF5 files after experiment stop
Build Debian Packages / build (bookworm, debian12) (push) Successful in 8m50s
Build Debian Packages / build (trixie, debian13) (push) Successful in 8m55s
FitResult is a new Drawable in damaris.data with x-values independent of
the measured points, so fits can be sampled on a dense grid. It is stored
as its own data pool entry (e.g. "measurement/fit"), written to and read
from the HDF5 data pool (damaris_type "FitResult", params as attributes),
and drawn by the GUI as overlay on its measurement, including a fit
parameter text box. Fits get no entry in the display tree, so measurement
rows stay directly selectable. Result scripts create them via
FitResult(x, y, title, source, params).

Additionally, HDF5 files that experiment or result scripts left open
(e.g. after a script failure) are closed when the experiment stops.
pytables keeps such handles registered process-wide, which blocked
reopening the dump file and the scripts' own files on the next run.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-10-18 17:11:05 +02:00
markusro 947c4c7f8d normalize list/array handling in data classes
Establish one invariant across the Drawable hierarchy: x is always a
numpy ndarray, y is always a list of per-channel ndarrays, and empty
data is the same types with zero length.

- Drawable: x starts as empty ndarray; min/max helpers return 0 on
  empty data instead of raising; drop contradictory isinstance(self.y,
  list) branches
- ADC_Result/Accumulation: empty constructors build ndarray x; full
  constructors coerce x/y/y_square with numpy.asarray; Accumulation
  get_ydata/get_yerr return empty ndarrays and no longer crash on
  empty statistics-less accumulations
- MeasurementResult: fix get_lineplotdata to return the accumulated
  means (previously the never-populated self.y, so the GUI line plot
  could never draw); remove dead float/int branches in CSV and HDF
  writers
- Error_Result: get_xdata/get_ydata return ndarrays

Add unittest coverage for the invariant, empty-state accessors,
constructor coercion, line plot data, CSV output and HDF round-trip.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-10-18 16:38:41 +02:00
markusro 35d040426b fix startup: register GtkSourceView GType for GtkBuilder
Removing gobject.type_register(GtkSource.View) broke startup: the
call was load-bearing, it forced registration of the GtkSourceView
GType so GtkBuilder could resolve the type in damaris3.glade
("Invalid object type 'GtkSourceView'"). Restore the registration
by referencing gtksourceview.View at import time, which is the
same effect without the PyGTK compat API.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-10-18 16:25:51 +02:00
markusro f18bbdf48c replace gtk2/PyGTK and Python 2 idioms in DamarisGUI.py
- raise "RuntimeError" -> raise RuntimeError(...)
- gobject.timeout_add/idle_add/PRIORITY_* -> GLib equivalents
  (PyGIDeprecationWarning)
- remove no-op gobject.type_register(GtkSource.View)
- gtk.HBox -> gtk.Box(orientation=HORIZONTAL) (deprecated since 3.2)
- menu.popup(6-arg) -> menu.popup_at_pointer (deprecated since 3.22)
- Thread.getName() -> Thread.name (deprecated since 3.10)
- rename gtksourceview2 alias to gtksourceview
- rename bare iter locals/params to treeiter to avoid shadowing
  the builtin

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-10-18 16:24:59 +02:00
markusro 6d46e8ca1a fixed bug with counter updates
Build Debian Packages / build (bookworm, debian12) (push) Successful in 8m52s
Build Debian Packages / build (trixie, debian13) (push) Successful in 9m1s
2026-10-18 15:36:04 +02:00
markusro 6987ee31b7 added instructions for version bump
Build Debian Packages / build (bookworm, debian12) (push) Successful in 9m36s
Build Debian Packages / build (trixie, debian13) (push) Successful in 9m39s
2026-10-18 15:13:36 +02:00
markusro 804996cbd4 fix time_period latent crashes: treat missing time information as None
time_period is list[datetime] | None at runtime (None from old-format
HDF5 files, [] from the constructor), but several sites subscripted
it unguarded and crashed with TypeError/IndexError.

- annotate time_period as list[datetime.datetime] | None
- copy paths (get_accu_by_index, __iadd__ self-empty) use the guarded
  pattern already present in _copy_provenance
- merges in __add__/__iadd__ only combine min/max when both sides carry
  time information; otherwise the result is None (provenance unknown)
- write_to_tecmag raises ValueError when no time information is
  available instead of crashing while writing the header

Clears all remaining time_period pyrefly errors (72 -> 63). Unit tests
reproduce the crashes and pass with the fix.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-10-18 15:12:57 +02:00
markusro 27d05496ab fix y_square latent bug: keep it always a list of per-channel arrays
Accumulation.__neg__ passed y_2 = numpy.array(self.y_square), storing a
2D ndarray. A later __iadd__ on an accumulation with ndarray y_square
crashed with AttributeError at the y_square.append sites (992, 1064).

- __neg__ now passes a per-channel copy (values unchanged: sums of
  squares are invariant under negation)
- __init__ normalizes ndarray y_2 to a list, so external callers cannot
  reintroduce the bug
- y_square annotated as _YChannels

Clears the remaining pyrefly errors at Accumulation.py:992 and :1064
(74 -> 72). Unit tests reproduce both crashes and pass with the fix.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-10-18 15:11:58 +02:00
markusro c797aeb387 add type hints to data classes and fix get_ydata override conflict
- signature-only type hints for ADC_Result, MeasurementResult,
  Accumulation, and the Drawable base class (x: ndarray | list, y: list)
- get_ydata now takes channel: int = 0 across the hierarchy
  (Drawable, Accumulation, MeasurementResult, Error_Result), fixing
  the LSP violation flagged by pyrefly
- widen _XArray alias to ndarray | list: internal copy constructors
  pass self.x[:] which is that union
- add hinted files to pyrefly project-includes

pyrefly errors in the covered files drop from 102 to 74; the rest is
PyTables stub noise and pre-existing latent bugs left for separate fixes.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-10-18 15:09:57 +02:00
markusro e5472484cb fixed non workign stop button
Build Debian Packages / build (bookworm, debian12) (push) Successful in 9m16s
Build Debian Packages / build (trixie, debian13) (push) Successful in 9m16s
2026-10-18 14:25:31 +02:00
markusro f450075d24 bump version to 0.24, add changelog entry and publish-process docs
Build Debian Packages / build (bookworm, debian12) (push) Successful in 8m50s
Build Debian Packages / build (trixie, debian13) (push) Successful in 9m0s
2026-10-18 11:41:25 +02:00
markusro 0ca78cc566 snapshot log text on GTK main thread before HDF5 dump 2026-10-18 11:27:16 +02:00
markusro da1dc4a088 fix log dump race and unclosed HDF5 data pool file in DamarisGUI 2026-10-18 11:11:14 +02:00
markusro efb01250c8 add type hints to Experiment.py and dac.py, set up pyrefly as dev dependency
Build Debian Packages / build (bookworm, debian12) (push) Successful in 9m3s
Build Debian Packages / build (trixie, debian13) (push) Successful in 9m9s
2026-10-17 21:52:10 +02:00
markusro f9d8de7697 fix return-value/deprecated API bugs, accumulation lock leaks, code cleanup
Build Debian Packages / build (bookworm, debian12) (push) Successful in 8m56s
Build Debian Packages / build (trixie, debian13) (push) Successful in 9m3s
- raise instead of silent None for unsupported operands and empty negation
- validate before acquiring lock in Accumulation operators (no RLock leak)
- Accumulation._copy_provenance helper, ADC_Result._copy_metadata for all result paths
- shared _sandbox_stdout_redirect contextmanager for sandboxed scripts
- TemperatureMonitor dead code removal (gtk helper, traceback, unused properties)
- new unit tests incl. lock-freedom regression test
- gitignore sphinx generated doc/_autosummary/ and doc/damaris/
2026-10-17 19:17:43 +02:00
markusro 91ade4376c Merge branch 'main' of gitea.pkm.physik.tu-darmstadt.de:IPKM/python3-damaris 2026-10-16 22:37:51 +02:00
markusro c9af33bff0 preciser AGENTS.md 2026-10-16 22:36:08 +02:00
markusro 8d7d241ec7 fix Signalpath.phase(): do not modify original data in place
Build Debian Packages / build (bookworm, debian12) (push) Successful in 10m7s
Build Debian Packages / build (trixie, debian13) (push) Successful in 10m19s
phase() overwrote the underlying channel arrays (y[i] *= -1) and returned
self, so rotated copies aliased the original object and negative phase
angles garbled shared data. It now returns a copy with new arrays and
uses numpy.deg2rad for arbitrary angles.
Add unittests for phase() including negative angles and non-mutation.
2026-10-16 11:21:10 +02:00
markusro e963c2ef3c fix #43 Signalpath does not return object when phase=0
Build Debian Packages / build (trixie, debian13) (push) Successful in 10m25s
Build Debian Packages / build (bookworm, debian12) (push) Successful in 10m26s
2026-10-15 17:00:31 +02:00
markusro bafbc1b1a0 nodte for developers
Build Debian Packages / build (bookworm, debian12) (push) Successful in 9m58s
Build Debian Packages / build (trixie, debian13) (push) Successful in 10m30s
2026-10-02 11:33:02 +02:00
markusro cb5752d20c Add user plugin directory to Python path 2026-10-02 11:31:42 +02:00
markusro 227ddda684 merge upstream
Build Debian Packages / build (bookworm, debian12) (push) Failing after 7s
Build Debian Packages / build (trixie, debian13) (push) Canceled after 7s
Merge branch 'main' of gitea.pkm.physik.tu-darmstadt.de:IPKM/python3-damaris
2026-10-02 11:27:38 +02:00
markusro 6d598e9da9 added LICENSE 2026-10-02 11:26:23 +02:00
markusro d8d7b9853a Added AGENTS.md
Build Debian Packages / build (bookworm, debian12) (push) Failing after 7s
Build Debian Packages / build (trixie, debian13) (push) Canceled after 8s
2026-10-01 21:54:29 +02:00