Skip to content

Support multi-pulse ev44 messages#728

Draft
SimonHeybrock wants to merge 1 commit intomainfrom
multi-pulse-ev44
Draft

Support multi-pulse ev44 messages#728
SimonHeybrock wants to merge 1 commit intomainfrom
multi-pulse-ev44

Conversation

@SimonHeybrock
Copy link
Member

@SimonHeybrock SimonHeybrock commented Feb 25, 2026

Summary

Closes #708

  • The ev44 FlatBuffers schema supports packing events from multiple neutron pulses into a single message via reference_time and reference_time_index. Previously this raised NotImplementedError.
  • Implements 1:N message expansion at the adapter layer: a multi-pulse ev44 message is split into N single-pulse Message objects, each with its per-pulse timestamp and sliced event arrays. Downstream code (accumulator, workflows) is unchanged.
  • Zero overhead for single-pulse messages — the loop iterates once, slicing [0:] which is a numpy view (no copy).

Test plan

  • Multi-pulse splitting tests for MonitorEvents.from_ev44() and DetectorEvents.from_ev44()
  • Multi-pulse tests for KafkaToMonitorEventsAdapter, Ev44ToMonitorEventsAdapter, Ev44ToDetectorEventsAdapter
  • AdaptingMessageSource flattening verified through existing chained adapter test

🤖 Generated with Claude Code

The ev44 FlatBuffers schema supports packing events from multiple
neutron pulses into a single message via reference_time (array of pulse
timestamps) and reference_time_index (array of starting indices).
Previously, _require_single_pulse() raised NotImplementedError for
multi-pulse messages.

Implement 1:N message expansion at the adapter layer: a multi-pulse
ev44 message is split into N single-pulse Message objects, each with
its per-pulse reference_time[i] as timestamp and sliced event arrays.
Downstream code (accumulator, workflows) is unchanged.

Key property: zero overhead for single-pulse messages — the loop
iterates once, slicing [0:] which is a numpy view (no copy).

Changes:
- MonitorEvents.from_ev44() and DetectorEvents.from_ev44() now return
  list[tuple[int | None, Events]] with per-pulse slicing
- Ev44ToMonitorEventsAdapter, Ev44ToDetectorEventsAdapter, and
  KafkaToMonitorEventsAdapter return list[Message[...]]
- AdaptingMessageSource.get_messages() flattens list results
- Remove _require_single_pulse() function

Prompt: Implement the following plan: Support multi-pulse ev44 messages (#708)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support multi-pulse ev44 messages

1 participant