Skip to content

Conversation

legouee
Copy link
Contributor

@legouee legouee commented Dec 7, 2021

No description provided.

@JuliaSprenger JuliaSprenger changed the title Add a warning to avoid signals with the same name [NWBIO] Add a warning to avoid signals with the same name Jan 10, 2022
@JuliaSprenger
Copy link
Member

Hi @legouee,
sorry for the failing tests, we fixed those in master. If you rebase or pull from there and the test in your PR should hopefully also succeed and I can merge.

@JuliaSprenger
Copy link
Member

Hi @legouee I rebased your branch on the current master. Can you check all your changes are still as you intended them?

@legouee
Copy link
Contributor Author

legouee commented Jan 25, 2022

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)
Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

@pep8speaks
Copy link

pep8speaks commented Jan 25, 2022

Hello @legouee! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-01-25 15:38:26 UTC

@JuliaSprenger
Copy link
Member

Looks good to me now. Thanks for the fix!

@JuliaSprenger JuliaSprenger merged commit 2e00c99 into NeuralEnsemble:master Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants