Xiaoya refactor publisher#48
Conversation
dylanmcreynolds
left a comment
There was a problem hiding this comment.
I think we can make this simpler. See commend.
dylanmcreynolds
left a comment
There was a problem hiding this comment.
I approved. Is this mergable?
taxe10
left a comment
There was a problem hiding this comment.
All looks good. I left some very minor comments.
| parts.extend(root_segments) | ||
| parts.append(date_path) | ||
| parts.append(uuid) | ||
| parts.append(ARRAY_KEY) |
There was a problem hiding this comment.
I think ARRAY_KEY is referenced before it's defined
There was a problem hiding this comment.
It's a module-level variable defined as "xps_averaged_heatmaps".
| self.poll_interval_sec = poll_interval_sec | ||
| self.frame_poll_interval_sec = frame_poll_interval_sec | ||
| self.unchanged_cycles_threshold = unchanged_cycles_threshold | ||
| self.seen_scans_file = seen_scans_file |
There was a problem hiding this comment.
| self.seen_scans_file = seen_scans_file | |
| self.seen_scans_file = Path(seen_scans_file) |
There was a problem hiding this comment.
The seen scans are stored as UUIDs, so the path is not used.
| poll_interval_sec=poll_interval_sec, | ||
| frame_poll_interval_sec=frame_poll_interval_sec, | ||
| unchanged_cycles_threshold=unchanged_cycles_threshold, | ||
| seen_scans_file=seen_scans_file, |
There was a problem hiding this comment.
| seen_scans_file=seen_scans_file, | |
| self.seen_scans_file = Path(seen_scans_file) |
There was a problem hiding this comment.
The seen scans are stored as UUIDs, so the path is not used.
| return | ||
| if isinstance(message, RawFrameEvent): | ||
| message = message.model_dump() | ||
| # message["image"] = SerializableNumpyArrayModel.serialize_array( |
There was a problem hiding this comment.
Should we remove this comment?
There was a problem hiding this comment.
Yes. I just removed it.
The main purpose of this PR is to move the
Tiledpublisher fromLSEtoarroyoXPS, and to havearroyoXPSsend results toLSEviaZMQinstead of using aWebSocketconnection.Tiledand aZMQmessage is sent toLSEusing the same publisher, XPSTiledResultPublisher.XPSTiledResultPublisher, we import:from arroyosas.schemas import RawFrameEvent, SASStart, SASStop, SerializableNumpyArrayModelSince both
arroyosasandarroyoxpssend the same message types (RawFrameEvent,SASStart,SASStop) toLSE, it may make sense to move these schemas intoarroyopyand rename them (e.g., remove theSASprefix).Tiledunless astartmessage has been received. For example, ifsplash_timepixstarts beforearroyoxps, theTiledpublisher logs the following message:Received scan 'None' frame 49 but no start message has been received yet — discarding frame to avoid Tiled index desync.Tiledstructure: