Skip to content

[essreduce] Fix loading monitors whose transformation chain has no translation - #799

Merged
SimonHeybrock merged 2 commits into
mainfrom
798-monitor-identity-transform
Oct 16, 2026
Merged

SimonHeybrock merged 2 commits into
mainfrom
798-monitor-identity-transform

Conversation

@SimonHeybrock

Copy link
Copy Markdown
Member

Fixes #798.

GenericNeXusWorkflow could not load a monitor whose transformation chain contains no translation, e.g. depends_on='.'. Such a transform is dimensionless, and get_calibrated_monitor took the unit of the position from it, so adding the offset (in metres) raised a UnitError. The position is now computed in the unit of the offset in that case.

This affects all FREIA monitors and MAGIC beam_monitor_1 in the current coda files. The FREIA multiblade_detector (also depends_on='.') was not affected because detectors go through compute_detector_position, which already handles this.

Test plan: new unit test; loaded the FREIA (monitor_1..3, MISSING_ESSCONFIG_monitor_4) and MAGIC (beam_monitor_1) monitors from the 2026-10-13 coda drop, which fail on main and load at the origin with this change.

🤖 Generated with Claude Code

A monitor with depends_on='.' (or only rotations) has a dimensionless
transform. get_calibrated_monitor took the position unit from the
transform, so adding the offset in metres raised a UnitError. Use the
offset's unit in that case.

Fixes #798

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
Comment thread packages/essreduce/src/ess/reduce/nexus/workflow.py Outdated
A transform with unit None does not reach get_calibrated_monitor, and a
translation with a bad unit fails earlier when the chain is resolved.
State this in the comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SimonHeybrock
SimonHeybrock added this pull request to the merge queue Oct 16, 2026
Merged via the queue into main with commit 73cc742 Oct 16, 2026
24 checks passed
@SimonHeybrock
SimonHeybrock deleted the 798-monitor-identity-transform branch October 16, 2026 07:30
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 depends_on='.' fail to load with UnitError

2 participants