Skip to content

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

Closed
nathan-stender wants to merge 1 commit into
mainfrom
fix-envision-calc-formula-no-name
Closed

fix: Support EnVision calculated formulas without a name prefix#1245
nathan-stender wants to merge 1 commit into
mainfrom
fix-envision-calc-formula-no-name

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.
  • Added regression file PE_Envision_absorbance_OD450_384_calc_no_name.csv (+ expected JSON).

Testing

  • The file now parses (384 wells, 384 calculated data documents; calc name = full formula string).
  • All 25 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. Adds a 384-well absorbance regression file.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@nathan-stender
nathan-stender requested review from a team and slopez-b as code owners July 23, 2026 18:37
@nathan-stender

Copy link
Copy Markdown
Collaborator Author

Superseded by #1246, which drops the large 384-well testdata file and instead exercises the no-'=' formula case by editing an existing example file.

@nathan-stender
nathan-stender deleted the fix-envision-calc-formula-no-name branch July 23, 2026 18:49
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.

1 participant