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

Function test_auto_date_locator_intmult

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

Source from the content-addressed store, hash-verified

478
479@_new_epoch_decorator
480def test_auto_date_locator_intmult():
481 def _create_auto_date_locator(date1, date2):
482 locator = mdates.AutoDateLocator(interval_multiples=True)
483 locator.create_dummy_axis()
484 locator.axis.set_view_interval(*mdates.date2num([date1, date2]))
485 return locator
486
487 results = ([datetime.timedelta(weeks=52 * 200),
488 ['1980-01-01 00:00:00+00:00', '2000-01-01 00:00:00+00:00',
489 '2020-01-01 00:00:00+00:00', '2040-01-01 00:00:00+00:00',
490 '2060-01-01 00:00:00+00:00', '2080-01-01 00:00:00+00:00',
491 '2100-01-01 00:00:00+00:00', '2120-01-01 00:00:00+00:00',
492 '2140-01-01 00:00:00+00:00', '2160-01-01 00:00:00+00:00',
493 '2180-01-01 00:00:00+00:00', '2200-01-01 00:00:00+00:00']
494 ],
495 [datetime.timedelta(weeks=52),
496 ['1997-01-01 00:00:00+00:00', '1997-02-01 00:00:00+00:00',
497 '1997-03-01 00:00:00+00:00', '1997-04-01 00:00:00+00:00',
498 '1997-05-01 00:00:00+00:00', '1997-06-01 00:00:00+00:00',
499 '1997-07-01 00:00:00+00:00', '1997-08-01 00:00:00+00:00',
500 '1997-09-01 00:00:00+00:00', '1997-10-01 00:00:00+00:00',
501 '1997-11-01 00:00:00+00:00', '1997-12-01 00:00:00+00:00']
502 ],
503 [datetime.timedelta(days=141),
504 ['1997-01-01 00:00:00+00:00', '1997-01-15 00:00:00+00:00',
505 '1997-02-01 00:00:00+00:00', '1997-02-15 00:00:00+00:00',
506 '1997-03-01 00:00:00+00:00', '1997-03-15 00:00:00+00:00',
507 '1997-04-01 00:00:00+00:00', '1997-04-15 00:00:00+00:00',
508 '1997-05-01 00:00:00+00:00', '1997-05-15 00:00:00+00:00']
509 ],
510 [datetime.timedelta(days=40),
511 ['1997-01-01 00:00:00+00:00', '1997-01-05 00:00:00+00:00',
512 '1997-01-09 00:00:00+00:00', '1997-01-13 00:00:00+00:00',
513 '1997-01-17 00:00:00+00:00', '1997-01-21 00:00:00+00:00',
514 '1997-01-25 00:00:00+00:00', '1997-01-29 00:00:00+00:00',
515 '1997-02-01 00:00:00+00:00', '1997-02-05 00:00:00+00:00',
516 '1997-02-09 00:00:00+00:00']
517 ],
518 [datetime.timedelta(hours=40),
519 ['1997-01-01 00:00:00+00:00', '1997-01-01 04:00:00+00:00',
520 '1997-01-01 08:00:00+00:00', '1997-01-01 12:00:00+00:00',
521 '1997-01-01 16:00:00+00:00', '1997-01-01 20:00:00+00:00',
522 '1997-01-02 00:00:00+00:00', '1997-01-02 04:00:00+00:00',
523 '1997-01-02 08:00:00+00:00', '1997-01-02 12:00:00+00:00',
524 '1997-01-02 16:00:00+00:00']
525 ],
526 [datetime.timedelta(minutes=20),
527 ['1997-01-01 00:00:00+00:00', '1997-01-01 00:05:00+00:00',
528 '1997-01-01 00:10:00+00:00', '1997-01-01 00:15:00+00:00',
529 '1997-01-01 00:20:00+00:00']
530 ],
531 [datetime.timedelta(seconds=40),
532 ['1997-01-01 00:00:00+00:00', '1997-01-01 00:00:05+00:00',
533 '1997-01-01 00:00:10+00:00', '1997-01-01 00:00:15+00:00',
534 '1997-01-01 00:00:20+00:00', '1997-01-01 00:00:25+00:00',
535 '1997-01-01 00:00:30+00:00', '1997-01-01 00:00:35+00:00',
536 '1997-01-01 00:00:40+00:00']
537 ],

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…