Commit 3c5d33d
fix: Resolve duplicate columns in Stunner DLS output (#1213)
## Summary
- Stunner parser now recognizes alternate DLS column names used by newer
instrument software (e.g., `Z-Avg Dia. (nm)` vs `Z Ave. Dia (nm)`,
`Rayleigh ratio R (1/km)` vs `(cm^-1)`, `Viscosity at 25°C` vs `20°C`)
- Previously unmapped DLS fields (`Number of Peaks`, `Number of Angles`,
`Angles Measured`, `Intercept`) are now structured as calculated data
documents instead of leaking to custom info
- `number_of_averages` and `Number of acquisitions used` now try both
`(total)` and non-`(total)` column name variants
- `B/S/F/R` (sample role type) added to sample custom info
- Removed 52 N/A placeholder columns from `data system document.custom
information document` that were causing duplicate columns in connector
CSV output
## Context
Follow-up to #1205. Customer (ProFound) reported 17 remaining duplicate
columns after the PkN fix. Root cause was twofold:
1. `CALCULATED_DATA_LOOKUP` did not recognize newer column naming
conventions, so DLS fields fell through `get_unread()` into
`measurement_custom_info`
2. When the parser reads metadata from the first data row (no-header
mode), unread DLS/peak columns leaked into
`data_system_document.custom_information_document` as N/A placeholders —
the CSV conversion lib then produced one column from the placeholder and
one from the actual structured data
## Test plan
- [x] All 34 Stunner/Lunatic tests pass (33 existing + 1 new)
- [x] All 12 Lunatic discovery tests pass
- [x] New anonymized test file (example03) exercises the new PkN column
format with blank, no-peaks, single-peak, and multi-peak measurements
- [x] Verified customer file: 0/85 measurements have
`measurement_custom_info` content
- [x] Verified `data_system_document.custom_information_document` is
empty (was 52 N/A keys)
- [x] Lint clean (black, ruff, mypy)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 10b2e3d commit 3c5d33d
7 files changed
Lines changed: 1572 additions & 86 deletions
File tree
- src/allotropy/parsers/unchained_labs_lunatic_stunner
- tests/parsers/unchained_labs_lunatic_stunner
- testdata
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| |||
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| 118 | + | |
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
| |||
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
| 173 | + | |
171 | 174 | | |
172 | 175 | | |
173 | 176 | | |
| |||
192 | 195 | | |
193 | 196 | | |
194 | 197 | | |
| 198 | + | |
195 | 199 | | |
196 | 200 | | |
197 | 201 | | |
| |||
204 | 208 | | |
205 | 209 | | |
206 | 210 | | |
| 211 | + | |
207 | 212 | | |
208 | 213 | | |
209 | 214 | | |
| |||
214 | 219 | | |
215 | 220 | | |
216 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
217 | 246 | | |
218 | 247 | | |
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
265 | 293 | | |
266 | 294 | | |
267 | 295 | | |
| |||
Lines changed: 57 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
| |||
259 | 261 | | |
260 | 262 | | |
261 | 263 | | |
| 264 | + | |
262 | 265 | | |
263 | 266 | | |
264 | 267 | | |
265 | 268 | | |
266 | 269 | | |
267 | 270 | | |
268 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
269 | 276 | | |
270 | 277 | | |
271 | 278 | | |
| |||
434 | 441 | | |
435 | 442 | | |
436 | 443 | | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
441 | 456 | | |
442 | 457 | | |
443 | 458 | | |
444 | 459 | | |
445 | | - | |
| 460 | + | |
446 | 461 | | |
447 | 462 | | |
448 | | - | |
449 | 463 | | |
450 | | - | |
| 464 | + | |
451 | 465 | | |
452 | 466 | | |
453 | 467 | | |
| |||
506 | 520 | | |
507 | 521 | | |
508 | 522 | | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
509 | 557 | | |
510 | 558 | | |
511 | 559 | | |
| |||
0 commit comments