Skip to content

Fix parameter units being silently changed to SI units - #311

Open
henrikjacobsenfys wants to merge 3 commits into
developfrom
fix-parameter-units
Open

henrikjacobsenfys wants to merge 3 commits into
developfrom
fix-parameter-units

Conversation

@henrikjacobsenfys

@henrikjacobsenfys henrikjacobsenfys commented Sep 17, 2026

Copy link
Copy Markdown
Member

This was written partly by Claude under my guidance.

Handles the issue mentioned here: #300

The solution is twofold:

  1. store the string users give when supplying a unit, and use that string rather than the scipp-generated one. This means users get the unit they asked for, not whichever unit combination the underlying library thinks it should be
  2. strip numbers only when the unit is purely a number, e.g. in the m/mm example.

For 1, it also handles e.g. when parameters are added or subtracted from other parameters.

@henrikjacobsenfys henrikjacobsenfys added [scope] bug Bug report or fix (major.minor.PATCH) [priority] medium Normal/default priority labels Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[priority] medium Normal/default priority [scope] bug Bug report or fix (major.minor.PATCH)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant