Skip to content

Tests for restart checking analysis#1069

Open
TeachMeTW wants to merge 1 commit intoe-mission:masterfrom
TeachMeTW:test_restart_checking
Open

Tests for restart checking analysis#1069
TeachMeTW wants to merge 1 commit intoe-mission:masterfrom
TeachMeTW:test_restart_checking

Conversation

@TeachMeTW
Copy link
Contributor

Unit tests for the restart detection functionality in restart_checking.py to document and validate how np.searchsorted maps timestamps between different data streams.

Changes

  • Created unit tests for both ongoing_motion_in_loc_df and tracking_restarted_in_loc_df functions
  • Added synthetic data tests (first two tests) that verify all edge cases (events before/between/after location points)
  • Implemented a real-world test using shankari reboot data as that is the perfect place to test restart checking

Testing

Ran and passed. Test output includes detailed logging of how timestamps map to indices, providing clear examples:
Restart timestamp 1673851361.154 maps to location index 29 with ts 1673916151.673

see:
e-mission/e-mission-docs#1105 (comment)

introduces a new test suite, `TestRestartChecking`, which includes  unit tests for the `ongoing_motion_in_loc_df` and `tracking_restarted_in_loc_df` functions. The tests cover various scenarios, including empty dataframes, motion timestamps relative to location points, and real example data with transitions. The tests ensure the correctness of the restart checking logic in the analysis module.
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be under analysisTests.intakeTests

@TeachMeTW TeachMeTW marked this pull request as ready for review May 13, 2025 20:10
@shankari shankari force-pushed the master branch 4 times, most recently from a2a9a44 to e50e9f3 Compare June 4, 2025 15:34
@shankari shankari force-pushed the master branch 3 times, most recently from cd45974 to 30c4273 Compare September 5, 2025 21:19
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.

2 participants