hnn-core
hnn-core copied to clipboard
GUI: Connection Probability
Working on the Network configuration export I noticed that the GUI is not using the connection probability in any way.
The connectivity only have a weight widget parameter.
The connectivity widget constructor is shown below. Notice the docstring mentions probability, but it is not in the box construct. It's a bit hard to read but the connectivity box is a vertical box (Vbox) composed of 3 elements:
- HTML - Receptor label
- w_text_input - Weight widget
- HTML - Black horizontal bar https://github.com/jonescompneurolab/hnn-core/blob/a1c94ee2f83e3b7a432fb03daa659f25a05da98a/hnn_core/gui/gui.py#L935-L951
The Problem
A problem arises when initializing the new network from widget values. It tries to assign a probability from a widget that does not exist (see below). The vbox_key.children[2].value
, is not a probability widget but the html widget that styles the black horizontal bar. So the network actually gets assigned a probability value of "<hr style='margin-bottom:5px'/>"
!
https://github.com/jonescompneurolab/hnn-core/blob/a1c94ee2f83e3b7a432fb03daa659f25a05da98a/hnn_core/gui/gui.py#L1650-L1653
Solution I suppose the easiest solution is to just add the probability as a widget for all the connections. Does this make sense for all types of connections?