Skip to content

Bug-in-waiting: picking layer names #320

@tlambert03

Description

@tlambert03

There is a bug just waiting to happen in _mda_handler.

The layer is initially created with a name constructed manually as f"{fname}_{id_}" here:

fname = meta.file_name if meta.should_save else "Exp"
self._create_empty_image_layer(z, f"{fname}_{id_}", sequence, **kwargs)

and then that key is recreated (manually) for the purpose of looking up the layer in the viewer here:

# the name of this layer in the napari viewer
layer_name = f"{prefix}_{event.sequence.uid}{suffix}"

if either of those were ever changed, we'd have an issue. There should be one function that constructs a layer name, and that one function should always be used when retrieving the expected layer name

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions