File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -1623,11 +1623,10 @@ def test_engformatter_offset_oom(
1623
1623
):
1624
1624
UNIT = "eV"
1625
1625
# Doesn't really matter here, but should be of order of magnitude ~= 1
1626
- r = range (- 5 , 7 )
1627
1626
fig , ax = plt .subplots ()
1628
1627
# Use some random ugly number
1629
1628
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
1631
1630
ax .plot (ydata )
1632
1631
formatter = mticker .EngFormatter (useOffset = True , unit = UNIT )
1633
1632
# So that offset strings will always have the same size
@@ -1661,10 +1660,7 @@ def test_engformatter_offset_oom(
1661
1660
for tick in ticks_got :
1662
1661
# 0 is zero on all orders of magnitudes, no matter what is
1663
1662
# 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
1668
1664
assert tick .endswith (formatter .ENG_PREFIXES [prefix_idx ] + UNIT )
1669
1665
1670
1666
You can’t perform that action at this time.
0 commit comments