exa.common.sweep.database_serialization.decode_return_parameters

exa.common.sweep.database_serialization.decode_return_parameters#

decode_return_parameters(json_str)#

Deserialize return parameters.

For backwards compatibility, changes values of the return parameters dict to a new, more general format: NdSweeps, which is a list of tuples of Sweeps.

Return parameters JSON syntax: [{"parameter": readout_parameter_json, "hard_sweeps": [hard_sweep,...]}, ...].

readout_parameter_json may be a Parameter or a Setting; both will be converted to a Parameter. hard_sweeps are converted with the following rules:

  • 1 is converted to an empty NdSweep, i.e., a scalar.

  • Other integers are converted to a linear_index_sweep()

  • Sweep is converted to an NdSweep that contains only the sweep

  • NdSweep and None are not converted.

Parameters:

json_str (str) – JSON representation of the return_parameters loaded from e.g. persistence

Returns:

a reconstituted, typed return_parameters structure

Return type:

dict[Parameter, list[tuple[Sweep, …]] | None]