Skip to content

OD calibration sharing and pooling feature #617

Open
fabiansisteffen wants to merge 2 commits into
Pioreactor:masterfrom
fabiansisteffen:cluster_calibration
Open

OD calibration sharing and pooling feature #617
fabiansisteffen wants to merge 2 commits into
Pioreactor:masterfrom
fabiansisteffen:cluster_calibration

Conversation

@fabiansisteffen
Copy link
Copy Markdown
Contributor

OD calibration sharing and pooling feature

The cluster-wide OD calibration sharing and pooling feature with 2 operations or large and small cluster scenarios.

  • copy calibration
  • pool calibration

core/pioreactor/calibrations/pooling.py (New)

  • Added pool_od_calibrations, which validates that incoming OD calibrations share the same angle, pd_channel, and a highly similar ir_led_intensity (within 5%).
  • Points from all compatible donors' recorded_data are merged into a single array and re-fit using the existing spline_fit (or other supported methods).
  • Designed for extensibility via the _POOLING_HANDLERS registry so pump/stirring can easily be added later.

core/pioreactor/web/unit_api.py (Worker API Updates)

  • Added GET /calibrations//active which returns the raw YAML of a unit's active calibration.
  • Added GET /calibrations//<calibration_name> to allow specific calibration retrieval by name.
  • Updated POST /calibrations/ to enforce the "auto-activation guard": it only automatically activates the newly pushed calibration if the target unit didn't already have an active one for that device.

core/pioreactor/web/api.py (Leader API Updates)

  • Added POST /cluster/calibrations//pool: Fans out to get active calibrations from workers, pools them, and returns the merged YAML.
  • Added POST /workers/<pioreactor_unit>/calibrations//apply: Takes a calibration YAML payload and pushes it to a single unit or the whole cluster ($broadcast).
  • Added POST /workers/<source_unit>/calibrations//copy_to/<target_unit>: A convenience method to directly copy an active (or specific named) calibration from one unit to another (or all units).

core/tests/test_calibration_pooling.py

  • Test covering merging logic, mismatch rejection (wrong angle, different LED intensity), single-donor behaviour, and the handler registry.

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