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
Modify model directory documentation UI and related pages #3203
base: master
Are you sure you want to change the base?
Conversation
if not os.path.exists(outdir): | ||
log.info("creating output directory " + outdir) | ||
os.mkdir(outdir) | ||
userdoc_re = re.compile(r"BeginUserDocs:?\s*(?P<tags>([\w -]+(,\s*)?)*)\n+(?P<doc>(.|\n)*)EndUserDocs") |
Check failure
Code scanning / CodeQL
Inefficient regular expression High
|
||
file_paths = glob.glob(os.path.join(directory_path, "*.h")) | ||
|
||
userdoc_re = re.compile(r"BeginUserDocs:?\s*(?P<tags>([\w -]+(,\s*)?)*)\n+(?P<doc>(.|\n)*)EndUserDocs") |
Check failure
Code scanning / CodeQL
Inefficient regular expression High
Thanks for this! Could you post a link to the rendered RtD page for this PR? |
@@ -29,7 +29,7 @@ | |||
namespace nest | |||
{ | |||
|
|||
/* BeginUserDocs: neuron, binary | |||
/* BeginUserDocs: neuron, binary, artificial |
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.
What makes a neuron "artificial"?
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.
It was explained to me that binary neurons are artificial, but maybe I misinterpreted @ddahmen can you comment?
I just did, see top comment (you were just too fast :) ) |
This PR modifies the model directory page and how it functions as well as related pages with significant changes. There is now a interactive UI that dynamically loads results of button selection using Javascript.
See Read the Docs output here: https://nest-simulator--3203.org.readthedocs.build/en/3203/models/index.html
The script that extracted the model user docs and built the indices is now split into 2 scripts.
The
extract_userdocs_cpp.py
only extracts the documentation from the C++ header files and creates the restructured text pages for each model.The
model_tag_setup.py
extracts the tags for each model and creates dictionaries,{model: [tags]}
and[{tag: "tag", models: ["models"], count: # of models}]
. These dictionaries are used in Jinja templates as well as a JSON file is created to be used by Javascript that will render the output client-side.The
models/index
page now has a 'model selector' that displays each tag, in order of number of models that have that tag (with exception of neuron, synapse and device being the first tags) as multi-select buttons.By clicking on one or more buttons the corresponding models will be displayed.
In addition to the model selector there is also a dropdown that lists in alphabetical order (grouped by neuron, synapse, and device) all models.
Some information from 'models-main' is moved into here. The page also has links to pages for more info on neurons, synapses and devices - these pages will require more work in the future but each of those pages also lists all corresponding models.
When working on this, I found that the pre-commit hook for clang would fail, so changes to it were also done, and fixes #3182
Some tags were fixed up, and "artificial" was added as a tag (one reason was to check that the script worked as expected when modifying the source)