Commit Graph
21 Commits
Author SHA1 Message Date
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 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 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 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 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 ddb3f00abb fixed inconsistencies in returned objects: missing channels, is_clipped
Build Debian Packages / build (bookworm, debian12) (push) Failing after 8s
Build Debian Packages / build (trixie, debian13) (push) Canceled after 8s
2026-10-01 21:10:49 +02:00
markusro acd3352967 added profiling examplef or synchronize()
Build Debian Packages / build (trixie, debian13) (push) Successful in 13m40s
Build Debian Packages / build (bookworm, debian12) (push) Successful in 13m51s
2026-07-13 23:58:12 +02:00
markusro 34bbd68894 miniscule changes 2026-07-13 13:03:35 +02:00
markusro 064036241b small fixes 2026-07-09 14:45:25 +02:00
markusro b46debad69 Fixed #13 and #14
Build Debian Packages / build (trixie, debian13) (push) Successful in 14m2s
Build Debian Packages / build (bookworm, debian12) (push) Successful in 14m11s
Build Debian Packages / build (bullseye, debian11) (push) Has been cancelled
2026-07-05 14:07:57 +02:00
markusro d3b1a9e3fd Show message if ADC_Data is clipped (solves #16)
Build Debian Packages / build (bookworm, debian12) (push) Successful in 14m38s
Build Debian Packages / build (trixie, debian13) (push) Successful in 14m40s
Build Debian Packages / build (bullseye, debian11) (push) Has been cancelled
2026-07-05 13:44:20 +02:00
markusro efb15606c6 These were not too critical errors as we normal only do + and -
Build Debian Packages / build (trixie, debian13) (push) Successful in 13m14s
Build Debian Packages / build (bookworm, debian12) (push) Successful in 13m23s
Build Debian Packages / build (bullseye, debian11) (push) Has been cancelled
operations in the experiments.

- Identified and fixed multiple logic and syntax errors in the `Accumulation` class similar to those recently found in `ADC_Result`.
- Implemented missing arithmetic operators (`*`, `/`, `//`) and their inplace/reverse counterparts for the `Accumulation` class.
- Verified that all arithmetic operations correctly maintain statistical data (sum of squares) where mathematically possible.
2026-07-04 16:26:56 +02:00
markusro 27466fe2d6 cleanup build scripts
Build Debian Packages / build (bookworm, debian12) (push) Failing after 7m30s
Build Debian Packages / build (bullseye, debian11) (push) Failing after 6m22s
Build Debian Packages / build (trixie, debian13) (push) Failing after 8m42s
2026-03-23 14:59:00 +01:00
markusro 5e37c1baa3 clean up tests and folders
Build Debian Packages / build (bookworm, debian12) (push) Successful in 7m27s
Build Debian Packages / build (bullseye, debian11) (push) Successful in 7m2s
Build Debian Packages / build (trixie, debian13) (push) Successful in 8m49s
2026-03-20 16:47:53 +01:00
markusro 17766b7b65 directory cleanup
Build Debian Packages / build (bookworm, debian12) (push) Successful in 7m17s
Build Debian Packages / build (bullseye, debian11) (push) Successful in 6m53s
Build Debian Packages / build (trixie, debian13) (push) Failing after 7m33s
2026-03-16 16:09:41 +01:00
markusro 1f9b78afac fixed matplotlib (3.10) error in trixie 2026-03-16 14:22:04 +01:00
Markus Rosenstihl 28e6c9d1a0 * Make it work in bookworm, redid some of the changes from last commit
* Changed default number types to int16 for ADC_Result and float32 for
  Accumulations
2026-03-09 10:55:55 +01:00
Markus Rosenstihl 13431cab41 python3-damaris from Joachim Beerwerth 2025-04-25 14:57:52 +02:00