Skip to content

fix: Cytiva Unicorn - skip curves with no data points - #1275

Merged
nathan-stender merged 2 commits into
mainfrom
fix/cytiva-unicorn-empty-curves
Oct 7, 2026
Merged

nathan-stender merged 2 commits into
mainfrom
fix/cytiva-unicorn-empty-curves

Conversation

@nathan-stender

Copy link
Copy Markdown
Collaborator

Problem

UNICORN exports curves that recorded no data (e.g. UV 2/UV 3 set to 0 nm, or unused pH/pressure/flow sensors) with an empty coordinate array. The parser still built a data cube for each, emitting dimensions: [[]] / measures: [[]]. An empty array satisfies all of tNumberArray, tBooleanArray, and tStringArray, so the oneOf fails and conversion raises AllotropeValidationError.

Fix

UnicornMeasurement.get_data_cube_or_none now returns None for a curve with no points, so it's handled like a missing curve. Existing is_valid / None checks then drop measurements that have no populated cubes.

Tests

  • New fixture unicorn_empty_curve.zip (8 KB), derived from the existing anonymized unicorn_single_uv.zip with the pH curve's Volumes/Amplitudes replaced by the empty-array serialization seen in a real export (byte-identical, no customer data).
  • Checked that it fails on main with the same oneOf error, and passes with the fix. Expected JSON generated with --overwrite; the pH measurement is omitted (4 measurements vs 5 in the base fixture).
  • No changes to existing expected JSON.

🤖 Generated with Claude Code

Unused curves (e.g. a UV channel set to 0 nm) are exported with an empty
coordinate array. These produced data cubes with `dimensions: [[]]`, which
fails ASM schema validation because an empty array matches every branch of
the tBooleanArray/tStringArray/tNumberArray oneOf. Treat such curves as
absent so the measurement is dropped like any other missing curve.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nathan-stender
nathan-stender requested review from a team and slopez-b as code owners October 7, 2026 02:19
@nathan-stender
nathan-stender merged commit 1b49b30 into main Oct 7, 2026
9 checks passed
@nathan-stender
nathan-stender deleted the fix/cytiva-unicorn-empty-curves branch October 7, 2026 16:20
nathan-stender added a commit that referenced this pull request Oct 7, 2026
### Fixed

- Cytiva Unicorn - skip curves with no data points (#1275)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants