Skip to content

[Feature]: Behavior when adding multiple tags to a time interval #2059

Open
@stephprince

Description

@stephprince

What would you like to see added to PyNWB?

This issue came up in this discussion: #2031 (comment).

Currently multiple tags can be added to an interval as a single string separated by commas. These tags will be parsed into 3 different strings.

from pynwb.epoch import TimeIntervals
from pynwb.testing.mock.file import mock_NWBFile

nwbfile = mock_NWBFile()

test_epochs = TimeIntervals(name='test_epochs')
test_epochs.add_interval(start_time=1.0, stop_time=10.0, tags='tag1')
test_epochs.add_interval(start_time=10.0, stop_time=20.0, tags='tag1, tag2, tag3')
nwbfile.add_time_intervals(test_epochs)

print(nwbfile.intervals['test_epochs']['tags'][:])  # [['tag1'], ['tag1', 'tag2', 'tag3']]

It seems like this approach could be prone to misunderstandings on how the tags are written to the file. Is there a case where providing a single string is preferred over providing a list of strings?

Is your feature request related to a problem?

No response

What solution would you like?

Remove the automatic splitting of tags

Do you have any interest in helping implement the feature?

Yes.

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    category: proposalproposed enhancements or new featurespriority: lowalternative solution already working and/or relevant to only specific user(s)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions