Investigate the usage of `cached_property` for `materialize` and `is_materialized` in `VirtualArray`
Perhaps this is a good candidate for https://docs.python.org/3/library/functools.html#functools.cached_property
Originally posted by @agoose77 in https://github.com/scikit-hep/awkward/pull/3364#discussion_r2002974502
Related comment: https://github.com/scikit-hep/awkward/pull/3364#discussion_r2002976282
I'm not a big fan of this. We want the option to potentially dematerialize arrays to free up memory. We can now do so by clearing up the _array attribute. My understanding is that cached_property is evaluated once and then cached forever no?
I'm not a big fan of this. We want the option to potentially dematerialize arrays to free up memory. We can now do so by clearing up the
_arrayattribute. My understanding is thatcached_propertyis evaluated once and then cached forever no?
Awkward Arrays are immutable by design. I don't think, it is a good idea to cleanup their data buffers. It should be quite inexpensive to make a "virtual" array copy, if needed.