8000 CLN/API: move plotting funcs to pandas.plotting by jorisvandenbossche · Pull Request #16005 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

CLN/API: move plotting funcs to pandas.plotting #16005

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 12 commits into from
Apr 15, 2017
Prev Previous commit
Next Next commit
fixups from rebase
  • Loading branch information
jorisvandenbossche committed Apr 15, 2017
commit 72ffe974eb644437699957e96b7f9e8311f95c4c
6 changes: 3 additions & 3 deletions pandas/plotting/_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
from pandas.formats.printing import pprint_thing
import pandas.compat as compat

from pandas.tseries.converter import (TimeSeries_DateLocator,
TimeSeries_DateFormatter,
TimeSeries_TimedeltaFormatter)
from pandas.plotting._converter import (TimeSeries_DateLocator,
TimeSeries_DateFormatter,
TimeSeries_TimedeltaFormatter)

# ---------------------------------------------------------------------
# Plotting functions and monkey patches
Expand Down
13 changes: 7 additions & 6 deletions pandas/tests/plotting/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
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
Expand Down Expand Up @@ -83,7 +84,7 @@ def test_conversion_float(self):

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

rs = self.dtc.convert(
Expand All @@ -97,18 +98,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 = converter.dates.date2num(values)
xp = dates.date2num(values)
tm.assert_numpy_array_equal(rs, xp)
rs = self.dtc.convert(values[0], None, None)
xp = converter.dates.date2num(values[0])
xp = 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 = converter.dates.date2num(values)
xp = dates.date2num(values)
tm.assert_numpy_array_equal(rs, xp)
rs = self.dtc.convert(values[0], None, None)
xp = converter.dates.date2num(values[0])
xp = dates.date2num(values[0])
self.assertEqual(rs, xp)

def test_time_formatter(self):
Expand All @@ -120,7 +121,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 = converter.dates.date2num(dateindex._mpl_repr())
xp = dates.date2num(dateindex._mpl_repr())
tm.assert_almost_equal(rs, xp, decimals)

def test_resolution(self):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ def pxd(name):
'pandas.io.msgpack',
'pandas._libs',
'pandas.formats',
'pandas.plotting'
'pandas.plotting',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did the test module change as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the test module was already moved to pandas/tests/plotting before, so no layout changes there I think

'pandas.sparse',
'pandas.stats',
'pandas.util',
Expand Down
0