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 3c031db

Browse filesBrowse files
committed
Fix bug: plot_types subdirectory ordering logic was faulty
1 parent 509c5bf commit 3c031db
Copy full SHA for 3c031db

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+8
-5
lines changed

‎doc/sphinxext/gallery_order.py

Copy file name to clipboardExpand all lines: doc/sphinxext/gallery_order.py
+8-5Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
# Utility functions
11-
def get_ordering(dir):
11+
def get_ordering(dir, include_directory_path=False):
1212
"""Read gallery_order.txt in dir and return content of the file as a List"""
1313
file_path = os.path.join(dir, 'gallery_order.txt')
1414
f = open(file_path, "r")
@@ -18,7 +18,10 @@ def get_ordering(dir):
1818
if line == "unsorted":
1919
ordered_list.append(UNSORTED)
2020
else:
21-
ordered_list.append(line)
21+
if include_directory_path:
22+
ordered_list.append(os.path.join(dir, line))
23+
else:
24+
ordered_list.append(line)
2225

2326
return ordered_list
2427

@@ -69,9 +72,9 @@ def list_directory(parent_dir):
6972
# UNSORTED
7073
# ]
7174

72-
plot_types_directory = "../galleries/plot_types/"
73-
plot_types_order = get_ordering(plot_types_directory)
7475

76+
plot_types_directory = "../galleries/plot_types/"
77+
plot_types_order = get_ordering(plot_types_directory, include_directory_path=True)
7578

7679
folder_lists = [examples_order, tutorials_order, plot_types_order]
7780
explicit_order_folders = [fd for folders in folder_lists
@@ -133,7 +136,7 @@ def __call__(self, item):
133136

134137
for dir in list_directory(plot_types_directory):
135138
try:
136-
ordered_subdirs = get_ordering(dir)
139+
ordered_subdirs = get_ordering(dir, include_directory_path=False)
137140
list_all.extend(ordered_subdirs)
138141
except FileNotFoundError:
139142
# Fallback to ordering already defined in list_all

0 commit comments

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