Skip to content

Commit a2a1f0d

Browse files
fix: Make space optional in Cytiva UNICORN UV curve regexes (#1229)
## Summary - Makes the space between "UV" and the digit optional in all three absorbance measurement regexes (`UV 1_`, `UV 2_`, `UV 3_` → `UV ?1_`, `UV ?2_`, `UV ?3_`) - Fixes silent loss of UV absorbance measurements for exports that use the no-space format (e.g. AKTApilot devices) ## Context Some UNICORN exports declare UV curves as `UV1_280` / `UV2_0` / `UV3_0` (no space), while others use `UV 1_280` (with space). The previous regexes required the space, causing `filter_curve_or_none()` to return `None` and silently skip all absorbance measurements. Reproduced on an AKTApilot 02 export (batch BRR-92117): - Before fix: 2 measurements (Cond, pH only) - After fix: 5 measurements (UV1_280, UV2_0, UV3_0, Cond, pH) ## Test plan - [x] Existing cytiva_unicorn golden tests pass (2/2) - [x] Verified BRR-92117 file now produces all 5 expected measurements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6dd22a0 commit a2a1f0d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • src/allotropy/parsers/cytiva_unicorn/structure/measurements

src/allotropy/parsers/cytiva_unicorn/structure/measurements/absorbance.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def create_or_none(
9292
class AbsorbanceMeasurement1(AbsorbanceMeasurement):
9393
@classmethod
9494
def get_curve_regex(cls) -> str:
95-
return r"^UV( 1_\d+)?$"
95+
return r"^UV( ?1_\d+)?$"
9696

9797
@classmethod
9898
def get_peaks_custom_info(
@@ -191,10 +191,10 @@ def get_peaks(cls, handler: UnicornZipHandler) -> list[Peak]:
191191
class AbsorbanceMeasurement2(AbsorbanceMeasurement):
192192
@classmethod
193193
def get_curve_regex(cls) -> str:
194-
return r"^UV 2_\d+$"
194+
return r"^UV ?2_\d+$"
195195

196196

197197
class AbsorbanceMeasurement3(AbsorbanceMeasurement):
198198
@classmethod
199199
def get_curve_regex(cls) -> str:
200-
return r"^UV 3_\d+$"
200+
return r"^UV ?3_\d+$"

0 commit comments

Comments
 (0)