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

fetch afferent_section_pos from sonata #168

Merged
merged 5 commits into from
Apr 26, 2024
Merged

fetch afferent_section_pos from sonata #168

merged 5 commits into from
Apr 26, 2024

Conversation

anilbey
Copy link
Contributor

@anilbey anilbey commented Apr 22, 2024

Spotted by @joni-herttuainen. When afferent_section_pos is not in SONATA, it is computed in BCL and this can cause small precision differences. This change avoids recomputing it when it is already available in SONATA.

@anilbey anilbey marked this pull request as ready for review April 26, 2024 09:44
Copy link
Contributor

@ilkilic ilkilic left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good to me

@anilbey anilbey merged commit 187fce6 into main Apr 26, 2024
10 checks passed
@anilbey anilbey deleted the sonata branch April 26, 2024 09:58
@joni-herttuainen
Copy link

joni-herttuainen commented Apr 29, 2024

I believe that for this change to take effect in SynapseFactory, we need to change the following starting in synapse_factory.py:L117:

@@ -114,10 +114,10 @@ class SynapseFactory:
         section: NeuronSection = cell.get_psection(section_id=isec).hsection
 
         # old circuits don't have it, it needs to be computed via synlocation_to_segx
-        if ("afferent_section_pos" in syn_description and
-                not np.isnan(syn_description["afferent_section_pos"])):
+        if (SynapseProperty.AFFERENT_SECTION_POS in syn_description and
+                not np.isnan(syn_description[SynapseProperty.AFFERENT_SECTION_POS])):
             # position is pre computed in SONATA
-            location = syn_description["afferent_section_pos"]
+            location = syn_description[SynapseProperty.AFFERENT_SECTION_POS]
         else:
             ipt = syn_description[SynapseProperty.POST_SEGMENT_ID]
             syn_offset = syn_description[SynapseProperty.POST_SEGMENT_OFFSET]

@anilbey
Copy link
Contributor Author

anilbey commented Apr 29, 2024

Yes you're right. That must have gone unnoticed. A patch will follow.

@joni-herttuainen
Copy link

No worries, that happens. Thanks! 🤘

@anilbey
Copy link
Contributor Author

anilbey commented Apr 30, 2024

It's addressed here: #169

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