Storage
full name: tenpy.tools.cache.Storage
parent module:
tenpy.tools.cache
type: class
Inheritance Diagram
Methods
|
|
Close opened files, free memory and clean up temporary files/directories. |
|
|
Interface for cleaning up a previously saved data from disk in subclasses. |
|
Interface for loading data from disk in subclasses. |
|
|
|
Interface for preloading data into the given dictionary into. |
|
Interface for saving data to disk in subclasses. |
|
Create another instance of the same class saving in a subdirectory/subgroup. |
Class Attributes and Properties
Whether the storage is actually kept in memory, instead of saving to disk. |
- class tenpy.tools.cache.Storage[source]
Bases:
object
A container interface for saving data to disk.
Subclasses implement different methods for
save()
andload()
. The vanillaStorage
class is “trivial” in the sense that it actually doesn’t save the data to disk, but keeps explicit references in RAM.- trivial = True
Whether the storage is actually kept in memory, instead of saving to disk.
- subcontainer(name)[source]
Create another instance of the same class saving in a subdirectory/subgroup.
This method allows multiple
DictCache
instance re-using open resources. Subcontainers will explicitly be closed when any of the parent containers (on which subcontainer() was called) is closed.
- preload(key)[source]
Interface for preloading data into the given dictionary into.
Only overridden in
ThreadedStorage
for thread-parallelized pre-loading; in other cases it does nothing.