8000 In Py3, math.floor and math.ceil already return ints. · matplotlib/matplotlib@8997750 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8997750

Browse files
committed
In Py3, math.floor and math.ceil already return ints.
Remove wrapping int() call. Mostly to save a line in dates.py...
1 parent 64c84b4 commit 8997750

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

lib/matplotlib/backends/backend_pgf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ def draw_path(self, gc, path, transform, rgbFace=None):
498498
path.get_extents(transform).get_points()
499499
xmin, xmax = f * xmin, f * xmax
500500
ymin, ymax = f * ymin, f * ymax
501-
repx, repy = int(math.ceil(xmax-xmin)), int(math.ceil(ymax-ymin))
501+
repx, repy = math.ceil(xmax - xmin), math.ceil(ymax - ymin)
502502
writeln(self.fh,
503503
r"\pgfsys@transformshift{%fin}{%fin}" % (xmin, ymin))
504504
for iy in range(repy):

lib/matplotlib/dates.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,14 +1943,13 @@ def date_ticker_factory(span, tz=None, numticks=5):
19431943
locator = WeekdayLocator(tz=tz)
19441944
fmt = '%a, %b %d'
19451945
elif days > numticks:
1946-
locator = DayLocator(interval=int(math.ceil(days / numticks)), tz=tz)
1946+
locator = DayLocator(interval=math.ceil(days / numticks), tz=tz)
19471947
fmt = '%b %d'
19481948
elif hrs > numticks:
1949-
locator = HourLocator(interval=int(math.ceil(hrs / numticks)), tz=tz)
1949+
locator = HourLocator(interval=math.ceil(hrs / numticks), tz=tz)
19501950
fmt = '%H:%M\n%b %d'
19511951
elif mins > numticks:
1952-
locator = MinuteLocator(interval=int(math.ceil(mins / numticks)),
1953-
tz=tz)
1952+
locator = MinuteLocator(interval=math.ceil(mins / numticks), tz=tz)
19541953
fmt = '%H:%M:%S'
19551954
else:
19561955
locator = MinuteLocator(tz=tz)

lib/matplotlib/testing/jpl_units/Epoch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def __init__(self, frame, sec=None, jd=None, daynum=None, dt=None):
7777
self._jd = float(jd)
7878

7979
# Resolve seconds down to [ 0, 86400)
80-
deltaDays = int(math.floor(self._seconds / 86400.0))
80+
deltaDays = math.floor(self._seconds / 86400)
8181
self._jd += deltaDays
8282
self._seconds -= deltaDays * 86400.0
8383

0 commit comments

Comments
 (0)
0