8000 dates: use _log.warn for sub-second warning · matplotlib/matplotlib@1ab7935 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ab7935

Browse files
committed
dates: use _log.warn for sub-second warning
1 parent e04464a commit 1ab7935

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/matplotlib/dates.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
import functools
129129

130130
import warnings
131+
import logging
131132

132133

133134
from dateutil.rrule import (rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY,
@@ -156,6 +157,7 @@
156157
'HOURLY', 'MINUTELY', 'SECONDLY', 'MICROSECONDLY', 'relativedelta',
157158
'seconds', 'minutes', 'hours', 'weeks')
158159

160+
_log = logging.getLogger(__name__)
159161

160162
# Make a simple UTC instance so we don't always have to import
161163
# pytz. From the python datetime library docs:
@@ -1305,10 +1307,10 @@ def get_locator(self, dmin, dmax):
13051307
else:
13061308
locator = MicrosecondLocator(interval, tz=self.tz)
13071309
if dmin.year > 20 and interval < 1000:
1308-
warnings.warn('Plotting microsecond time intervals is not'
1309-
' well supported. Please see the'
1310-
' MicrosecondLocator documentation'
1311-
' for details.')
1310+
_log.warn('Plotting microsecond time intervals is not'
1311+
' well supported. Please see the'
1312+
' MicrosecondLocator documentation'
1313+
' for details.')
13121314

13131315
locator.set_axis(self.axis)
13141316

0 commit comments

Comments
 (0)
0