Formatter
Format text for printing in a readable way
build_title(title, path, params)
Build a plot title that includes the values of given parameters found in the params_dict.json file, e.g. One tone with I = 0.5 mA.
Parameters
title : str Title of the plot to which the parameters will be appended.
str
Path to the param_dict.json file.
List[str]
List of keys of parameters in the param_dict.json file.
Returns
str The original title followed by parameter values.
Source code in sqil_core/utils/formatter.py
format_number(num, precision=3, unit='', latex=True)
Format a number (or an array of numbers) in a nice way for printing.
Parameters
num : float | np.ndarray Input number (or array). Should not be rescaled, e.g. input values in Hz, NOT GHz precision : int The number of digits of the output number. Must be >= 3. unit : str, optional Unit of measurement, by default '' latex : bool, optional Include Latex syntax, by default True
Returns
str Formatted number
Source code in sqil_core/utils/formatter.py
get_name_and_unit(param_id)
Get the name and unit of measurement of a prameter, e.g. Frequency [GHz].
Parameters
param : str Parameter ID, as defined in the param_dict.json file.
Returns
str Name and [unit]