Skip to content

feat(data_service): add new linear calibration methods - #14

Merged
Awesome-Ace22 merged 1 commit into
devfrom
feature/robust-calibration-fits
Nov 7, 2026
Merged

Awesome-Ace22 merged 1 commit into
devfrom
feature/robust-calibration-fits

Conversation

@Awesome-Ace22

@Awesome-Ace22 Awesome-Ace22 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

What and why

This pull request adds robust calibration methods for sensor data, improving the system's resilience to outlier calibration points. It introduces two robust line-fitting methods—Theil-Sen and Siegel's repeated median—and integrates them into the calibration pipeline. Comprehensive tests are also included to ensure correctness and reliability of the new methods.

Robust calibration methods:

  • Added THEIL_SEN and REPEATED_MEDIAN options to the ConvertMethod enum in app/models.py, enabling selection of robust linear fitting methods.
  • Implemented robust line-fitting functions (theil_sen_fit, repeated_median_fit) and a unified robust_interpolate function in app/services/data_service.py, allowing calibration to ignore outliers and improve accuracy.
  • Updated the main sensor value conversion logic to use the new robust methods when selected, ensuring robust calibration is applied throughout the codebase.

Testing:

  • Added a new test suite tests/test_robust_calibration.py with extensive test coverage for the robust calibration methods, including edge cases and integration with the sensor parser.

Codebase improvements:

  • Refactored imports and code structure in app/services/data_service.py to support the new calibration methods and maintain clarity.

How was this tested?

  • 1 Unit / Automated Test - CI
  • 2 Simulator Test - testing procedure with the hardware simulators
  • 3 Bench Test - testing procedure on the dev stack, with some real hardware
  • 4 Integration Test - full engine test procedure, real hardware, no propellants

Hardware impact

  • None - UI, docs or tooling only
  • Changes how a sensor is read, converted or shown
  • Changes how an actuator is commanded, or safety rules, interlocks, timeouts or sequencing → add the hardware-risk label; a lead must approve
  • Changes a message format, MQTT topic or FAS protocol that another repo depends on → title needs !, link the matching PRs:

Checklist

  • Targets dev (or main for a release/hotfix, or with a reason given above)
  • Branch is up to date ("Update branch" button)
  • No station config/calibrations, data files, secrets, .env files or build output committed
  • README/docs updated if behaviour changed

@Awesome-Ace22
Awesome-Ace22 requested a review from a team as a code owner November 7, 2026 16:14
@Awesome-Ace22 Awesome-Ace22 added the enhancement New feature or request label Nov 7, 2026
@Awesome-Ace22 Awesome-Ace22 changed the title feat(data_service): add new linear calibration methods and corresponding tests feat(data_service): add new linear calibration methods Nov 7, 2026
@Awesome-Ace22
Awesome-Ace22 merged commit 5c1dc19 into dev Nov 7, 2026
2 of 14 checks passed
@Awesome-Ace22
Awesome-Ace22 deleted the feature/robust-calibration-fits branch November 7, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant