8000 Small comment fixups from review · matplotlib/matplotlib@e0f08b5 · GitHub
[go: up one dir, main page]

Skip to content

Commit e0f08b5

Browse files
committed
Small comment fixups from review
1 parent 7839ed2 commit e0f08b5

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

galleries/examples/ticks/engformatter_offset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import matplotlib.ticker as mticker
1818

19+
# Fixing random state for reproducibility
1920
np.random.seed(19680801)
2021

2122
UNIT = "Hz"

lib/matplotlib/tests/test_ticker.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1642,6 +1642,9 @@ def test_engformatter_offset_oom(
16421642
# only makes sure that offset text and the ticks gets the correct unit
16431643
# prefixes and the ticks.
16441644
if formatter.offset:
1645+
# These prefix_ variables are used only once, so we could have inlined
1646+
# them all, but it is more comfortable in case of tests breakages to
1647+
# view their values with pytest --showlocals.
16451648
prefix_noise_got = offset_got[2]
16461649
prefix_noise_desired = formatter.ENG_PREFIXES[oom_noise_desired]
16471650
prefix_center_got = offset_got[-1-len(UNIT)]
@@ -1656,7 +1659,8 @@ def test_engformatter_offset_oom(
16561659
assert offset_got == ""
16571660
# Make sure the ticks contain now the prefixes
16581661
for tick in ticks_got:
1659-
# 0 is zero on all orders of magnitudes, no
1662+
# 0 is zero on all orders of magnitudes, no matter what is
1663+
# oom_noise_desired
16601664
if tick[0] == "0":
16611665
prefix_idx = 0
16621666
else:

lib/matplotlib/ticker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,8 +1464,8 @@ def set_locs(self, locs):
14641464

14651465
# Simplify a bit ScalarFormatter.get_offset: We always want to use
14661466
# self.format_data. Also we want to return a non-empty string only if there
1467-
# is an offset, no matter what is self.orderOfMagnitude. if there is an
1468-
# offset OTH, self.orderOfMagnitude is consulted. This behavior is verified
1467+
# is an offset, no matter what is self.orderOfMagnitude. If there _is_ an
1468+
# offset, self.orderOfMagnitude is consulted. This behavior is verified
14691469
# in `test_ticker.py`.
14701470
def get_offset(self):
14711471
# docstring inherited

0 commit comments

Comments
 (0)
0