Skip to content

Commit 2c4d7d0

Browse files
committed
Move tests upder plotting and other corrections
1 parent c545273 commit 2c4d7d0

21 files changed

+139
-43
lines changed

pandas/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,13 @@
4747
merge_ordered, merge_asof)
4848
from pandas.tools.pivot import pivot_table, crosstab
4949

50-
# deprecated
50+
# deprecate tools.plotting, and directly imported scatter_matrix
5151
import pandas.tools.plotting
52-
from pandas.plotting import scatter_matrix, plot_params
52+
from pandas.plotting import plot_params
53+
from pandas.util.decorators import deprecate
54+
scatter_matrix = deprecate('pandas.scatter_matrix', pandas.plotting.scatter_matrix,
55+
'pandas.plotting.scatter_matrix')
56+
5357
from pandas.tools.tile import cut, qcut
5458
from pandas.tools.util import to_numeric
5559
from pandas.core.reshape import melt

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
import pandas.core.ops as ops
9191
import pandas.formats.format as fmt
9292
from pandas.formats.printing import pprint_thing
93-
import pandas.plotting.plotting as gfx
93+
import pandas.plotting.core as gfx
9494

9595
import pandas.lib as lib
9696
import pandas.algos as _algos

pandas/core/groupby.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3997,7 +3997,7 @@ def count(self):
39973997
return self._wrap_agged_blocks(data.items, list(blk))
39983998

39993999

4000-
from pandas.plotting.plotting import boxplot_frame_groupby # noqa
4000+
from pandas.plotting.core import boxplot_frame_groupby # noqa
40014001
DataFrameGroupBy.boxplot = boxplot_frame_groupby
40024002

40034003

pandas/core/series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2997,7 +2997,7 @@ def __init__(self, *args, **kwargs):
29972997
# ----------------------------------------------------------------------
29982998
# Add plotting methods to Series
29992999

3000-
import pandas.plotting.plotting as _gfx # noqa
3000+
import pandas.plotting.core as _gfx # noqa
30013001

30023002
Series.plot = base.AccessorProperty(_gfx.SeriesPlotMethods,
30033003
_gfx.SeriesPlotMethods)

pandas/plotting/api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
# flake8: noqa
66

77
try: # mpl optional
8-
from pandas.plotting import converter as conv
9-
conv.register() # needs to override so set_xlim works with str/number
8+
from pandas.plotting import converter
9+
converter.register() # needs to override so set_xlim works with str/number
1010
except ImportError:
1111
pass
1212

1313
from pandas.plotting.misc import (scatter_matrix, radviz,
1414
andrews_curves, bootstrap_plot,
1515
parallel_coordinates, lag_plot,
1616
autocorrelation_plot)
17-
from pandas.plotting.plotting import (boxplot, scatter_plot, grouped_hist,
18-
hist_frame, hist_series)
17+
from pandas.plotting.core import (boxplot, scatter_plot, grouped_hist,
18+
hist_frame, hist_series)
1919
from pandas.plotting.style import plot_params
20-
from pandas.plotting.tools import table
20+
from pandas.plotting.tools import table
File renamed without changes.
File renamed without changes.

pandas/tests/plotting/common.py renamed to pandas/plotting/tests/common.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ def setUp(self):
7272
self.default_tick_position = 'left' if self.mpl_ge_2_0_0 else 'default'
7373
# common test data
7474
from pandas import read_csv
75-
path = os.path.join(os.path.dirname(curpath()), 'data', 'iris.csv')
75+
base = os.path.split(os.path.dirname(curpath()))[:-1]
76+
print(os.path.dirname(curpath()), base)
77+
path = os.path.join(*base,
78+
'tests', 'data', 'iris.csv')
7679
self.iris = read_csv(path)
7780

7881
n = 100

pandas/tests/plotting/test_boxplot_method.py renamed to pandas/plotting/tests/test_boxplot_method.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
from numpy import random
1515
from numpy.random import randn
1616

17-
import pandas.tools.plotting as plotting
17+
import pandas.plotting as plotting
1818

19-
from pandas.tests.plotting.common import (TestPlotBase, _check_plot_works)
19+
from pandas.plotting.tests.common import (TestPlotBase, _check_plot_works)
2020

2121

2222
""" Test cases for .boxplot method """

0 commit comments

Comments
 (0)