npsolve.legacy.legacy_cache module

Created on Wed Aug 7 07:06:54 2019

@author: Reuben

This module is deprecated and will be removed in a future version!

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.legacy.legacy_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.legacy.legacy_cache.multi_cached()

A cache method that considers arguments