File tree 3 files changed +8
-3
lines changed
3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 16
16
17
17
import matplotlib .ticker as mticker
18
18
19
+ # Fixing random state for reproducibility
19
20
np .random .seed (19680801 )
20
21
21
22
UNIT = "Hz"
Original file line number Diff line number Diff line change @@ -1645,6 +1645,9 @@ def test_engformatter_offset_oom(
1645
1645
# only makes sure that offset text and the ticks gets the correct unit
1646
1646
# prefixes and the ticks.
1647
1647
if formatter .offset :
1648
+ # These prefix_ variables are used only once, so we could have inlined
1649
+ # them all, but it is more comfortable in case of tests breakages to
1650
+ # view their values with pytest --showlocals.
1648
1651
prefix_noise_got = offset_got [2 ]
1649
1652
prefix_noise_desired = formatter .ENG_PREFIXES [oom_noise_desired ]
1650
1653
prefix_center_got = offset_got [- 1 - len (UNIT )]
@@ -1659,7 +1662,8 @@ def test_engformatter_offset_oom(
1659
1662
assert offset_got == ""
1660
1663
# Make sure the ticks contain now the prefixes
1661
1664
for tick in ticks_got :
1662
- # 0 is zero on all orders of magnitudes, no
1665
+ # 0 is zero on all orders of magnitudes, no matter what is
1666
+ # oom_noise_desired
1663
1667
if tick [0 ] == "0" :
1664
1668
prefix_idx = 0
1665
1669
else :
Original file line number Diff line number Diff line change @@ -1464,8 +1464,8 @@ def set_locs(self, locs):
1464
1464
1465
1465
# Simplify a bit ScalarFormatter.get_offset: We always want to use
1466
1466
# 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
1469
1469
# in `test_ticker.py`.
1470
1470
def get_offset (self ):
1471
1471
# docstring inherited
You can’t perform that action at this time.
0 commit comments