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 bb510b9

Browse filesBrowse files
tacaswellrcomer
andauthored
MNT: refactor to remove a level of indentation
Co-authored-by: Ruth Comer <10599679+rcomer@users.noreply.github.com>
1 parent 9c36d85 commit bb510b9
Copy full SHA for bb510b9

File tree

Expand file treeCollapse file tree

1 file changed

+4
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-5
lines changed
Open diff view settings
Collapse file

‎lib/matplotlib/colorbar.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/colorbar.py
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,11 +1418,10 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
14181418
# turn parents into a list if it is not already. Note we cannot
14191419
# use .flatten or .ravel as these copy the references rather than
14201420
# reuse them, leading to a memory leak
1421-
if np.iterable(parents):
1422-
if isinstance(parents, np.ndarray):
1423-
parents = list(parents.flat)
1424-
else:
1425-
parents = list(parents)
1421+
if isinstance(parents, np.ndarray):
1422+
parents = list(parents.flat)
1423+
elif np.iterable(parents):
1424+
parents = list(parents)
14261425
else:
14271426
parents = [parents]
14281427

0 commit comments

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