Skip to content

BUG: Fix errors in example usage of ignore_repr_types and reset_argv#1275

Merged
larsoner merged 3 commits intosphinx-gallery:masterfrom
speth:doc-fixes
Mar 20, 2024
Merged

BUG: Fix errors in example usage of ignore_repr_types and reset_argv#1275
larsoner merged 3 commits intosphinx-gallery:masterfrom
speth:doc-fixes

Conversation

@speth
Copy link
Copy Markdown
Contributor

@speth speth commented Mar 20, 2024

  • The example of how to use reset_argv is wrong, or at least misleading on two counts. One, it must return an iterable in all cases, so there should be a default case returning []. Two, the value of script_vars['src_file'] is an absolute path, not just a filename, so just sample1.py won't ever be matched.
  • Rewrite the sample regex for ignore_repr_types so it actually does what's described in the text.

speth added 3 commits March 19, 2024 21:32
Reverts formatting changes from 50fdf82.
The example of how to use `reset_argv` is wrong, or at least misleading on two counts.
One, it must return an iterable in all cases, so there should be a default case
returning `[]`. Two, the value of `script_vars['src_file']` is an absolute path, not
just a filename, so just `sample1.py` won't ever be matched.
@larsoner larsoner merged commit 20ab03c into sphinx-gallery:master Mar 20, 2024
@larsoner
Copy link
Copy Markdown
Contributor

Thanks @speth !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants