New features
- Improve [`holder.get_memory_usage`]((https://openfisca.org/doc/openfisca-python-api/holder.html#openfisca_core.holders.Holder.get_memory_usage)):
- Add `nb_requests` and `nb_requests_by_array` fields in the memory usage stats for traced simulations.
- Enable intermediate data storage on disk to avoid memory overflow
- Introduce `memory_config` option in `Simulation` constructor
- This allows fine tuning of memory management in OpenFisca
For instance:
from openfisca_core.experimental import MemoryConfig
simulation = ... create a Simulation object
config = MemoryConfig(
max_memory_occupation = 0.95, When 95% of the virtual memory is full, switch to disk storage
priority_variables = ['salary', 'age'], Always store these variables in memory
variables_to_drop = ['age_elder_for_family_benefit'] Do not store the value of these variables
)
simulation.memory_config = config