8000 Remove unnecessary calls to lower(). by anntzer · Pull Request #18967 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Remove unnecessary calls to lower(). #18967

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
Nov 17, 2020
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
< 8000 span class="select-menu-title"> Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2601,9 +2601,9 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True):
for ax in self._shared_y_axes.get_siblings(self)
if hasattr(ax, "lines")
for artist in ax.get_children()]))
if self.get_xscale().lower() == 'log':
if self.get_xscale() == 'log':
x_stickies = x_stickies[x_stickies > 0]
if self.get_yscale().lower() == 'log':
if self.get_yscale() == 'log':
y_stickies = y_stickies[y_stickies > 0]

def handle_single_axis(scale, autoscaleon, shared_axes, interval,
Expand Down
7 changes: 3 additions & 4 deletions lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ def __init__(self, axes, loc, label=None,
self.set_figure(axes.figure)
self.axes = axes

name = self.__name__.lower()

self._loc = loc
self._major = major

name = self.__name__
major_minor = "major" if major else "minor"

if size is None:
Expand Down Expand Up @@ -448,7 +447,7 @@ def _get_text2_transform(self):
def apply_tickdir(self, tickdir):
"""Set tick direction. Valid values are 'in', 'out', 'inout'."""
if tickdir is None:
tickdir = mpl.rcParams['%s.direction' % self.__name__.lower()]
tickdir = mpl.rcParams[f'{self.__name__}.direction']
_api.check_in_list(['in', 'out', 'inout'], tickdir=tickdir)
self._tickdir = tickdir

Expand Down Expand Up @@ -520,7 +519,7 @@ def _get_text2_transform(self):

def apply_tickdir(self, tickdir):
if tickdir is None:
tickdir = mpl.rcParams['%s.direction' % self.__name__.lower()]
tickdir = mpl.rcParams[f'{self.__name__}.direction']
self._tickdir = tickdir

if self._tickdir == 'in':
Expand Down
5 changes: 2 additions & 3 deletions lib/matplotlib/blocking_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,9 @@ def key_event(self):
if event.key is None:
# At least in OSX gtk backend some keys return None.
return
key = event.key.lower()
if key in ['backspace', 'delete']:
if event.key in ['backspace', 'delete']:
self.mouse_event_pop(event)
elif key in ['escape', 'enter']:
elif event.key in ['escape', 'enter']:
self.mouse_event_stop(event)
else:
self.mouse_event_add(event)
Expand Down
0