waveform_editor.configuration.WaveformConfiguration¶
- class waveform_editor.configuration.WaveformConfiguration¶
Bases:
Parameterized- __init__()¶
Methods
__init__()add_group(name, path)Adds a new waveform group at the specified path.
add_waveform(waveform, path)Adds a waveform to a specific group in the configuration.
check_safe_to_replace(waveform)Validate that a waveform is safe to replace.
clear()Clears the data stored in the configuration.
dump()Convert the configuration to a YAML string.
load_yaml(yaml_str)Parses a YAML string and populates configuration.
parse_waveform(yaml_str)Parse a YAML waveform string and return a waveform object.
print([indent])Prints the waveform configuration as a hierarchical tree.
remove_group(path)Removes a group, and all the groups/waveforms in it.
remove_waveform(name)Removes an existing waveform.
rename_waveform(old_name, new_name)Renames an existing waveform.
replace_waveform(waveform)Replaces an existing waveform with a new waveform.
traverse(path)Traverse through nested groups and return the WaveformGroup at the given path.
Attributes
DEFAULT_ENDDEFAULT_STARThas_changednameparam- check_safe_to_replace(waveform)¶
Validate that a waveform is safe to replace.
- Parameters:
- waveform¶
The waveform to validate for replacement.
- clear()¶
Clears the data stored in the configuration.
- dump()¶
Convert the configuration to a YAML string.
- load_yaml(yaml_str)¶
Parses a YAML string and populates configuration.
- Parameters:
- yaml_str¶
The YAML string to load YAML for.
- parse_waveform(yaml_str)¶
Parse a YAML waveform string and return a waveform object.
- Parameters:
- yaml_str¶
The YAML string to parse.
- Returns:
The parsed waveform object.
-
print(indent=
0)¶ Prints the waveform configuration as a hierarchical tree.
- Parameters:
- indent=
0¶ The indentation level for formatting the output.
- indent=
- remove_group(path)¶
Removes a group, and all the groups/waveforms in it.
- Parameters:
- path¶
A list representing the path to the group to be removed.
- remove_waveform(name)¶
Removes an existing waveform.
- Parameters:
- name¶
The name of the waveform to be removed.