Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e714048

Browse files
authored
Merge pull request #13321 from anntzer/intfloorceil
In Py3, math.floor and math.ceil already return ints.
2 parents effc3bf + 8997750 commit e714048

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
@@ -1925,14 +1925,13 @@ def date_ticker_factory(span, tz=None, numticks=5):
19251925
locator = WeekdayLocator(tz=tz)
19261926
fmt = '%a, %b %d'
19271927
elif days > numticks:
1928-
locator = DayLocator(interval=int(math.ceil(days / numticks)), tz=tz)
1928+
locator = DayLocator(interval=math.ceil(days / numticks), tz=tz)
19291929
fmt = '%b %d'
19301930
elif hrs > numticks:
1931-
locator = HourLocator(interval=int(math.ceil(hrs / numticks)), tz=tz)
1931+
locator = HourLocator(interval=math.ceil(hrs / numticks), tz=tz)
19321932
fmt = '%H:%M\n%b %d'
19331933
elif mins > numticks:
1934-
locator = MinuteLocator(interval=int(math.ceil(mins / numticks)),
1935-
tz=tz)
1934+
locator = MinuteLocator(interval=math.ceil(mins / numticks), tz=tz)
19361935
fmt = '%H:%M:%S'
19371936
else:
19381937
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)