Skip to content

MAINT: Rename examples and tutorials #9292

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

Merged
merged 18 commits into from
Apr 20, 2021
Merged

MAINT: Rename examples and tutorials #9292

merged 18 commits into from
Apr 20, 2021

Conversation

larsoner
Copy link
Member

@larsoner larsoner commented Apr 13, 2021

Adds automated redirect from plot_* to all of our examples, and renames them. @drammock for:

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 implemented (but did not test) some custom_redirects code that you can use. I think you'll want to adapt it to take care of the number renaming. I added the conditional fname not in needed_plot_redirects.values() to the auto-plot_-redirect code, but you'll need to do a bit of testing to make sure things work. Can you take over and make the necessary code changes and git mvs?

closes #9082
closes #9290

@larsoner
Copy link
Member Author

FYI @drammock I push-forced after a rebase

@drammock
Copy link
Member

drammock commented Apr 16, 2021

TODO:

  • "modifying data in-place" is now in the intro category. It should be made much more general (right now it appears to be mostly a showcase for raw.apply_hilbert and raw.apply_function, neither of which appear in any other tutorials)
  • the mne.Report tutorial is now in the intro category. It would benefit from a short introductory paragraph explaining what mne.Report is good for / why you might want to use it.
  • 4DBTi phantom tutorial is missing its dipoles in the final figure (should open a separate issue/PR) part of Fix corrupted figures in plot_background_freesurfer_mne #9007
  • Fix crossref to this sklearn tutorial which doesn't have a target name
  • add all the redirects to the dict

@drammock drammock mentioned this pull request Apr 18, 2021
@larsoner larsoner added this to the 0.23 milestone Apr 19, 2021
@larsoner
Copy link
Member Author

Fix crossref to this sklearn tutorial which doesn't have a target name

SG will give it one automatically:

$ python -m sphinx.ext.intersphinx https://scikit-learn.org/stable/objects.inv | grep ".*sphx_glr_auto.*blind_source_separation.*"
	sphx_glr_auto_examples_decomposition_plot_ica_blind_source_separation.py Blind source separation using FastICA   : auto_examples/decomposition/plot_ica_blind_source_separation.html#sphx-glr-auto-examples-decomposition-plot-ica-blind-source-separation-py

So you should be able to do something like:

:ref:`sphx_glr_auto_examples_decomposition_plot_ica_blind_source_separation.py`

@larsoner
Copy link
Member Author

4DBTi phantom tutorial is missing its dipoles in the final figure (should open a separate issue/PR)

No need, I think this is a dup of #9007 . Will comment over there / in @GuillaumeFavelier's PR

@drammock drammock force-pushed the rename branch 3 times, most recently from 9b64752 to cb396cc Compare April 19, 2021 22:03
@drammock drammock marked this pull request as ready for review April 19, 2021 22:03
@drammock drammock changed the title WIP, MAINT: Rename examples and tutorials MAINT: Rename examples and tutorials Apr 19, 2021
@drammock
Copy link
Member

@larsoner this appears to be working now in my local testing. Ready for review once CIs come back green.

@larsoner
Copy link
Member Author

This has a conflict again unfortunately

@drammock
Copy link
Member

@larsoner I've put in an upstream PR for the meta is undefined theme error: pydata/pydata-sphinx-theme#395

In the meantime I'll push a theme override here with the fix in place, to get Circle building again.

@larsoner
Copy link
Member Author

@drammock there is another conflict but I'll fix + push + merge in quick succession once CircleCI comes back happy here

* upstream/main:
  MNT: BackgroundPlotter has no attribute named image (mne-tools#9318)
  [MRG, DOC] Remove CSD average reference note (mne-tools#9320)
@larsoner
Copy link
Member Author

Changed my mind, the build wasn't that far along

@drammock
Copy link
Member

proof of concept: https://27567-1301584-gh.circle-artifacts.com/0/dev/auto_tutorials/misc/plot_ecog.html redirects to .../clinical/30_ecog.html

@larsoner larsoner merged commit 507b3a4 into mne-tools:main Apr 20, 2021
@larsoner
Copy link
Member Author

Awesome work @drammock !

@larsoner larsoner deleted the rename branch April 20, 2021 15:52
@agramfort
Copy link
Member

agramfort commented Apr 20, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename files in tutorials? DOC: split up "sample datasets" tutorial category
3 participants