feat: ability to optionally disable the caching of virtual arrays on themselves#3741
Merged
pfackeldey merged 15 commits intoscikit-hep:mainfrom Dec 9, 2025
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
|
The documentation preview is ready to be viewed at http://preview.awkward-array.org.s3-website.us-east-1.amazonaws.com/PR3741 |
pfackeldey
requested changes
Nov 25, 2025
Collaborator
pfackeldey
left a comment
There was a problem hiding this comment.
@ikrommyd please find my review in the ak.from_buffers changes :)
TaiSakuma
reviewed
Nov 26, 2025
pfackeldey
approved these changes
Nov 27, 2025
Collaborator
pfackeldey
left a comment
There was a problem hiding this comment.
Thanks @ikrommyd, this looks good to me.
Collaborator
|
Thanks @ikrommyd, all requests have been addressed and I've successfully used this branch locally in various tests already. I'm going to merge this one 👍 |
ikrommyd
added a commit
to ikrommyd/awkward
that referenced
this pull request
Dec 9, 2025
…themselves (scikit-hep#3741) * option to disable virtual caching * do it properly * make function accept form_key too * change argument order * add docstring * use the form's form_key before getkey runs * disable -> enable change * add test * check that we can rematerialize the array a second time too * add new option to the slots
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows us to disable the caching of the materialized array on the virtual array object.
The virtual arrays will still be aware of their generators and be able to materialize again (they just need to call the generator again).
The option is passed through
from_bufferswhich is currently the only publicly exposed way to create virtual arrays.We also have the freedom with this PR to disable the caching only for specific types of buffers. You may want to keep it for offsets only for example but disable it for all the contents. This PR lets you do that.
The reason for this PR is to enable us the ability to handle caching outside of awkward and be able to handle memory and clean up loaded arrays if we want to. This becomes important in low memory workers where you may have needed to materialize some branches at the beginning of the analyses to do a couple of cuts but you don't need them anymore and want to "dematerialize" them to free up memory.
@pfackeldey this is in line with what we discussed regarding what options to allow and what not.