feat: ingest motion-corrected micrograph image paths (#309)#311
Open
vredchenko wants to merge 1 commit into
Open
feat: ingest motion-corrected micrograph image paths (#309)#311vredchenko wants to merge 1 commit into
vredchenko wants to merge 1 commit into
Conversation
Persist the motion-corrected image artefacts cryoem-services produces so the micrograph leaf can be served (ADR 0021). This is the ingestion half; the serving endpoint is #308. - add nullable micrograph.motion_corrected_image_path and motion_corrected_snapshot_path columns (Alembic migration, no backfill) - extend MotionCorrectionCompletedRequest and MotionCorrectionCompleteBody additively with both optional paths (backward-compatible) - thread the paths through publish_motion_correction_completed and persist whichever are present in handle_motion_correction_complete The two paths arrive via the existing motion_correction/completed contract; callers that omit them are unaffected.
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.
Closes #309. Implements the ingestion half of ADR 0021 (smartem-devtools PR #232): persist the motion-corrected micrograph image paths so the leaf image can be served. The serving endpoint is #308 (gated behind this); the cryoem-services adapter that supplies the paths is #310 (external).
What
The scientifically meaningful micrograph image is the motion-corrected artefact cryoem-services already produces (a 2D
.mrcand a downscaled.jpegsnapshot) — not the storedhigh_res_path(raw multi-GB movie stack; 3D-array encode failure + OOM). Those paths arrive through SmartEM's existingPOST /micrographs/{uuid}/motion_correction/completedcontract, which this PR extends additively.d5e6f7a8b9c0— adds two nullable columns tomicrograph:motion_corrected_image_path,motion_corrected_snapshot_path. No backfill; existing/dump rows stay null.MotionCorrectionCompletedRequest(HTTP) andMotionCorrectionCompleteBody(RabbitMQ body) each gain both fields as optional (nullable, defaultNone). Callers that omit them are unaffected — backward-compatible.publish_motion_correction_completedthreads the two paths into the event; the endpoint forwards them from the payload;handle_motion_correction_completepersists whichever paths are present onto the micrograph row (previously it touched only statistics andupdated_at).Verification
downgrade -1drops them; re-upgrade +--autogeneratereports no drift (model matches migration).test_processing_feedback_endpoints.py+test_consumer_async_handlers.pypass (2 new cases: paths forwarded through the endpoint, paths persisted by the consumer).Notes
total_motion/average_motion(the data the motion-correction event carries together).micrograph_imageendpoint (feat(api): serve motion-corrected micrograph preview image (ADR 0021) #308) returns 404 — correct behaviour. A release is warranted once feat(api): serve motion-corrected micrograph preview image (ADR 0021) #308 lands (new endpoint + migration + contract fields).