hnn-core icon indicating copy to clipboard operation
hnn-core copied to clipboard

GUI: Connection Probability

Open gtdang opened this issue 6 months ago • 4 comments

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. Screenshot 2024-07-31 at 10 20 16 AM

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:

  1. HTML - Receptor label
  2. w_text_input - Weight widget
  3. 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?

gtdang avatar Jul 31 '24 14:07 gtdang