Skip to content

Replace polynomial with piecewise linear interpolation for MicroAmp plate#995

Merged
BioCam merged 4 commits intoPyLabRobot:mainfrom
BioCam:microamp-interpolation-upgrade
Apr 16, 2026
Merged

Replace polynomial with piecewise linear interpolation for MicroAmp plate#995
BioCam merged 4 commits intoPyLabRobot:mainfrom
BioCam:microamp-interpolation-upgrade

Conversation

@BioCam
Copy link
Copy Markdown
Collaborator

@BioCam BioCam commented Apr 16, 2026

Summary

  • The 5th-degree polynomial fits for thermo_AB_96_wellplate_300ul_Vb_MicroAmp did not round-trip correctly — height_from_volume(50) followed by volume_from_height() returned ~6 uL instead of 50 uL
  • Replaced both _compute_volume_from_height and _compute_height_from_volume with interpolate_1d using the original calibration data as piecewise linear lookup
  • Round-trip error is now zero at all calibration points

Test plan

  • Verify round-trip accuracy at all calibration points (0, 4, 8, 20, 40, 50, 70, 120, 170, 220, 260, 290 uL)
  • Verify Well.__init__ max_volume computation succeeds (uses compute_volume_from_height(size_z) with bounds_handling="clip")
  • Run existing plate tests

🤖 Generated with Claude Code

BioCam and others added 4 commits April 16, 2026 21:23
…rpolation for MicroAmp plate

The 5th-degree polynomial fits for `thermo_AB_96_wellplate_300ul_Vb_MicroAmp` did not
round-trip correctly — `height_from_volume(50)` followed by `volume_from_height()` returned
~6 uL instead of 50 uL. The two polynomials were fitted independently and disagreed between
calibration points.

Replaced both with `interpolate_1d` using the original calibration data as a piecewise linear
lookup. Round-trip error is now zero at all calibration points and negligible between them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The well height (23.24 mm) exceeds the calibration data range (0-17.89 mm).
Extrapolating linearly from the last segment gives reasonable estimates
for the uncalibrated range, while clip would silently cap at 290 uL.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@BioCam BioCam merged commit 8f32f2c into PyLabRobot:main Apr 16, 2026
19 checks passed
@BioCam BioCam deleted the microamp-interpolation-upgrade branch April 17, 2026 09:27
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