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

standardize params file

Open jasmainak opened this issue 4 years ago • 3 comments

Currently the params file has different standards for specifying conductance with respect to input feeds and for within network connections. Here are different examples:

https://github.com/jonescompneurolab/hnn-core/blob/04ab8bba620d34e43b9acf3c775e41060691673b/hnn_core/param/default.json#L159

and

https://github.com/jonescompneurolab/hnn-core/blob/04ab8bba620d34e43b9acf3c775e41060691673b/hnn_core/param/default.json#L170

then yet another format for within network connectivity:

https://github.com/jonescompneurolab/hnn-core/blob/04ab8bba620d34e43b9acf3c775e41060691673b/hnn_core/param/default.json#L120

If this was all consistent, it would be much more easier to write the code and we probably won't even need to define p_common/p_unique ... can simply do for loops. This is also related to:

#159 #134 #104

cc @rythorpe

jasmainak avatar Sep 10 '20 21:09 jasmainak

Good point. We still need to avoid modifying the param file format until integration with HNN-gui right?

rythorpe avatar Sep 10 '20 21:09 rythorpe

I don't know what's the plan there. No rush on this. We can always create a mapping inside our script to standardize it, will probably be a few lines of code.

jasmainak avatar Sep 10 '20 21:09 jasmainak

Now that HNN GUI code uses hnn-core params throughout, this issue is relevant to both projects. Just wanted to point out the key parts of HNN GUI code around interfacing with hnn-core's Params object:

The legacy_param_str_to_dict function is used for converting displayed values in the GUI to a params dict. I don't like how params are packed into a string, but it's pretty integral to how the GUI works. Something legacy that we haven't had time to remove. https://github.com/jonescompneurolab/hnn/blob/b2803ffc21a2edaf53cee6167d4d83d103f92e44/hnn/paramrw.py#L244-L267 Used here: https://github.com/jonescompneurolab/hnn/blob/b2803ffc21a2edaf53cee6167d4d83d103f92e44/hnn/qt_dialog.py#L1141

If parameters besides record_vsoma are enforced to be a bool in hnn-core, HNN GUI will need to be modified to use checkboxes instead of text fields (0 or 1). The quick fix for record_vsoma of casting back to an int is here: https://github.com/jonescompneurolab/hnn/blob/b2803ffc21a2edaf53cee6167d4d83d103f92e44/hnn/qt_thread.py#L160-L162

Otherwise hnn-core's read_params is the function used to return a dict back to HNN.

blakecaldwell avatar Mar 30 '21 13:03 blakecaldwell

No longer relevant as we are deprecating the use of params files

ntolley avatar Jul 10 '24 20:07 ntolley