fix(data_handling): stop coercing unparseable telemetry to 0.0 in floatify_input (#161) by philphauler · Pull Request #199 · nasa/OnAIR · GitHub
Skip to content

fix(data_handling): stop coercing unparseable telemetry to 0.0 in floatify_input (#161) - #199

Open
philphauler wants to merge 2 commits into
nasa:mainfrom
philphauler:fix-161-floatify-input
Open

philphauler wants to merge 2 commits into
nasa:mainfrom
philphauler:fix-161-floatify-input

Conversation

@philphauler

Copy link
Copy Markdown

Summary

  • \onair/data_handling/parser_util.py: \loatify_input\ returned \

floatify_input returned 0.0 for any value that failed both float() and
convert_str_to_timestamp(). Downstream code then reads that 0.0 as a valid
telemetry reading, corrupting frames built from bad data. Return the dash
sentinel ('-', already the no-value marker OnAIR uses in frames) so invalid
data is explicit instead of masquerading as a zero measurement.

- parser_util.floatify_input: append '-' instead of 0.0 on parse failure
- update floatify unit tests (2 explicit + multi-typed) to expect '-'

@sylvesterkaczmarek sylvesterkaczmarek left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

floatify_input() now returns the string sentinel "-" for invalid telemetry, but the Kalman plugin stores every returned value and later feeds those frames into NumPy/simdkalman numeric arrays. After an invalid sample this can raise a conversion/type error instead of producing a fault result. Use a numeric missing-value representation that the consumers handle, or make the Kalman path explicitly skip/reject invalid samples, and add an end-to-end invalid-telemetry regression.

…inel

kalman_plugin.Plugin.update() called floatify_input directly and appended
every value into self.frames[i]; _generate_residuals then puts frames into
float NumPy arrays for simdkalman, so the '-' sentinel from OnAIR#161 raised
ValueError. Skip the whole frame instead of appending a partial one, since
_generate_residuals index-aligns each attribute's window by position and a
partial frame would desynchronize those windows.

- Plugin.update: return early when floatify_input's output contains '-'
- test_kalman_plugin: add mocked-frame and real-floatify_input coverage for
  the skip path
@philphauler

Copy link
Copy Markdown
Author

@sylvesterkaczmarek sylvesterkaczmarek left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked current 93714c3. The issue I raised is resolved: invalid telemetry still remains explicit as the existing dash sentinel, but the Kalman path now rejects the entire frame before any per-attribute window is mutated, so the numeric arrays never receive the string and the attribute histories stay aligned. The two new regressions cover both a forced sentinel frame and the real floatify_input path. No remaining blocker from my review.

@philphauler

Copy link
Copy Markdown
Author

Nice one, let's go ⚡️

Imma hit u up on linked in as well 🙏

@sylvesterkaczmarek

Copy link
Copy Markdown

Sounds good, thanks. Happy to connect there as well.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (16fe993) to head (93714c3).
⚠️ Report is 163 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main      #199    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           26        31     +5     
  Lines          970      1171   +201     
  Branches       136       169    +33     
==========================================
+ Hits           970      1171   +201     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sylvesterkaczmarek

Copy link
Copy Markdown

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.

3 participants