Skip to content

Tests for restart checking analysis #1069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
Contributor

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
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