bexchange.storage package¶
Submodules¶
bexchange.storage.storages module¶
- class bexchange.storage.storages.file_storage(name, backend, **kwargs)[source]¶
Bases:
storage
A basic file storage that allows separation of files based on object types. A typical structure passed to kwargs would be
- “structure”: [
- { “object”:”SCAN”,
“path”:”/tmp/baltrad_bdb”, “name_pattern”:”${_baltrad/datetime_l:15:%Y/%m/%d/%H/%M}/${_bdb/source:NOD}_${/what/object}.tolower()_${/what/date}T${/what/time}Z_${/dataset1/where/elangle}.h5”
}, { “path”:”/tmp/baltrad_bdb”,
“name_pattern”:”${_baltrad/datetime_l:15:%Y/%m/%d/%H/%M}/${_bdb/source:NOD}_${/what/object}.tolower()_${/what/date}T${/what/time}Z.h5”
}]
- class bexchange.storage.storages.file_store(path, name_pattern, naming_operations=[], simulate=False, keep_same_name=False)[source]¶
Bases:
object
- class bexchange.storage.storages.none_storage(name, backend, **kwargs)[source]¶
Bases:
storage
Simple storage that does nothing
- class bexchange.storage.storages.simple_rotating_file_storage(name, backend, **kwargs)[source]¶
Bases:
storage
A very simple rotating file storage that keeps a limited number of files in a single folder. The files will get two different names. Either: ${_baltrad/source_name}_scan_${/dataset1/where/elangle}_${/what/date}T${/what/time}.h5 - for scans ${_baltrad/source_name}_${/what/object}.tolower()_${/what/date}T${/what/time}.h5 - for any other file type NOTE! The number of files can be set to a maximum of 500
- get_attribute_value(name, meta)[source]¶
- Parameters:
name – Name of attribute
meta – Metadata from where value for name should be taken
- Returns:
the value for the name or None if not found
- class bexchange.storage.storages.storage_manager[source]¶
Bases:
object
The storage manager
- add_storage(storage)[source]¶
Adds a storage instance to the internal list :param storage: The created storage that is a subclass of bexchange.storage.storages.storage
- classmethod create_storage(clz, name, backend, extra_arguments)[source]¶
Creates an instance of clz with specified arguments :param clz: class name specified as <module>.<classname> :param arguments: a list of arguments that should be used to initialize the class
- classmethod from_conf(config, backend)[source]¶
Creates a storage from the specified configuration if it is possible
- Parameters:
config – A runner config pattern. Should at least contain the following
- { “class”:”<packagename>.<classname>”,
“name”:<name of storage>, “arguments”:{}”
}
- get_storage(name)[source]¶
- Parameters:
name – Name of the storage
- Returns:
the storage with provided name