Skip to content

Commit

Permalink
fix converter import
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche committed Apr 15, 2017
1 parent 09291e2 commit 468313a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions pandas/tests/plotting/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
from datetime import datetime, date

import numpy as np
import matplotlib.dates as dates
from pandas import Timestamp, Period, Index
from pandas.compat import u
import pandas.util.testing as tm
from pandas.tseries.offsets import Second, Milli, Micro, Day
from pandas.compat.numpy import np_datetime64_compat

converter = pytest.importorskip('pandas.tseries.converter')
converter = pytest.importorskip('pandas.plotting._converter')


def test_timtetonum_accepts_unicode():
Expand Down Expand Up @@ -84,7 +83,7 @@ def test_conversion_float(self):

rs = self.dtc.convert(
Timestamp('2012-1-1 01:02:03', tz='UTC'), None, None)
xp = dates.date2num(Timestamp('2012-1-1 01:02:03', tz='UTC'))
xp = converter.dates.date2num(Timestamp('2012-1-1 01:02:03', tz='UTC'))
tm.assert_almost_equal(rs, xp, decimals)

rs = self.dtc.convert(
Expand All @@ -98,18 +97,18 @@ def test_conversion_outofbounds_datetime(self):
# 2579
values = [date(1677, 1, 1), date(1677, 1, 2)]
rs = self.dtc.convert(values, None, None)
xp = dates.date2num(values)
xp = converter.dates.date2num(values)
tm.assert_numpy_array_equal(rs, xp)
rs = self.dtc.convert(values[0], None, None)
xp = dates.date2num(values[0])
xp = converter.dates.date2num(values[0])
self.assertEqual(rs, xp)

values = [datetime(1677, 1, 1, 12), datetime(1677, 1, 2, 12)]
rs = self.dtc.convert(values, None, None)
xp = dates.date2num(values)
xp = converter.dates.date2num(values)
tm.assert_numpy_array_equal(rs, xp)
rs = self.dtc.convert(values[0], None, None)
xp = dates.date2num(values[0])
xp = converter.dates.date2num(values[0])
self.assertEqual(rs, xp)

def test_time_formatter(self):
Expand All @@ -121,7 +120,7 @@ def test_dateindex_conversion(self):
for freq in ('B', 'L', 'S'):
dateindex = tm.makeDateIndex(k=10, freq=freq)
rs = self.dtc.convert(dateindex, None, None)
xp = dates.date2num(dateindex._mpl_repr())
xp = converter.dates.date2num(dateindex._mpl_repr())
tm.assert_almost_equal(rs, xp, decimals)

def test_resolution(self):
Expand Down

0 comments on commit 468313a

Please sign in to comment.