Recrystallizations - fix allow for different shot nb per datapoint#101
Draft
FlorenceBerterottiere wants to merge 49 commits into
Draft
Recrystallizations - fix allow for different shot nb per datapoint#101FlorenceBerterottiere wants to merge 49 commits into
FlorenceBerterottiere wants to merge 49 commits into
Conversation
…iment (if exists)
This replaces the filelock mechanism by the hdf5 builtin lock mechanism
…nect to the client via a notebook
…und when exactly one was required'
…tale' into test/icon_scripting
…er server parameters
… called over and over again
…d over and over again
… into test/fitting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds server-side control of the 32 Zedboard FPGA TTL output channels. Each channel can be set to OFF (forced LOW), ON (forced HIGH), or CONTROL (pulse-sequence driven) using the ttlMasks / setTTLMasks RPC calls. Mask state is persisted to SQLite so it survives hardware power cycles. Changes: - TTLController (pydase.DataService) registered on APIService as .ttl - TTLRepository + ttl_mask_states SQLite table (alembic migration) - HardwareController.get_ttl_masks() / set_ttl_masks() wrappers - HardwareConfig.n_ttl_channels config field (default 32) - 19 unit tests covering mask encode/decode and controller logic - docs/ttl_server_implementation.md design reference Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…utton UX Adds a dedicated /ttl page with 32-channel grid. Each channel mirrors ionizer's ControlButton (blue=FPGA, grey=manual) + StateButton (green=ON, red=OFF) layout. StateButton retains its value when in CONTROL mode and applies it on switch-back, matching ionizer behaviour exactly. Also adds server-side label persistence (TTLController.get_labels/set_label, labels column on ttl_mask_states via migration b2c3d4e5f6a1). Labels are editable inline via double-click and persisted to SQLite. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Points down_revision to the actual HEAD of main's migration chain instead of the branching point fc9af856df20. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…retaken by recrystallizations
useMemo in HistogramPlot depended on categories/seriesData computed outside it, so new object references on every render meant the memo never skipped. Move all computation inside the memo and filter NaN values from shot arrays (padding added when recrystallized shot count exceeds the HDF5 dataset width). Also remove three references to ExperimentDataRepository.LOCK_EXTENSION in standalone fit functions that were missed when the attribute was deleted in the h5_open refactor. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two separate O(N * data_points) operations ran on every incoming data point, causing the browser to freeze progressively: 1. HistogramPlot searched for the latest shot array by iterating all accumulated data-point keys on every update. Track latestShotData (Record<channel, number[]>) in useExperimentData instead and pass it directly to HistogramPlot, making the histogram O(N_shots) regardless of how many points have been collected. 2. autoYBounds in JobView iterated every result-channel value on every update (unbounded scan). Track resultBounds incrementally in the hook so the windowSize=null case is O(1) per update; the windowed case scans only the last windowSize points (bounded). Also replace O(N) Object.values(firstChannel).length with total_data_points for the dataLength lookup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Points in a centred scan arrive in centre-out order. ECharts draws lines connecting data points in array order, causing zigzag artefacts. Sort fullDataSet (and per-repetition repData) by x-value after building them in buildResultChannelChartSeries, and apply the same sort in the windowed live-display path in ResultChannelPlot. As a side-effect this also makes the lttb downsampling algorithm work correctly, since it assumes x-ordered data. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e so as to have always the max contrast for 2D scans
…an mode, where the center value is the previously calibrated value and the span is provided by the user
Adds a `timeout` field to `HardwareConfig` (default 5 s) and threads it through to the hardware controller connection, preventing indefinite hangs when the instrument is unreachable. Also silences the pycrystal library logger to ERROR to reduce noise. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows us to run with different numbers of shots for each datapoints (some shots are retaken, if a recrystallization occurs). Fix is in commit f066f3b, the rest are other commits to be able to run it with fitting + recent fixes + TTL.