Skip to content

Conversation

@csherman-dstl
Copy link
Contributor

  • Add base TrackFeeder class.
  • Add ReplayTrackFeeder class to take a set of tracks and re-feed them.

@csherman-dstl csherman-dstl requested a review from a team as a code owner August 6, 2025 14:50
@csherman-dstl csherman-dstl requested review from sdhiscocks and timothy-glover and removed request for a team August 6, 2025 14:50
Comment on lines 79 to 82
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
Copy link
Member

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.

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

@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

❌ Patch coverage is 88.63636% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.53%. Comparing base (8e93a1f) to head (900223f).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
stonesoup/feeder/track.py 88.88% 3 Missing and 1 partial ⚠️
stonesoup/feeder/base.py 80.00% 1 Missing ⚠️
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              
Flag Coverage Δ
integration 67.26% <38.63%> (-0.08%) ⬇️
unittests 91.85% <88.63%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

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