Manual
To cache a funtion or class attribute, you can use the pycachera.cache() decorator:
- cache(cachefolder=None, extrarg=None, cachekey=None, verbose=False, recache=False, with_mpi=False)
- Parameters:
cachefolder (str) – (Optional)The cache folder is set to ‘.cache’ as default in the current working directory
extrarg (list) – (Optional)If the function is a class method, you can give the extra arguments of the class as a list just for saving the cache
cachekey (str) – (Optional) You can override the above method by giving a particular human readable key(str) for example: ‘This is a function with fknee is 5, and alpha is 3’
verbose (bool) – (Optional) To print the info
recache (bool) – (Optional) If you want to recache the function, set it to True
with_mpi (bool) – (Optional) If you want to use the cache with mpi, set it to True