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_END

DEFAULT_START

has_changed

name

param

add_group(name, path)

Adds a new waveform group at the specified path.

Parameters:
name

The name of the new group.

path

A list representing the path where the new group should be added.

Returns:

The newly created waveform group.

add_waveform(waveform, path)

Adds a waveform to a specific group in the configuration.

Parameters:
waveform

The waveform object to add.

path

A list representing the path where the new waveform should be created.

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.

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.

rename_waveform(old_name, new_name)

Renames an existing waveform.

Parameters:
old_name

The name of the waveform to rename.

new_name

The name to rename the old waveform to.

replace_waveform(waveform)

Replaces an existing waveform with a new waveform.

Parameters:
waveform

The new waveform object to replace the old one.

traverse(path)

Traverse through nested groups and return the WaveformGroup at the given path.

Parameters:
path

List of strings containing the nested group names.


Last update: 2025-10-02