StepCache#
Base class#
- class tango.step_cache.StepCache[source]#
This is a mapping from instances of
Stepto the results of that step. GenerallyStepCacheimplementations are used internally byWorkspaceimplementations.- __contains__(step)[source]#
This is a generic implementation of
__contains__. If you are writing your ownStepCache, you might want to write a faster one yourself.- Return type:
- abstract __setitem__(step, value)[source]#
Writes the results for the given step. Throws an exception if the step is already cached.
- Return type:
- default_implementation: Optional[str] = 'memory'#
The default implementation is
MemoryStepCache.
Implementations#
- class tango.step_caches.LocalStepCache(dir)[source]#
This is a
StepCachethat stores its results on disk, in the location given indir.Every cached step gets a directory under
dirwith that step’sunique_id. In that directory we store the results themselves in some format according to the step’sFORMAT, and we also write acache-metadata.jsonfile that stores theCacheMetadata.The presence of
cache-metadata.jsonsignifies that the cache entry is complete and has been written successfully.Tip
Registered as
StepCacheunder the name “local”.