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

feat: add lazy and consumable subtype #61

Closed
MartinBernstorff opened this issue Jan 1, 2024 · 1 comment · Fixed by #136
Closed

feat: add lazy and consumable subtype #61

MartinBernstorff opened this issue Jan 1, 2024 · 1 comment · Fixed by #136
Assignees

Comments

@MartinBernstorff
Copy link
Owner

MartinBernstorff commented Jan 1, 2024

Currently, to avoid state, the main class copies the iterator on every invocation. This is very expensive memory-wise.

Grabbing inspiration from flupy is likely a good move.

I am most uncertain about how well we can replicate:

  • flatten

To decrease memory use, we can re-introduce the state by using generators. However, this creates a lot of non-functional behaviour. To separate this clearly, we might want to introduce ConsumableIter or similar.

@MartinBernstorff MartinBernstorff changed the title feat: convert to generators feat: add consumable subtype Jan 4, 2024
@MartinBernstorff
Copy link
Owner Author

This could be implemented by overriding the _iter property.

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