feat(replay): Tiled replay + config robustness (sockets, polling, auto-detect)#47
Merged
Merged
Conversation
…o-detect) Replay/config tooling improvements from #37 (all verified to apply cleanly — main's replay/config history is fully contained in #37): datasource.py: - Cap ZMQ reconnect backoff at RECONNECT_IVL_MAX=1s on EigerZmqRxOp and PositionRxOp, so a SUB started before its publisher binds reconnects within ~1s instead of waiting minutes (pairs with replay --no-hp-start). replay_from_tiled.py: - publish_eiger accepts a prebound_socket so the caller can bind the PUB before the pipeline starts (SUB connects during compose()), and only closes sockets it owns. - _wait_for_pipeline_ready polls /status before publishing in --no-hp-start. - iter_frame_chunks default n_workers 16 -> 4 with exponential-backoff retry on httpx PoolTimeout; new --tiled-workers flag. config_from_tiled.py: - Auto-detect panda_upsample (encoder/frame shape ratio) and vit_normalization (max raw intensity, hot pixels excluded) — the latter via ptychoml.compute_intensity_normalization instead of an inline mask+max (behavior-equivalent; ValueError on all-hot maps to the prior warning path). - New CLI args: --patch-flip, --min-overlap-count, --overshoot-factor, --x/--y-direction. Dev-tooling socket/HTTP/Tiled robustness — not unit-testable in CI without a live Tiled server + ZMQ pipeline; faithfully reproduces #37 (clean apply, ancestry-verified) and the normalization reuse is ptychoml-tested. Suite passes (95, modulo the 2 pre-existing TILED smoke imports). H6b of the #37 decomposition. Co-authored-by: Himanshu Goel <4122621+himanshugoel2797@users.noreply.github.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.
H6b of the #37 decomposition — replay/config tooling robustness. All three files' main history is fully contained in #37 (
merge-base --is-ancestorconfirmed), so #37's changes apply cleanly on top — no main-only work lost.datasource.pyRECONNECT_IVL_MAX=1s) onEigerZmqRxOp+PositionRxOp, so a SUB started before its publisher binds reconnects within ~1s instead of waiting minutes (pairs withreplay --no-hp-start).replay_from_tiled.pypublish_eigeraccepts aprebound_socketso the caller binds the PUB before the pipeline starts (SUB connects duringcompose()); only closes sockets it owns._wait_for_pipeline_readypolls/statusbefore publishing in--no-hp-start.iter_frame_chunksdefaultn_workers16→4 with exponential-backoff retry on httpxPoolTimeout; new--tiled-workersflag.config_from_tiled.pypanda_upsample(encoder/frame shape ratio) andvit_normalization— the latter viaptychoml.compute_intensity_normalizationinstead of Enhance image processing and orientation detection in holoptycho #37's inline mask+max (behavior-equivalent; itsValueErroron the all-hot case maps to the prior warning path).--patch-flip,--min-overlap-count,--overshoot-factor,--x/--y-direction.Testing
Dev-tooling socket/HTTP/Tiled-I/O robustness — not unit-testable in CI without a live Tiled server + ZMQ pipeline. It faithfully reproduces #37 (clean apply, ancestry-verified), and the one computational reuse (
compute_intensity_normalization) is ptychoml-tested.--helpworks for both scripts.Remaining: H6c — infra/docs (
Dockerfile,start_editable.sh,pixi.toml,README).