8000 test_ticker.py: small cleanups after review · matplotlib/matplotlib@2c488b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2c488b7

Browse files
committed
test_ticker.py: small cleanups after review
1 parent e0f08b5 commit 2c488b7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/matplotlib/tests/test_ticker.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,11 +1623,10 @@ def test_engformatter_offset_oom(
16231623
):
16241624
UNIT = "eV"
16251625
# Doesn't really matter here, but should be of order of magnitude ~= 1
1626-
r = range(-5, 7)
16271626
fig, ax = plt.subplots()
16281627
# Use some random ugly number
16291628
data_offset = 2.7149*10**oom_center
1630-
ydata = data_offset + np.array(r, dtype=float)*10**oom_noise
1629+
ydata = data_offset + np.arange(-5, 7, dtype=float)*10**oom_noise
16311630
ax.plot(ydata)
16321631
formatter = mticker.EngFormatter(useOffset=True, unit=UNIT)
16331632
# So that offset strings will always have the same size
@@ -1661,10 +1660,7 @@ def test_engformatter_offset_oom(
16611660
for tick in ticks_got:
16621661
# 0 is zero on all orders of magnitudes, no matter what is
16631662
# oom_noise_desired
1664-
if tick[0] == "0":
1665-
prefix_idx = 0
1666-
else:
1667-
prefix_idx = oom_noise_desired
1663+
prefix_idx = 0 if tick[0] == "0" else oom_noise_desired
16681664
assert tick.endswith(formatter.ENG_PREFIXES[prefix_idx] + UNIT)
16691665

16701666

0 commit comments

Comments
 (0)
0