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

Skip to content

Commit 4a4c216

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

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/matplotlib/dates.py

Lines changed: 8 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,
@@ -157,6 +158,9 @@
157158
'seconds', 'minutes', 'hours', 'weeks')
158159

159160

161+
_log = logging.getLogger(__name__)
162+
163+
160164
# Make a simple UTC instance so we don't always have to import
161165
# pytz. From the python datetime library docs:
162166

@@ -1305,10 +1309,10 @@ def get_locator(self, dmin, dmax):
13051309
els 8325 e:
13061310
locator = MicrosecondLocator(interval, tz=self.tz)
13071311
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.')
1312+
_log.warn('Plotting microsecond time intervals is not'
1313+
' well supported. Please see the'
1314+
' MicrosecondLocator documentation'
1315+
' for details.')
13121316

13131317
locator.set_axis(self.axis)
13141318

0 commit comments

Comments
 (0)
0