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

MNT: explicitly cast np.bool_ -> bool to prevent deprecation warning #15168

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 1 commit into from
Sep 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions 6 lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3213,7 +3213,8 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False,
reverse = left > right
left, right = self.xaxis.get_major_locator().nonsingular(left, right)
left, right = self.xaxis.limit_range_for_scale(left, right)
left, right = sorted([left, right], reverse=reverse)
# cast to bool to avoid bad interaction between python 3.8 and np.bool_
left, right = sorted([left, right], reverse=bool(reverse))

self._viewLim.intervalx = (left, right)
if auto is not None:
Expand Down Expand Up @@ -3597,7 +3598,8 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
reverse = bottom > top
bottom, top = self.yaxis.get_major_locator().nonsingular(bottom, top)
bottom, top = self.yaxis.limit_range_for_scale(bottom, top)
bottom, top = sorted([bottom, top], reverse=reverse)
# cast to bool to avoid bad interaction between python 3.8 and np.bool_
bottom, top = sorted([bottom, top], reverse=bool(reverse))

self._viewLim.intervaly = (bottom, top)
if auto is not None:
Expand Down
6 changes: 4 additions & 2 deletions 6 lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2169,7 +2169,8 @@ def get_minpos(self):
def set_inverted(self, inverted):
# docstring inherited
a, b = self.get_view_interval()
self.axes.set_xlim(sorted((a, b), reverse=inverted), auto=None)
# cast to bool to avoid bad interaction between python 3.8 and np.bool_
self.axes.set_xlim(sorted((a, b), reverse=bool(inverted)), auto=None)

def set_default_intervals(self):
# docstring inherited
Expand Down Expand Up @@ -2468,7 +2469,8 @@ def get_minpos(self):
def set_inverted(self, inverted):
# docstring inherited
a, b = self.get_view_interval()
self.axes.set_ylim(sorted((a, b), reverse=inverted), auto=None)
# cast to bool to avoid bad interaction between python 3.8 and np.bool_
self.axes.set_ylim(sorted((a, b), reverse=bool(inverted)), auto=None)

def set_default_intervals(self):
# docstring inherited
Expand Down
3 changes: 2 additions & 1 deletion 3 lib/mpl_toolkits/mplot3d/axes3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,8 @@ def set_xlim3d(self, left=None, right=None, emit=True, auto=False,
reverse = left > right
left, right = self.xaxis.get_major_locator().nonsingular(left, right)
left, right = self.xaxis.limit_range_for_scale(left, right)
left, right = sorted([left, right], reverse=reverse)
# cast to bool to avoid bad interaction between python 3.8 and np.bool_
left, right = sorted([left, right], reverse=bool(reverse))
self.xy_viewLim.intervalx = (left, right)

if auto is not None:
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.