pastas.decorators.temporarily_enable_cache#

pastas.decorators.temporarily_enable_cache()#

Context manager to temporarily enable caching.

Examples

To temporarily enable the cache:

>>> with ps.temporarily_enable_cache():
>>>     # Caching is enabled within this block
>>>     ml.simulate()

Alternatively you can use the ps.options.cache attribute directly to enable or disable caching as needed:

>>> ps.options.cache = True   # Enable caching
>>> ml.simulate()
>>> ps.options.cache = False  # Disable caching