[WIP]: viz functions for between-layer current exchange #1192
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @asoplata
a very rough draft right now, will add docstrings, and ofcourse tests(!) later
this is in ref: #1128
for the "Cartesian product" of the elements
i set the sources as drives + cell types and for the targets, cell types only, as drives can't receive current? mentioned it as a temp comment in the code too
Added two new viz funcs for analyzing synaptic current dynamics in networks, sprinkled in the use of metadata here
plot_current_exchange(): matrix view of currents between all source-target pairs (drives + cells → cells)plot_layer_comparison(): aggregates layer-wise current flow (L2/L5 + drives → L2/L5)added a few helper functions for this
_aggregate_connection_currents(): aggregates synaptic currents by(src_type, target_type)pairs_get_layer_groups(): extracts layer groups from metadata {maybe it need not be a seperate function, i can use it directly as code chunk in plot_layer_comparison too, used it as a style of helper functions like __lighten_color, __decimate_plot_data, etc, if there is scope for reuse in future funcs}i followed the viz's function style to have Normalize option (0-1 scale or absolute), inspired from the existing plot_drive_strength function
I validated on Jones 2009 model with 3 drives (evdist1, evprox1, evprox2)