-
Notifications
You must be signed in to change notification settings - Fork 171
Add ability to replay tracks #1208
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
base: main
Are you sure you want to change the base?
Conversation
9cc818e to
cea92aa
Compare
cea92aa to
f558899
Compare
stonesoup/feeder/track.py
Outdated
| track_states = [state for state in track if state.timestamp <= time] | ||
| current_track = output_tracks.get(track, Track()) | ||
| current_track.states = track_states | ||
| output_tracks[track] = current_track |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think it would be good to include metadata as well as the track id.
Could possibly break for loop early on assumption that track should be time ordered?
Could probably make this more efficient as well by maintaining and iterator for each track and only consuming and appending new states...but that's getting bit more complex, and probably something to revisit if performance is an issue.
| track_states = [state for state in track if state.timestamp <= time] | |
| current_track = output_tracks.get(track, Track()) | |
| current_track.states = track_states | |
| output_tracks[track] = current_track | |
| track_states = [] | |
| track_metadatas = [] | |
| for state, metadata in zip(track.states, track.metadatas): | |
| if state.timestamp <= time: | |
| track_states.append(state) | |
| track_metadatas.append(metadata) | |
| current_track = output_tracks.setdefault( | |
| track, Track(id=track.id, init_metadata=track.init_metadata)) | |
| current_track.states = track_states | |
| current_track.metadatas = track_metadatas |
Co-authored-by: Steve Hiscocks <[email protected]> Co-authored-by: Chris Sherman <[email protected]>
f558899 to
900223f
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1208 +/- ##
==========================================
- Coverage 94.54% 94.53% -0.02%
==========================================
Files 232 232
Lines 16525 16564 +39
Branches 2338 2346 +8
==========================================
+ Hits 15623 15658 +35
- Misses 605 609 +4
Partials 297 297
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
TrackFeederclass.ReplayTrackFeederclass to take a set of tracks and re-feed them.