Skip to content
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

Use itertools.cycle in SequentialTaskSet #2740

Closed
2 tasks done
bakhtos opened this issue May 27, 2024 · 0 comments · Fixed by #2742
Closed
2 tasks done

Use itertools.cycle in SequentialTaskSet #2740

bakhtos opened this issue May 27, 2024 · 0 comments · Fixed by #2742

Comments

@bakhtos
Copy link
Contributor

bakhtos commented May 27, 2024

Prerequisites

Description

Currently, SequentialTaskSet.get_next_task uses an index and module operation to loop over the same list in a cycle

task = self.tasks[self._task_index % len(self.tasks)]

It should be easy to replace this with itertools.cycle, which is a built in memory-efficient iterator for creating cycles over iterables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant