forked from M-Labs/artiq
environment: add get_dataset_metadata
This commit is contained in:
parent
748707e157
commit
337273acb6
|
@ -420,6 +420,24 @@ class HasEnvironment:
|
||||||
else:
|
else:
|
||||||
return default
|
return default
|
||||||
|
|
||||||
|
def get_dataset_metadata(self, key, default=NoDefault):
|
||||||
|
"""Returns the metadata of a dataset.
|
||||||
|
|
||||||
|
Returns dictionary with items describing the dataset, including the units,
|
||||||
|
scale and precision.
|
||||||
|
|
||||||
|
This function is used to get additional information for displaying the dataset.
|
||||||
|
|
||||||
|
See ``set_dataset`` for documentation of metadata items.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
return self.__dataset_mgr.get_metadata(key)
|
||||||
|
except KeyError:
|
||||||
|
if default is NoDefault:
|
||||||
|
raise
|
||||||
|
else:
|
||||||
|
return default
|
||||||
|
|
||||||
def setattr_dataset(self, key, default=NoDefault, archive=True):
|
def setattr_dataset(self, key, default=NoDefault, archive=True):
|
||||||
"""Sets the contents of a dataset as attribute. The names of the
|
"""Sets the contents of a dataset as attribute. The names of the
|
||||||
dataset and of the attribute are the same."""
|
dataset and of the attribute are the same."""
|
||||||
|
|
Loading…
Reference in New Issue