10000 Bug in AutoDateLocator when dates are in reverse order by cimarronm · Pull Request #3524 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Bug in AutoDateLocator when dates are in reverse order #3524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 19, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
STY/TST: pep8 fixes for test_dates
  • Loading branch information
cimarronm committed Sep 19, 2014
commit 63c52f8ae16471c366e073dd96d2c3f24c38166b
1 change: 0 additions & 1 deletion lib/matplotlib/tests/test_coding_standards.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
'*/matplotlib/tri/triinterpolate.py',
'*/matplotlib/tests/test_axes.py',
'*/matplotlib/tests/test_bbox_tight.py',
'*/matplotlib/tests/test_dates.py',
'*/matplotlib/tests/test_delaunay.py',
'*/matplotlib/tests/test_dviread.py',
'*/matplotlib/tests/test_image.py',
Expand Down
15 changes: 9 additions & 6 deletions lib/matplotlib/tests/test_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ def test_DateFormatter():
def test_date_formatter_callable():
scale = -11
locator = mock.Mock(_get_unit=mock.Mock(return_value=scale))
callable_formatting_function = lambda dates, _: \
[dt.strftime('%d-%m//%Y') for dt in dates]
callable_formatting_function = (lambda dates, _:
[dt.strftime('%d-%m//%Y') for dt in dates])

formatter = mdates.AutoDateFormatter(locator)
formatter.scaled[-10] = callable_formatting_function
assert_equal(formatter([datetime.datetime(2014, 12, 25)]),
Expand Down Expand Up @@ -223,7 +223,8 @@ def test_auto_date_locator():
def _create_auto_date_locator(date1, date2):
locator = mdates.AutoDateLocator()
locator.create_dummy_axis()
locator.set_view_interval(mdates.date2num(date1), mdates.date2num(date2))
locator.set_view_interval(mdates.date2num(date1),
mdates.date2num(date2))
return locator

d1 = datetime.datetime(1990, 1, 1)
Expand Down Expand Up @@ -275,8 +276,10 @@ def _create_auto_date_locator(date1, date2):
'1990-01-01 00:00:40+00:00']
],
[datetime.timedelta(microseconds=1500),
['1989-12-31 23:59:59.999507+00:00', '1990-01-01 00:00:00+00:00',
'1990-01-01 00:00:00.000502+00:00', '1990-01-01 00:00:00.001005+00:00',
['1989-12-31 23:59:59.999507+00:00',
'1990-01-01 00:00:00+00:00',
'1990-01-01 00:00:00.000502+00:00',
'1990-01-01 00:00:00.001005+00:00',
'1990-01-01 00:00:00.001508+00:00']
],
)
Expand Down
0