Skip to content

Commit

Permalink
Revert "Revert "MAINT: Remove Long and WidePanel (pandas-dev#15748)" (p…
Browse files Browse the repository at this point in the history
…andas-dev#15802)" [skip ci]

This reverts commit 22f9d0d.
  • Loading branch information
gfyoung committed Dec 31, 2017
1 parent cfa5ea6 commit f94b1d8
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 42 deletions.
5 changes: 0 additions & 5 deletions asv_bench/benchmarks/pandas_vb_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ def teardown(self, *args, **kwargs):
except:
pass

try:
Panel = Panel
except Exception:
Panel = WidePanel

# didn't add to namespace until later
try:
from pandas.core.index import MultiIndex
Expand Down
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.23.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ Removal of prior version deprecations/changes
- :func:`read_csv` has dropped the ``compact_ints`` and ``use_unsigned`` parameters (:issue:`13323`)
- The ``Timestamp`` class has dropped the ``offset`` attribute in favor of ``freq`` (:issue:`13593`)
- The ``Series``, ``Categorical``, and ``Index`` classes have dropped the ``reshape`` method (:issue:`13012`)
- The ``LongPanel`` and ``WidePanel`` classes have been removed (:issue:`10892`)

.. _whatsnew_0230.performance:

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from pandas.core.series import Series
from pandas.core.frame import DataFrame
from pandas.core.panel import Panel, WidePanel
from pandas.core.panel import Panel
from pandas.core.panel4d import Panel4D

# TODO: Remove import when statsmodels updates #18264
Expand Down
21 changes: 0 additions & 21 deletions pandas/core/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1624,24 +1624,3 @@ def f(self, other, axis=0):
ops.add_special_arithmetic_methods(Panel, **ops.panel_special_funcs)
Panel._add_aggregate_operations()
Panel._add_numeric_operations()


# legacy
class WidePanel(Panel):

def __init__(self, *args, **kwargs):
# deprecation, #10892
warnings.warn("WidePanel is deprecated. Please use Panel",
FutureWarning, stacklevel=2)

super(WidePanel, self).__init__(*args, **kwargs)


class LongPanel(DataFrame):

def __init__(self, *args, **kwargs):
# deprecation, #10892
warnings.warn("LongPanel is deprecated. Please use DataFrame",
FutureWarning, stacklevel=2)

super(LongPanel, self).__init__(*args, **kwargs)
3 changes: 0 additions & 3 deletions pandas/tests/io/test_pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -3124,9 +3124,6 @@ def _check(left, right):
wp = tm.makePanel()
self._check_roundtrip(wp.to_frame(), _check)

def test_longpanel(self):
pass

def test_overwrite_node(self):

with ensure_clean_store(self.path) as store:
Expand Down
16 changes: 4 additions & 12 deletions pandas/tests/test_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,6 @@ def wrapper(x):

class SafeForSparse(object):

@classmethod
def assert_panel_equal(cls, x, y):
assert_panel_equal(x, y)

def test_get_axis(self):
assert (self.panel._get_axis(0) is self.panel.items)
assert (self.panel._get_axis(1) is self.panel.major_axis)
Expand Down Expand Up @@ -903,10 +899,6 @@ def test_set_value(self):
class TestPanel(PanelTests, CheckIndexing, SafeForLongAndSparse,
SafeForSparse):

@classmethod
def assert_panel_equal(cls, x, y):
assert_panel_equal(x, y)

def setup_method(self, method):
self.panel = make_test_panel()
self.panel.major_axis.name = None
Expand Down Expand Up @@ -2152,8 +2144,8 @@ def test_multiindex_get(self):
assert (f1.items == [1, 2]).all()
assert (f2.items == [1, 2]).all()

ind = MultiIndex.from_tuples([('a', 1), ('a', 2), ('b', 1)],
names=['first', 'second'])
MultiIndex.from_tuples([('a', 1), ('a', 2), ('b', 1)],
names=['first', 'second'])

def test_multiindex_blocks(self):
with catch_warnings(record=True):
Expand Down Expand Up @@ -2458,9 +2450,9 @@ def test_sort_values(self):
pytest.raises(NotImplementedError, self.panel.sort_values, 'ItemA')


class TestLongPanel(object):
class TestPanelFrame(object):
"""
LongPanel no longer exists, but...
Check that conversions to and from Panel to DataFrame work.
"""

def setup_method(self, method):
Expand Down

0 comments on commit f94b1d8

Please sign in to comment.