jonescompneurolab / hnn-core

Simulation and optimization of neural circuits for MEG/EEG source estimates
https://jonescompneurolab.github.io/hnn-core/
BSD 3-Clause "New" or "Revised" License
55 stars 52 forks source link

Clean up connectivity API and add tests #293

Closed ntolley closed 1 year ago

ntolley commented 3 years ago

This was raised by @rythorpe in #276. The current connectivity API allows for duplicates of the same connection when specified through net.add_connection(). Currently connectivity information is stored under net.connectivity as a list, so implementing this check would require looping through the entire list every time a new connection as added which seems like an unnecessary overhead. I think this check will require converting net.connectivity to easily lookup/index existing connections between cells.

Another much needed check is ensuring valid cell-cell connections are specified. Currently invalid connection types (inhibitory synapses on L2 proximal/distal dendrites for example) only throw an error when the network is built. Ideally this will be caught in add_connection(). This should also come with clear documentation of what constitutes valid cell-cell connections.

ntolley commented 3 years ago

Renaming this issue to reflect problems that came up during #318

Here are the major points that should be addressed in a followup PR

ntolley commented 3 years ago

@kenloi this is the issue I was describing earlier about verbose warnings. This would also be a good opportunity to learn about what is considered a "valid" connection in the canonical microcircuit.

jasmainak commented 1 year ago

what's left here @ntolley ?

ntolley commented 1 year ago

I recall from an older discussion that we moved away from making _Connectivity it's own class. Also #419 was the major goal for adding more verbose warnings so I think it's save to close this issue!