-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MRG] Update legacy json and param conversion function for new json format #772
[MRG] Update legacy json and param conversion function for new json format #772
Conversation
network_connectivity='jones_2009_model', | ||
include_drives=True, | ||
overwrite=True): | ||
"""Converts legacy json or param format to hierarchical json format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I missed the discussion. Do you guys have a specification of the hierarchical json format? how will you store connectivity etc? Or is it an intermediate format before going to hdf5?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format is Network object converted to a dictionary format. So the connectivities are just the same hierarchical dictionary format as the Network Object. Pretty much everything is preserved except numpy arrays need to be converted to lists when written to json and converted back upon read-in.
This is not an intermediate format before going to hdf5. All the network connections, drives, cell parameters can be saved and loaded with this format.
What is not included with this format is the ability to save outputs (the optional recordings during simulation saved to the Network). [Is there a better term to use than "outputs"?] We plan to use the hdf5 format for the saving of network outputs. For that hdf5 file, a version of this json will be saved as a single dataset in the hdf5 (A string json binarized), that way the network configurations are paired with the outputs.
Do these new json format files work with the GUI? |
No, not yet. I've been working on it but got side tracked with the CI issues. Should be able to refocus on it next week. |
…re-defined network connectivity models in the conversion.
77d2281
to
b4d565d
Compare
hnn_core/params.py
Outdated
|
||
Parameters | ||
---------- | ||
params_fname : str or Path | ||
Path to file | ||
out_fname: str | ||
Path to output | ||
network_connectivity: str or None, default:' jones_2009_model' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
network_connectivity: str or None, default:' jones_2009_model' | |
model_template: str or None, default:' jones_2009_model' |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this argument name change. Thanks!
assert net_json == net_params | ||
|
||
def test_no_network_connectivity(self, tmp_path): | ||
"""Tests conversion with no network connectivity model""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good edge case to check!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good on my end, thanks @gtdang !!
This changes the convert_to_hdf5 function to convert_to_json.
Question: