Public Access
fix return-value/deprecated API bugs, accumulation lock leaks, code cleanup
- 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/
This commit is contained in:
1 parent
91ade4376c
commit
f9d8de7697
26 files changed
+590
-236
No files matched your search
@@ -26,6 +26,7 @@ The data module contains result types, data handling, and signal processing clas
|
||||
|
||||
damaris.data.ADC_Result
|
||||
damaris.data.Accumulation
|
||||
damaris.data.Config_Result
|
||||
damaris.data.DamarisFFT
|
||||
damaris.data.DataPool
|
||||
damaris.data.Drawable
|
||||
@@ -71,6 +72,20 @@ The GUI module contains the graphical interface, backend driver, and experiment/
|
||||
damaris.gui.TemperatureMonitor
|
||||
damaris.gui.logging_utils
|
||||
|
||||
A short usage example for the font helper of the GUI module (the non-deprecated
|
||||
replacement for the removed ``Widget.modify_font()``):
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from damaris.gui.DamarisGUI import apply_font_css
|
||||
|
||||
apply_font_css(textview, "Monospace 10") # pango style font description
|
||||
apply_font_css(label, "sans bold 16")
|
||||
|
||||
The font string is converted into a CSS rule (``font-family``/``font-size``/
|
||||
``font-weight``) which is applied to the widget's style context with a
|
||||
``Gtk.CssProvider``.
|
||||
|
||||
|
||||
Tools Module
|
||||
============
|
||||
|
||||
@@ -313,6 +313,10 @@ The change is *in-place*, which means if the timesignal is needed later on, a co
|
||||
- **clip(start=**\ *None* **, stop=**\ *None* **)**
|
||||
Only the data between start and stop is returned.
|
||||
The start and stop parameters can be either in time or frequency domain.
|
||||
Calling **clip()** without any argument is a placeholder that leaves the
|
||||
object unchanged (useful in scripted processing chains). If only one bound
|
||||
is given, the missing one defaults to the first resp. last data point and
|
||||
reversed bounds (start > stop) are swapped automatically.
|
||||
|
||||
- **baseline(lastpart=**\ *0.1* **)**
|
||||
This method should be applied first as it corrects the baseline of the signal, taking the last part of the signal for determining the correction.
|
||||
@@ -374,6 +378,12 @@ To use this methods one has to apply consecutively the methods to an *timesignal
|
||||
This applies baseline correction using the last 40% of the timesignal for determination of the signal. Then, an exponential window is applied. From this timesignal an FFT is calculated which is further clipped to view to the data between -1 kHz with 1 kHz width.
|
||||
|
||||
|
||||
Operators and Copies of Data Objects
|
||||
====================================
|
||||
|
||||
The arithmetic operators (``+``, ``-``, ``*``, ``/``, ``//``, ``**``, unary ``-``) of **ADC_Result** and **Accumulation** objects return *new* objects: the operands are never modified and the data arrays of the result are independent copies, so later in-place operations (``+=``, ``*=``, ...) on the result cannot corrupt the operands. The channel metadata is carried over to the result: an **ADC_Result** result keeps the same ``get_nChannels()`` and ``is_clipped`` flag as its operand, and an **Accumulation** result keeps (and merges) the ``job_ids`` provenance of both operands. Adding an unsupported type or negating an empty accumulation raises a ``ValueError`` instead of silently returning *None*. In the same spirit, ``Config_Result(config=..., desc=...)`` stores the given dictionaries in the constructor, and ``measurementresult + 0`` returns an independent deep copy of the result object.
|
||||
|
||||
|
||||
Good Practices
|
||||
==============
|
||||
|
||||
|
||||
Reference in new issue
Block a user