fix: transmission is a fraction of full beam everywhere #31

Merged
perl_d merged 1 commits from fix/transmission-fraction into main 2026-09-08 00:22:16 +02:00
Owner

Per the DAQ/DB consensus: transmission is a fraction of full beam (0.0-1.0, 1.0 = full) in every model; values in (1.0, 100.0] fail validation by design instead of being silently reinterpreted. Calling it fraction, not percentage.

Changed:

  • DataCollectionParameters.transmission — was the outlier (int, 0-100): now Annotated[float, Field(ge=0.0, le=1.0)] | None
  • RotationScanRequest.transmission / RasterGridRequest.transmission — were unconstrained floats: same constraint added (AareDB production data on these paths is already fraction; 39k runs & 19k grids checked, only 25 runs from the earliest DAQ era were percent-scale)
  • 4 new tests pinning the contract (fraction accepted, boundaries valid, (1,100] rejected, negatives rejected); full suite 226 passed

BeamlineStatus, SimpleScanParameters and FluorescenceSpectrumParameterModel already complied - no change.

Human-facing surfaces (the user xlsx spreadsheet, AareDB public API) deliberately stay percent; conversion happens at the AareDB boundary. AareDB's side (data migration of 4,552 stored percent values + sheet import/export converters) is prepared in parallel and will deploy pinned to this release - please coordinate the release so the DAQ pin bump lands after AareDB's migration deploy.

ruff format + ruff check clean; basedpyright clean on changed lines.

Per the DAQ/DB consensus: `transmission` is a **fraction of full beam (0.0-1.0, 1.0 = full)** in every model; values in (1.0, 100.0] fail validation by design instead of being silently reinterpreted. Calling it *fraction*, not percentage. Changed: - `DataCollectionParameters.transmission` — was the outlier (`int`, 0-100): now `Annotated[float, Field(ge=0.0, le=1.0)] | None` - `RotationScanRequest.transmission` / `RasterGridRequest.transmission` — were unconstrained floats: same constraint added (AareDB production data on these paths is already fraction; 39k runs & 19k grids checked, only 25 runs from the earliest DAQ era were percent-scale) - 4 new tests pinning the contract (fraction accepted, boundaries valid, (1,100] rejected, negatives rejected); full suite 226 passed `BeamlineStatus`, `SimpleScanParameters` and `FluorescenceSpectrumParameterModel` already complied - no change. Human-facing surfaces (the user xlsx spreadsheet, AareDB public API) deliberately stay percent; conversion happens at the AareDB boundary. AareDB's side (data migration of 4,552 stored percent values + sheet import/export converters) is prepared in parallel and will deploy pinned to this release - please coordinate the release so the DAQ pin bump lands after AareDB's migration deploy. ruff format + ruff check clean; basedpyright clean on changed lines.
gotthard_g added 1 commit 2026-09-07 23:58:55 +02:00
fix: transmission is a fraction of full beam everywhere
CI / lint (pull_request) Successful in 34s
CI / test (3.12) (pull_request) Successful in 22s
CI / test (3.13) (pull_request) Successful in 30s
CI / test (3.11) (pull_request) Successful in 35s
CI / lint (push) Canceled after 10s
CI / test (3.11) (push) Canceled after 0s
CI / test (3.12) (push) Canceled after 0s
CI / test (3.13) (push) Canceled after 0s
Build and Publish / release (push) Successful in 11s
c095cb484e
DataCollectionParameters.transmission was the outlier: int percent 0-100
while BeamlineStatus / SimpleScanParameters / FluorescenceSpectrum already
used a 0-1 fraction. Per the DAQ/DB consensus it is now a strict
Annotated[float, Field(ge=0.0, le=1.0)] fraction (1.0 = full beam);
percent-scale values in (1.0, 100.0] fail validation by design instead of
being silently reinterpreted. RotationScanRequest / RasterGridRequest gain
the same constraint (production data is already fraction on those paths).

Human-facing surfaces (user spreadsheets, AareDB public API) stay percent;
their converters live in AareDB at the boundary.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HiGzkkuiZXei894cnJfgSg
perl_d approved these changes 2026-09-08 00:22:09 +02:00
perl_d left a comment
Owner

lgtm

lgtm
perl_d merged commit c095cb484e into main 2026-09-08 00:22:16 +02:00
Sign in to join this conversation.