tof.utils.var_from_dict#

tof.utils.var_from_dict(data, dim=None)[source]#

Convert a dictionary with ‘value’ and ‘unit’ keys to a scipp Variable.

Parameters:
  • data (dict) – The dictionary to convert.

  • dim (str | None, default: None) – The dimension of the output variable (non-scalar data only).

Return type:

Variable