Skip to content

Commit 079c868

Browse files
authored
ENH: Build API entry usage graphs (mne-tools#12013)
1 parent de86932 commit 079c868

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

doc/conf.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ def __call__(self, gallery_conf, fname, when):
620620
r"mne\.Epochs",
621621
r"mne.datasets.*",
622622
},
623-
"show_api_usage": False, # disable for now until graph warning fixed
623+
"show_api_usage": "unused",
624624
"api_usage_ignore": (
625625
"("
626626
".*__.*__|" # built-ins
@@ -688,6 +688,15 @@ def append_attr_meth_examples(app, what, name, obj, options, lines):
688688

689689
# -- Other extension configuration -------------------------------------------
690690

691+
# Consider using http://magjac.com/graphviz-visual-editor for this
692+
graphviz_dot_args = [
693+
"-Gsep=-0.5",
694+
"-Gpad=0.5",
695+
"-Nshape=box",
696+
"-Nfontsize=20",
697+
"-Nfontname=Open Sans,Arial",
698+
]
699+
graphviz_output_format = "svg" # for API usage diagrams
691700
user_agent = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Mobile Safari/537.36" # noqa: E501
692701
# Can eventually add linkcheck_request_headers if needed
693702
linkcheck_ignore = [ # will be compiled to regex

doc/install/contributing.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,11 @@ down the road. Here are the guidelines:
10271027
nicely formatted) and the resulting output and figures will be rendered
10281028
as part of the tutorial/example.
10291029

1030+
- Examples and tutorials should execute as quickly and with as low memory usage as
1031+
possible while still conveying necessary information. To see current execution
1032+
times and memory usage, visit the `sg_execution_times page`_. To see unused API
1033+
entries, see the `sg_api_usage page`_.
1034+
10301035
`This sample pull request`_ exemplifies many of the conventions listed above:
10311036
it addresses only one problem; it started with an issue to discuss the problem
10321037
and some possible solutions; it is a PR from the user's non-main branch into
@@ -1042,6 +1047,8 @@ it can serve as a useful example of what to expect from the PR review process.
10421047
.. _open a new issue: https://github.com/mne-tools/mne-python/issues/new/choose
10431048
.. _This sample pull request: https://github.com/mne-tools/mne-python/pull/6230
10441049
.. _our user forum: https://mne.discourse.group
1050+
.. _sg_execution_times page: https://mne.tools/dev/sg_execution_times.html
1051+
.. _sg_api_usage page: https://mne.tools/dev/sg_api_usage.html
10451052

10461053
.. git installation
10471054

0 commit comments

Comments
 (0)