StepCache#
Base class#
- class tango.step_cache.StepCache[source]#
This is a mapping from instances of
Step
to the results of that step. GenerallyStepCache
implementations are used internally byWorkspace
implementations.- __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
StepCache
that stores its results on disk, in the location given indir
.Every cached step gets a directory under
dir
with 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.json
file that stores theCacheMetadata
.The presence of
cache-metadata.json
signifies that the cache entry is complete and has been written successfully.Tip
Registered as
StepCache
under the name “local”.