You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to prepare for a distant future case where we suddenly want to put a .py file that shouldn't get processed, I'd do it when we need it (YAGNI).
+1 on renaming -> as a newbie, I was confused by this naming convention - and now (being a bit more experienced), I think that it would look/read nicer to get rid of the prefix, if it's technically no problem.
even though I believe maybe we should keep some kind of prefix, like tut_*?
you mean for globally searching tutorial files?
Personally I would think that having them in the tutorials/ directory would suffice 🤔
There is a downside to this renaming in that if people have bookmarks to the existing ones those links will break. But I agree the URL/filename readability benefit is probably worth it. WDYT @drammock ?
To do this the process can just be to update the sphinx-gallery conf pattern to be anything not containing _sgskip ('filename_pattern': '^((?!sgskip).)*$'), rename the few examples that currently don't start with plot_* to *_sgskip, and rename all plot_* to no longer have that prefix. This would follow the matplotlib pattern
note that we have some examples that do not contain plot_ (I think about the RSA decoding example).
Also I foresee that google will need to reindex everything. So we'll have a lot of broken links. You can
find many of my slides online and you will break on the URL they contain
note that we have some examples that do not contain plot_ (I think about the RSA decoding example).
These should be taken care of by my suggested _sgskip process above
Also I foresee that google will need to reindex everything. So we'll have a lot of broken links. You can
find many of my slides online and you will break on the URL they contain
It just occurred to me that I could write ~30 lines in conf.py to handle this by writing out plot_* HTML redirects for all of our examples. I think this should make Google and your slides happy, and also make it so that in the future if we want to change page locations we can trivially (in one line) add arbitrary redirects from old-to-new names.
Reacted by Stefan Appelhoff and Richard Höchenberger
I love it when issues get resolved before I'm done with breakfast! FYI this is something I tried to do as part of the big doc restructuring in 2019. At that time my plan was to ditch plot_ and have non-plotting tutorials end with _. But _sgskip seems fine too.
I should note that some, but not all, of the tutorials have had a number added to their filename, to enforce a specific sort order within their category. With the links changing anyway, now would be a good time to add numbers to the rest of them.
I'd actually prefer the _ suffix over _sgskip because it looks more Pythonic 😄 - but it's not that important. Adding numbers to all examples is a great idea.
The few examples that currently don't start with plot_ - how are they rendered? What is the reason we don't "plot" them?
Activity
hoechenberger commentedon Apr 13, 2021
+1 on renaming; even though I believe maybe we should keep some kind of prefix, like
tut_*?cbrnr commentedon Apr 13, 2021
If you want to prepare for a distant future case where we suddenly want to put a
.pyfile that shouldn't get processed, I'd do it when we need it (YAGNI).sappelhoff commentedon Apr 13, 2021
+1 on renaming -> as a newbie, I was confused by this naming convention - and now (being a bit more experienced), I think that it would look/read nicer to get rid of the prefix, if it's technically no problem.
you mean for globally searching tutorial files?
Personally I would think that having them in the
tutorials/directory would suffice 🤔hoechenberger commentedon Apr 13, 2021
ok, convinced :)
larsoner commentedon Apr 13, 2021
There is a downside to this renaming in that if people have bookmarks to the existing ones those links will break. But I agree the URL/filename readability benefit is probably worth it. WDYT @drammock ?
To do this the process can just be to update the sphinx-gallery conf pattern to be anything not containing
_sgskip('filename_pattern': '^((?!sgskip).)*$'), rename the few examples that currently don't start withplot_*to*_sgskip, and rename allplot_*to no longer have that prefix. This would follow the matplotlib patternhttps://github.com/matplotlib/matplotlib/blob/master/doc/conf.py#L155
agramfort commentedon Apr 13, 2021
note that we have some examples that do not contain plot_ (I think about the RSA decoding example).
Also I foresee that google will need to reindex everything. So we'll have a lot of broken links. You can
find many of my slides online and you will break on the URL they contain
larsoner commentedon Apr 13, 2021
These should be taken care of by my suggested
_sgskipprocess aboveIt just occurred to me that I could write ~30 lines in
conf.pyto handle this by writing outplot_*HTML redirects for all of our examples. I think this should make Google and your slides happy, and also make it so that in the future if we want to change page locations we can trivially (in one line) add arbitrary redirects from old-to-new names.agramfort commentedon Apr 13, 2021
larsoner commentedon Apr 13, 2021
Okay I'll see how bad it is!
drammock commentedon Apr 13, 2021
I love it when issues get resolved before I'm done with breakfast! FYI this is something I tried to do as part of the big doc restructuring in 2019. At that time my plan was to ditch
plot_and have non-plotting tutorials end with_. But_sgskipseems fine too.I should note that some, but not all, of the tutorials have had a number added to their filename, to enforce a specific sort order within their category. With the links changing anyway, now would be a good time to add numbers to the rest of them.
cbrnr commentedon Apr 13, 2021
I'd actually prefer the
_suffix over_sgskipbecause it looks more Pythonic 😄 - but it's not that important. Adding numbers to all examples is a great idea.The few examples that currently don't start with
plot_- how are they rendered? What is the reason we don't "plot" them?drammock commentedon Apr 13, 2021
The reason is long execution time. They are rendered by Sphinx from rst to html without running the py code or capturing output.