Skip to content
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

Replace memory addresses with UUIDs to enhance the uniqueness of template_name #210

Merged
merged 3 commits into from
Aug 20, 2024

Conversation

ilkilic
Copy link
Contributor

@ilkilic ilkilic commented Aug 20, 2024

Aims to address #209 by reducing template redefinition issues through the use of UUIDs instead of memory addresses. While not 100% collision-proof, this change improves uniqueness.

@ilkilic ilkilic self-assigned this Aug 20, 2024
@ilkilic
Copy link
Contributor Author

ilkilic commented Aug 20, 2024

@anilbey I cannot add you as a reviewer anymore but I would love to get your approval too if you have time

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.25%. Comparing base (5406434) to head (c270d0f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #210      +/-   ##
==========================================
+ Coverage   91.24%   91.25%   +0.01%     
==========================================
  Files          95       95              
  Lines        5708     5718      +10     
==========================================
+ Hits         5208     5218      +10     
  Misses        500      500              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@AurelienJaquier AurelienJaquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, but I don't really see the connection with the issue. Could you explain it to me, @ilkilic ? Have you tried to reproduce the issue and does this PR fix it?

@ilkilic
Copy link
Contributor Author

ilkilic commented Aug 20, 2024

When we construct the template we retrieve the memory address and use it as an id for the template_name, however this wasn't unique, leading to the error "a template cannot be redefined". I think Python was reusing the same memory address, which could happen because python's memory management allows addresses to be recycled when objects are created and destroyed. This likely caused neuron to encounter issues when running in the same context. I have just run the failing notebook again with this branch and it fixed the errors

@anilbey
Copy link
Contributor

anilbey commented Aug 20, 2024

Hi @ilkilic thanks a lot for addressing it. I agree UUIDs is the proper solution for this.

@ilkilic ilkilic merged commit d4b3597 into main Aug 20, 2024
9 checks passed
@ilkilic ilkilic deleted the template-uuid branch August 20, 2024 22:18
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.

4 participants