-
Notifications
You must be signed in to change notification settings - Fork 70
[WIP] pretty-print-network with md format #1013
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
base: master
Are you sure you want to change the base?
[WIP] pretty-print-network with md format #1013
Conversation
hnn_core/hnn_io.py
Outdated
| from .cell_response import CellResponse | ||
| from .externals.mne import fill_doc | ||
|
|
||
| def network_to_markdown(net, fname=None): |
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.
If this is a write_xxx function, it should follow the API in the remaining codebase
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.
parameters should be documented in the docstring
hnn_core/hnn_io.py
Outdated
|
|
||
| def network_to_markdown(net, fname=None): | ||
| """converts network parameters to a markdown table.""" | ||
| from datetime import datetime |
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.
top-level import
hnn_core/hnn_io.py
Outdated
| """converts network parameters to a markdown table.""" | ||
| from datetime import datetime | ||
|
|
||
| md = [] |
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.
| md = [] | |
| md = list() |
hard to distinguish between [] and {} otherwise
|
can you add a test? |
|
Hi @jasmainak , since it is a write_xxx function, used the syntax to have the overwrite param documented via docstring used list() for md I am not sure right now how to add a test, going through |
write_network_markdown
|
@jasmainak I added a test into It is heavily inspired from Thank you! |
|
|
||
| from datetime import datetime | ||
|
|
||
| def write_network_markdown(net, fname, overwrite=True): |
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.
you need to document this in api.rst
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.
Thanks for the feedback! I have added it to the file!
updated write_network_markdown to api.rst
|
Hey @Chetank99 just to let you know, it may be a while before we have time to continue work on this. We've got "many irons in the fire". |
following up from: #1005
i have added a new function
network_to_markdown(), that exports a network object's config to md format. It is using the current JSON-based network export format.Added
network_to_markdown()tohnn_io.pyI used this code to test it:
Attaching a sample md file:
file.md
This is my first PR, so very open to feedback! If this is fine, I can work on making a table with differences of 2 network params