MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_auto_date_locator

Function test_auto_date_locator

lib/matplotlib/tests/test_dates.py:400–476  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

398
399@_new_epoch_decorator
400def test_auto_date_locator():
401 def _create_auto_date_locator(date1, date2):
402 locator = mdates.AutoDateLocator(interval_multiples=False)
403 locator.create_dummy_axis()
404 locator.axis.set_view_interval(*mdates.date2num([date1, date2]))
405 return locator
406
407 d1 = datetime.datetime(1990, 1, 1)
408 results = ([datetime.timedelta(weeks=52 * 200),
409 ['1990-01-01 00:00:00+00:00', '2010-01-01 00:00:00+00:00',
410 '2030-01-01 00:00:00+00:00', '2050-01-01 00:00:00+00:00',
411 '2070-01-01 00:00:00+00:00', '2090-01-01 00:00:00+00:00',
412 '2110-01-01 00:00:00+00:00', '2130-01-01 00:00:00+00:00',
413 '2150-01-01 00:00:00+00:00', '2170-01-01 00:00:00+00:00']
414 ],
415 [datetime.timedelta(weeks=52),
416 ['1990-01-01 00:00:00+00:00', '1990-02-01 00:00:00+00:00',
417 '1990-03-01 00:00:00+00:00', '1990-04-01 00:00:00+00:00',
418 '1990-05-01 00:00:00+00:00', '1990-06-01 00:00:00+00:00',
419 '1990-07-01 00:00:00+00:00', '1990-08-01 00:00:00+00:00',
420 '1990-09-01 00:00:00+00:00', '1990-10-01 00:00:00+00:00',
421 '1990-11-01 00:00:00+00:00', '1990-12-01 00:00:00+00:00']
422 ],
423 [datetime.timedelta(days=141),
424 ['1990-01-05 00:00:00+00:00', '1990-01-26 00:00:00+00:00',
425 '1990-02-16 00:00:00+00:00', '1990-03-09 00:00:00+00:00',
426 '1990-03-30 00:00:00+00:00', '1990-04-20 00:00:00+00:00',
427 '1990-05-11 00:00:00+00:00']
428 ],
429 [datetime.timedelta(days=40),
430 ['1990-01-03 00:00:00+00:00', '1990-01-10 00:00:00+00:00',
431 '1990-01-17 00:00:00+00:00', '1990-01-24 00:00:00+00:00',
432 '1990-01-31 00:00:00+00:00', '1990-02-07 00:00:00+00:00']
433 ],
434 [datetime.timedelta(hours=40),
435 ['1990-01-01 00:00:00+00:00', '1990-01-01 04:00:00+00:00',
436 '1990-01-01 08:00:00+00:00', '1990-01-01 12:00:00+00:00',
437 '1990-01-01 16:00:00+00:00', '1990-01-01 20:00:00+00:00',
438 '1990-01-02 00:00:00+00:00', '1990-01-02 04:00:00+00:00',
439 '1990-01-02 08:00:00+00:00', '1990-01-02 12:00:00+00:00',
440 '1990-01-02 16:00:00+00:00']
441 ],
442 [datetime.timedelta(minutes=20),
443 ['1990-01-01 00:00:00+00:00', '1990-01-01 00:05:00+00:00',
444 '1990-01-01 00:10:00+00:00', '1990-01-01 00:15:00+00:00',
445 '1990-01-01 00:20:00+00:00']
446 ],
447 [datetime.timedelta(seconds=40),
448 ['1990-01-01 00:00:00+00:00', '1990-01-01 00:00:05+00:00',
449 '1990-01-01 00:00:10+00:00', '1990-01-01 00:00:15+00:00',
450 '1990-01-01 00:00:20+00:00', '1990-01-01 00:00:25+00:00',
451 '1990-01-01 00:00:30+00:00', '1990-01-01 00:00:35+00:00',
452 '1990-01-01 00:00:40+00:00']
453 ],
454 [datetime.timedelta(microseconds=1500),
455 ['1989-12-31 23:59:59.999500+00:00',
456 '1990-01-01 00:00:00+00:00',
457 '1990-01-01 00:00:00.000500+00:00',

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…