savu.data.meta_data moduleΒΆ

class MetaData(options={}, ordered=False)[source]

The MetaData class creates a dictionary of all meta data which can be accessed using the get and set methods. It also holds an instance of PluginList.

delete(entry)[source]

Delete an entry from the meta data dictionary.

Parameters

entry (str) – The dictionary key entry to delete.

get(maplist, setFlag=False, value=True, units=False)[source]

Get a value from the meta data dictionary, given its key(s).

Params maplist

Dictionary key(s).

Returns

Value from the dictionary corresponding to the given key(s)

Return type

value

Dictionaries within dictionaries are accessed by placing successive keys in a list.

get_dictionary()[source]

Get the meta_data dictionary.

Returns

A dictionary.

Return type

dict

set(name, value)[source]

Create and set an entry in the meta data dictionary.

Parameters
  • name (str or list(str)) – dictionary key(s). If name is a list then each successive name will become an entry in the dictionary which has the previous name as its key.

  • value (value) – dictionary value

For example,

>>> MetaDataObj.set(['name1', 'name2'], 3)
>>> MetaDataObj.get_dictionary()
{'name1': {'name2': 3}}