Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
stephprince opened this issue Mar 19, 2025 · 0 comments
Open
3 tasks done

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

stephprince opened this issue Mar 19, 2025 · 0 comments
Labels
category: proposal proposed enhancements or new features priority: low alternative solution already working and/or relevant to only specific user(s)

Comments

@stephprince
Copy link
Contributor

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

@stephprince stephprince added category: proposal proposed enhancements or new features priority: low alternative solution already working and/or relevant to only specific user(s) labels Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: proposal proposed enhancements or new features priority: low alternative solution already working and/or relevant to only specific user(s)
Projects
None yet
Development

No branches or pull requests

1 participant