torchsig.utils.printing.dataset_metadata_str¶
- torchsig.utils.printing.dataset_metadata_str(dataset_metadata, max_width: int = 100, first_col_width: int = 29, array_width_indent_offset: int = 2) str[source]¶
Custom string representation for the class.
This method returns a formatted string that provides a detailed summary of the object’s key attributes, including signal parameters, dataset configuration, and transform details. It uses textwrap.fill to format long attributes such as lists or arrays into a neatly wrapped format for easier readability.
The string includes information on the dataset’s configuration, signal characteristics, transformations, and other attributes in a human-readable way. The result is intended to provide a concise yet comprehensive overview of the object’s state, useful for debugging, logging, or displaying object details.
- Parameters:
dataset_metadata (Any) – The dataset metadata object to generate a string for.
max_width (int, optional) – Maximum width of the output string. Defaults to 100.
first_col_width (int, optional) – Width of the first column in the output string. Defaults to 29.
array_width_indent_offset (int, optional) – Indentation offset for array-like attributes. Defaults to 2.
- Returns:
A formatted string that represents the object’s attributes in a readable format.
- Return type:
- Example Output:
` MyClass ---------------------------------------------------------------------------------------------------- num_iq_samples_dataset 1000 fft_size 512 sample_rate 1000.0 num_signals_min 1 num_signals_max 5 num_signals_distribution [0.2, 0.3, 0.5] snr_db_min 5.0 snr_db_max 30.0 signal_duration_min 0.001 signal_duration_max 0.01 signal_bandwidth_min 10 signal_bandwidth_max 100 signal_center_freq_min -10 signal_center_freq_max 10 class_list [Class1, Class2, Class3] class_distribution [0.3, 0.4, 0.3] seed 42 `