Skip to content

[essreduce] Fix loading monitors with auxiliary signals (KeyError: 'frame_total') - #800

Merged
nvaytet merged 1 commit into
mainfrom
797-monitor-aux-signals
Oct 16, 2026
Merged

nvaytet merged 1 commit into
mainfrom
797-monitor-aux-signals

Conversation

@SimonHeybrock

Copy link
Copy Markdown
Member

Fixes #797.

Monitors written by the current file writer have an auxiliary_signals=['frame_total'] attribute on their NXdata group. _NXdataWithoutAuxSignals removed the frame_total and reference_time children but kept that attribute, so ScippNeXus looked up the removed child and GenericNeXusWorkflow failed with KeyError: 'frame_total'. The attribute is now removed together with the children.

This affects DREAM, NMX and BIFROST histogram monitors in the current coda files, and the LoKI monitors in older files. Workflows that use these monitors, e.g. DREAM reduction with monitor normalization, failed on such files.

The existing histogram-monitor test uses an older DREAM file without auxiliary signals, so the new test writes a small file with the current layout.

Note for #785: its monitor tests expect the fallback warnings caused by this bug and will need updating once this is merged.

Test plan: new unit test (fails on main with the KeyError); loaded DREAM monitor_bunker/monitor_cave, NMX beam_monitor_1 and BIFROST bandwidth_monitor/overlap_monitor/psc_monitor from the 2026-10-13 coda drop, all of which now load with positions.

🤖 Generated with Claude Code

_NXdataWithoutAuxSignals removed the frame_total and reference_time
children but kept the auxiliary_signals attribute naming them, so
ScippNeXus failed with KeyError: 'frame_total' on monitors written by the
current file writer.

Fixes #797

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SimonHeybrock SimonHeybrock self-assigned this Oct 13, 2026
@github-actions github-actions Bot added the essreduce Issues for essreduce. label Oct 13, 2026
@SimonHeybrock
SimonHeybrock added this pull request to the merge queue Oct 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 16, 2026
@nvaytet
nvaytet added this pull request to the merge queue Oct 16, 2026
Merged via the queue into main with commit 7a9acf5 Oct 16, 2026
26 checks passed
@nvaytet
nvaytet deleted the 797-monitor-aux-signals branch October 16, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

essreduce Issues for essreduce.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[essreduce] Monitors with auxiliary_signals fail to load with KeyError: 'frame_total'

2 participants