qcodes.utils.metadata

class qcodes.utils.metadata.Metadatable(metadata=None)[source]

Bases: object

load_metadata(metadata: Dict[Any, Any]) None[source]

Load metadata into this classes metadata dictionary.

Parameters

metadata – Metadata to load.

snapshot(update: Optional[bool] = False) Dict[Any, Any][source]

Decorate a snapshot dictionary with metadata. DO NOT override this method if you want metadata in the snapshot instead, override snapshot_base().

Parameters

update – Passed to snapshot_base.

Returns

Base snapshot.

snapshot_base(update: Optional[bool] = False, params_to_skip_update: Optional[Sequence[str]] = None) Dict[Any, Any][source]

Override this with the primary information for a subclass.

class qcodes.utils.metadata.ParameterDiff(left_only, right_only, changed)[source]

Bases: tuple

Create new instance of ParameterDiff(left_only, right_only, changed)

property left_only

Alias for field number 0

property right_only

Alias for field number 1

property changed

Alias for field number 2

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

qcodes.utils.metadata.diff_param_values(left_snapshot: Dict[str, Any], right_snapshot: Dict[str, Any]) qcodes.utils.metadata.ParameterDiff[source]

Given two snapshots, returns the differences between parameter values in each.

qcodes.utils.metadata.diff_param_values_by_id(left_id: RunId, right_id: RunId) qcodes.utils.metadata.ParameterDiff[source]

Given the IDs of two datasets, returns the differences between parameter values in each of their snapshots.

qcodes.utils.metadata.extract_param_values(snapshot: Dict[str, Any]) Dict[Union[str, Tuple[str, str]], Any][source]

Given a snapshot, returns a dictionary from instrument and parameter names onto parameter values.