Skip to content

fix: Support EnVision calculated formulas without a name prefix#1246

Merged
nathan-stender merged 3 commits into
mainfrom
fix-envision-calc-formula-no-name-v2
Jul 23, 2026
Merged

fix: Support EnVision calculated formulas without a name prefix#1246
nathan-stender merged 3 commits into
mainfrom
fix-envision-calc-formula-no-name-v2

Conversation

@nathan-stender

Copy link
Copy Markdown
Collaborator

Summary

A PerkinElmer EnVision 384-well absorbance export (OD450) failed to parse:

AllotropeConversionError: Unable to find expected formula name for calculated results section.

The calculated plate's Formula is a plain description with no name = prefix:

Calc 1: OD450 direct absorbance value at 450 nm

CalculatedPlateInfo.create extracted the name with ^([^=]*)=, which assumes the standard form Calc N: <name> = <expression> and raised when no = was present.

Fix

When the formula has no =, fall back to using the whole formula string as the calculated data name. Standard formulas are unaffected.

Changes

  • perkin_elmer_envision_structure.py: make the formula-name regex optional with a whole-string fallback.
  • Reworked test_create_calculated_plate_info_with_invalid_formulatest_create_calculated_plate_info_with_formula_without_name to assert the fallback.
  • Edited the formula in the existing PE_Envision_fluorescence_example01.csv to the no-= form (and regenerated its expected JSON) to exercise the fallback end-to-end. Other example files retain the standard name = expression form, so both branches stay covered.

Testing

  • All 24 perkin_elmer_envision tests pass; hatch run lint (ruff, black, mypy) clean.

🤖 Generated with Claude Code

Some PerkinElmer EnVision exports report a calculated formula as a plain
description with no "name =" prefix (e.g. "Calc 1: OD450 direct absorbance
value at 450 nm"). The name-extraction regex required an '=' and raised
"Unable to find expected formula name for calculated results section."

Fall back to using the whole formula string as the calculated data name when
there is no '=' delimiter. The no-'=' case is exercised by editing the formula
in an existing fluorescence example file; other example files retain the
standard "name = expression" form.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The regenerated expected output reordered object keys, producing a ~5000-line
diff for a change that only touches the calculated data name/description.
Hand-edit the expected JSON to apply just the string changes, preserving the
original key order so the diff reflects only the intended values.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@nathan-stender
nathan-stender merged commit adeb3a4 into main Jul 23, 2026
9 checks passed
@nathan-stender
nathan-stender deleted the fix-envision-calc-formula-no-name-v2 branch July 23, 2026 21:04
nathan-stender added a commit that referenced this pull request Jul 24, 2026
### Fixed

- Support EnVision calculated formulas without a name prefix (#1246)
- Handle dilutions, replicate measurements, and mmol/l unit in Roche
Cedex Bio HT (#1244)
- Handle multiple spaces in Raw Data line for BMG MARS parser (#1243)
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.

2 participants