Skip to content

Maintain backward compatibility for spike event variables in create_variables #1617

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

maverick4code
Copy link
Contributor

@maverick4code maverick4code commented Apr 7, 2025

This pull request updates the create_variables function to special case the spike event. This is to maintain backward compatibility and prevent breaking user's existing code, as discussed in #1617.

@mstimberg
Copy link
Member

Hi @maverick4code. Could you please turn this PR into a draft to signal that it is not ready for merging yet? Also, please edit the title/description to mention what it is about and include a link to the issue.

Regarding the content: for create_variables, could you please special case the spike event so that it keeps the same variable names as before (e.g. not_refractory instead of not_refractory_spike), and does not add the more generic names? This is less consistent, but changing those names could break some users' code.

@maverick4code maverick4code marked this pull request as draft April 11, 2025 14:02
@maverick4code maverick4code changed the title Update neurongroup.py Maintain backward compatibility for spike event variables in create_variables Apr 11, 2025
@maverick4code
Copy link
Contributor Author

@mstimberg Are the changes correct ?

@De-Cri
Copy link
Contributor

De-Cri commented Apr 15, 2025

Hi @maverick4code, in the meanwhile you wait for the pr to be checked you might want to check out the black formatting tool, since I see here it's giving you an error, which can help before you commit something 😄 . https://brian2.readthedocs.io/en/stable/developer/guidelines/style.html#code-style

@mstimberg
Copy link
Member

Hi @maverick4code. From what I can see, the code still adds a not_refractory_spike variable in addition to the not_refractory variable that is kept for background compatibility. I would also not have the unless refractory flag be responsible to all event types, but rather only to the spike event. We might extend the syntax later. Having said all this, I cannot run your current branch, since there are indentation errors in neurongroup.py – these need to be fixed first.

PS: This is a minor issue since I know what this PR is about, but the current title and description is not describing what the PR is aiming for (which would be "Refractoriness for custom events"), but rather describes the latest changes to this PR. Also, it links to itself instead of to #868.

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