Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4676950

Browse filesBrowse files
authored
Merge pull request #24945 from meeseeksmachine/auto-backport-of-pr-24940-on-v3.7.x
Backport PR #24940 on branch v3.7.x ([MNT] specify which gallery sections come last)
2 parents 5466429 + dc455fc commit 4676950
Copy full SHA for 4676950

File tree

Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed

‎doc/sphinxext/gallery_order.py

Copy file name to clipboardExpand all lines: doc/sphinxext/gallery_order.py
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from sphinx_gallery.sorting import ExplicitOrder
77

88
# Gallery sections shall be displayed in the following order.
9-
# Non-matching sections are appended.
9+
# Non-matching sections are inserted at UNSORTED
1010
explicit_order_folders = [
1111
'../examples/lines_bars_and_markers',
1212
'../examples/images_contours_and_fields',
@@ -29,6 +29,9 @@
2929
'../plot_types/stats',
3030
'../plot_types/unstructured',
3131
'../plot_types/3D',
32+
'UNSORTED',
33+
'../examples/userdemo',
34+
'../tutorials/provisional',
3235
]
3336

3437

@@ -37,11 +40,9 @@ class MplExplicitOrder(ExplicitOrder):
3740
def __call__(self, item):
3841
"""Return a string determining the sort order."""
3942
if item in self.ordered_list:
40-
return "{:04d}".format(self.ordered_list.index(item))
43+
return f"{self.ordered_list.index(item):04d}"
4144
else:
42-
# ensure not explicitly listed items come last.
43-
return "zzz" + item
44-
45+
return f"{self.ordered_list.index('UNSORTED'):04d}{item}"
4546

4647
# Subsection order:
4748
# Subsections are ordered by filename, unless they appear in the following

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.