The Take approach currently requires that both the DomainGeometry values (arr, att, art, detDF) and the density profile are cached together. This was done for implementation convenience — having everything precomputed and readily accessible.
However, caching the density profile at every grid point can be trivially avoided to reduce the memory footprint if desired. The density profile should therefore be made optionally computable at runtime rather than always stored.
Proposed change:
- The Take approach should only assume that the
DomainGeometry quantities (arr, att, art, detDF) are cached.
- The density profile should be recomputed on-the-fly when a user opts out of caching it, trading memory for compute.
- This can be controlled via a configuration flag (e.g.,
cache_density_profile = true/false).
This makes the Take approach more flexible and allows it to be used in memory-constrained settings without changing its fundamental character.
The Take approach currently requires that both the
DomainGeometryvalues (arr,att,art,detDF) and the density profile are cached together. This was done for implementation convenience — having everything precomputed and readily accessible.However, caching the density profile at every grid point can be trivially avoided to reduce the memory footprint if desired. The density profile should therefore be made optionally computable at runtime rather than always stored.
Proposed change:
DomainGeometryquantities (arr,att,art,detDF) are cached.cache_density_profile = true/false).This makes the Take approach more flexible and allows it to be used in memory-constrained settings without changing its fundamental character.