npsolve.cache module

Created on Wed Aug 7 07:06:54 2019

@author: Reuben

Simple caching inspired by functools.lru_cache.

Sometimes, Partial instances may need to call each other (via a fastwire fetch is a good method). Caching allows a way to reuse the computations for each step if needed, to avoid having to double-up in those cases.

npsolve.cache.mono_cached()

A cache method that only considers the ‘self’ argument

This works very similar to multi-cache but doesn’t use the make_key function from functools to save a little bit of time.

npsolve.cache.multi_cached()

A cache method that considers arguments