-
Notifications
You must be signed in to change notification settings - Fork 84
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
[BUG] - Fix update of epoch_tags store #1521
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1521 +/- ##
==========================================
+ Coverage 90.52% 90.53% +0.01%
==========================================
Files 25 25
Lines 2460 2463 +3
Branches 456 458 +2
==========================================
+ Hits 2227 2230 +3
Misses 148 148
Partials 85 85
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thanks for the bug fix! |
Merging of this PR is currently blocked because flake8 checks are failing in file not modified by this PR. This appears to be due to tests running a newer version of flake8. I've created #1524 to fix those issues. Once that PR has been merged we can sync this PR with dev and merge. |
Looking at
Separately, the @TomDonoghue are you using this field, and if so, how are you using it? |
@rly - I am not actively using this field - I stumbled onto this bug a while ago when I was exploring different ways to store event information (I ended up not actively using epochs). As far as I understand how it's working (having not gone too deep into this), I agree with your notes here that In terms of type, I'm not clear on if / how |
OK. Good to know, thanks. In Lines 317 to 318 in d75cc82
However, given its limited usefulness and potential confusion, I am inclined to raise a warning when it is used to say that 1) this variable is not stored on disk, 2) it is not populated on read, 3) it may be incorrect if epochs are added not through methods on |
@rly if
I think the above would address both of the concerns with the current approach? |
@rly - just wanted to follow up here - is this still relevant / useful, or should I close this PR as out of date? |
I believe this was addressed with this PR: #1935. Please reopen if not. |
Motivation
This addresses #1449
The way that
epoch_tags
was updated before didn't play well with strings, which should be a supported input. Sinceepoch_tags
is a set, adding a string gets treated as an iterable, which then separates and adds each character.This PR fixes this section to check the types of the tags, and deal with them if they are a string.
Note that the string processing line is a direct copy of
pynwb.epoch
line 47, to make sure strings are processed the same, and that epoch_tags properly supports the possible input of something like'label1, label2'
.How to test the behavior?
There is example code that shows the problem in #1449. I check that this same code when tested against this PR works as it should.
Checklist
flake8
from the source directory.