-
Notifications
You must be signed in to change notification settings - Fork 141
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
Trackers are Iterables instead of Generators #415
Conversation
@sdhiscocks I've added a generator method (with a deprecation warning) into the base tracker so that the tracker will function as normal. This is so people's code doesn't (hopefully) break straight away |
If we are going to make a change, we should probably extend this to all other classes that use the I think migrating to making these classes iterators (and thinking iterator rather than iterable to be clear on distinction) is good idea. This is more standard approach than using On key element of iterators, is subsequent calls to |
This removes the tracks_gen() method on Tracker classes, but instances are iterable the same as BufferedGenerator version.
935ae00
to
5358490
Compare
Codecov Report
@@ Coverage Diff @@
## main #415 +/- ##
==========================================
- Coverage 94.37% 94.34% -0.03%
==========================================
Files 154 154
Lines 7443 7463 +20
Branches 1414 1409 -5
==========================================
+ Hits 7024 7041 +17
- Misses 315 317 +2
- Partials 104 105 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
The trackers have been turned into iterables instead of generators. This allows trackers to be copied/ manipulated while producing tracks if needed.
Instead of
for time, tracks in tracker.tracks_gen():
you now write
for time, tracks in tracker:
There should be no other changes to how the trackers function