Decorator for reporting progress of given function
str) – Message to display (prefixed by ‘Starting ‘, progress percentage and then ‘Finished ‘
Inspiration from : https://gist.github.com/Garfounkel/20aa1f06234e1eedd419efe93137c004
Storage of data and metadata, with methods to allow derived data to be calculated only when accessed.
Staorage for data and metadata, keyed by data name. Each item is a dict with at least a data key, all other items are metadata, possibly including:
- Type of data stored:
map - at least a 2-axis array, trailing axes are spatial
Tensor order of the data
Measurement unit the data is stored in
Dictionary of the default paramenters used to plot
dict of dict
Methods to generate derived data, keyed by tuple of data names that the method produces.
Get the names of all data items. Allows use of **datastore to get key-value pairs, imitating functionality of a dictionary.
add(key, data, **kwargs)¶
Add an item to the datastore.
add_generator(keys, func, metadatas=None, **kwargs)¶
Add a data generator method that produces one or more data.
keys (str or tuple of str) – Name(s) of data that the generator produces.
func (callable) – Method that produces the data. Should return the same number of values as there are keys.
metadatas (list of dict) – Metadata dicts for each of data items produced.
kwargs (dict) – Key-value pairs stored as the items metadata for every data item produced.
Generate data from the associated data generation method and store if metadata save is not set to False.
key (str) – Name of the data to generate.
- Return type:
Requested data after generating.
Update with data items stored in other.
get_metadata(key, attr, value=None)¶
Get metadata value with a default returned if it does not exist. Imitating the get() method of a dictionary.