-
Notifications
You must be signed in to change notification settings - Fork 261
[NWBIO] Add a warning to avoid signals with the same name #1054
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
Conversation
Hi @legouee, |
afde97a
to
db25dd8
Compare
Hi @legouee I rebased your branch on the current master. Can you check all your changes are still as you intended them? |
Hi @JuliaSprenger Thank you very much for your review. I added your comments to the code. |
neo/io/nwbio.py
Outdated
signal.name = "%s %s %i" % (signal.name, segment.name, i) | ||
logging.warning("Warning signal name exists. New name: %s" % (signal.name)) | ||
else: | ||
signal.name = "%s : analogsignal%d %i" % (segment.name, i, i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional that you compose the names differently for existing and non-existing name attributes? Wouldn't it make sense to always use a 'segment signal idx' ordering in the name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and the same of course also for events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that was intentional as I ran into problems with the signal name and the event name when testing with NWB files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I understand why you want to re-compose the signal name in some cases. I was rather wondering if it would make sense for both names (newly generated, as well as composed) to follow a similar structure, e.g. consist of 3 parts: 1st the segment info, 2nd the signal info (potentially the old signal name) and 3rd the enumeration. This would make the signal names more consistent independent if a name already existed previously or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I think you are right. It will be more consistent if the names have a similar structure.
I just made the changes.
3a40053
to
8f28a23
Compare
Looks good to me now. Thanks for the fix! |
No description provided.