You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several robustness gaps in src/easyreflectometry/data/measurement.py and orso_utils.py:
5+-column files crash._load_txt (measurement.py:96-100) unpacks exactly 4 names in the num_columns >= 4 branch; a 5-column file (q, R, sR, sQ, lambda — common) raises "too many values to unpack" instead of taking the first four.
sc.concatenate is the old scipp API.merge_datagroups calls sc.concatenate([a, b]) (measurement.py:131, 137); current scipp uses sc.concat(list, dim). No test covers the merge path, so this is likely broken at runtime.
Silent format fallback.load (measurement.py:24-27) catches (IndexError, ValueError) from the ORSO loader and falls back to the bare-text loader — a malformed .ort loses its header (and resolution-column semantics, metadata) without any warning. Also load_orso_data (orso_utils.py:230) assumes 4 columns, so a legal 3-column .ort (sQz optional in the ORSO spec) takes this silent fallback path.
Error-column semantics unvalidated._load_txt treats column 3 as sigma and squares it (measurement.py:108) — correct for the common convention but undocumented; a file carrying variance is silently mis-scaled by sigma^4.
ORSO SLD units read heuristically._get_sld_values (orso_utils.py:166-204) assumes file SLDs are absolute A^-2 and multiplies by 1e6, ignoring the unit field orsopy provides; the >1e-2 magnitude warning is a guard, but reading the declared unit would be correct rather than heuristic.
Suggested fix
Take the first four columns explicitly (data[:, :4].T), move to sc.concat with a test, warn on ORSO→txt fallback, document/validate the error-column convention, and honor orsopy's unit metadata.
Found during deep code review (DEEP_ANALYSIS.md §4.9).
Activity
rozyczko commentedon Sep 15, 2026
Current status (Sept 2026):
sc.concatenate: STILL VALID (reproduced)Strengthen the multi-column load tests and qualify the docs #376
fix the multi-column load #376 (#413)
Preparation for the new release (#416)
🎉 Release: merge develop into master (#442)
Release 2.0.0 (#454)