Skip to content

Commit

Permalink
Rename FrameOneD to SingleColumnFrame.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed May 3, 2021
1 parent fa2f4f0 commit 6c2ee13
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions python/cudf/cudf/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3301,10 +3301,10 @@ def _reindex(
return self._mimic_inplace(result, inplace=inplace)


class FrameOneD(Frame):
class SingleColumnFrame(Frame):
"""A one-dimensional frame.
Frames with only a single dimension share certain logic that is encoded in
Frames with only a single column share certain logic that is encoded in
this class.
"""

Expand Down Expand Up @@ -3459,7 +3459,7 @@ def from_arrow(cls, array):
Returns
-------
FrameOneD
SingleColumnFrame
Examples
--------
Expand Down
22 changes: 11 additions & 11 deletions python/cudf/cudf/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
)
from cudf.core.column.string import StringMethods as StringMethods
from cudf.core.dtypes import IntervalDtype
from cudf.core.frame import FrameOneD
from cudf.core.frame import SingleColumnFrame
from cudf.utils import ioutils
from cudf.utils.docutils import copy_docstring
from cudf.utils.dtypes import (
Expand All @@ -45,7 +45,7 @@
from cudf.utils.utils import cached_property, search_range


class Index(FrameOneD, Serializable):
class Index(SingleColumnFrame, Serializable):

dtype: DtypeObj

Expand Down Expand Up @@ -1427,7 +1427,7 @@ def _from_table(cls, table):

@classmethod
def _from_data(cls, data, index=None):
return cls._from_table(FrameOneD(data=data))
return cls._from_table(SingleColumnFrame(data=data))

@property
def _constructor_expanddim(self):
Expand Down Expand Up @@ -1474,7 +1474,7 @@ def __new__(
if step == 0:
raise ValueError("Step must not be zero.")

out = FrameOneD.__new__(cls)
out = SingleColumnFrame.__new__(cls)
if isinstance(start, range):
therange = start
start = therange.start
Expand Down Expand Up @@ -1827,7 +1827,7 @@ def __new__(cls, values, **kwargs):
Column's name. Otherwise if this name is different from the value
Column's, the values Column will be cloned to adopt this name.
"""
out = FrameOneD.__new__(cls)
out = SingleColumnFrame.__new__(cls)
out._initialize(values, **kwargs)

return out
Expand Down Expand Up @@ -2043,7 +2043,7 @@ class NumericIndex(GenericIndex):

def __new__(cls, data=None, dtype=None, copy=False, name=None):

out = FrameOneD.__new__(cls)
out = SingleColumnFrame.__new__(cls)
dtype = _index_to_dtype[cls]
if copy:
data = column.as_column(data, dtype=dtype).copy()
Expand Down Expand Up @@ -2165,7 +2165,7 @@ def __new__(
# pandas dtindex creation first which. For now
# just make sure we handle np.datetime64 arrays
# and then just dispatch upstream
out = FrameOneD.__new__(cls)
out = SingleColumnFrame.__new__(cls)

if freq is not None:
raise NotImplementedError("Freq is not yet supported")
Expand Down Expand Up @@ -2420,7 +2420,7 @@ def __new__(
name=None,
) -> "TimedeltaIndex":

out = FrameOneD.__new__(cls)
out = SingleColumnFrame.__new__(cls)

if freq is not None:
raise NotImplementedError("freq is not yet supported")
Expand Down Expand Up @@ -2552,7 +2552,7 @@ def __new__(
)
if copy:
data = column.as_column(data, dtype=dtype).copy(deep=True)
out = FrameOneD.__new__(cls)
out = SingleColumnFrame.__new__(cls)
kwargs = _setdefault_name(data, name=name)
if isinstance(data, CategoricalColumn):
data = data
Expand Down Expand Up @@ -2778,7 +2778,7 @@ def __new__(
) -> "IntervalIndex":
if copy:
data = column.as_column(data, dtype=dtype).copy()
out = FrameOneD.__new__(cls)
out = SingleColumnFrame.__new__(cls)
kwargs = _setdefault_name(data, name=name)
if isinstance(data, IntervalColumn):
data = data
Expand Down Expand Up @@ -2851,7 +2851,7 @@ class StringIndex(GenericIndex):
"""

def __new__(cls, values, copy=False, **kwargs):
out = FrameOneD.__new__(cls)
out = SingleColumnFrame.__new__(cls)
kwargs = _setdefault_name(values, **kwargs)
if isinstance(values, StringColumn):
values = values.copy(deep=copy)
Expand Down
6 changes: 3 additions & 3 deletions python/cudf/cudf/core/multiindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from cudf.core._compat import PANDAS_GE_120
from cudf.core.column import column
from cudf.core.column_accessor import ColumnAccessor
from cudf.core.frame import Frame, FrameOneD
from cudf.core.frame import Frame, SingleColumnFrame
from cudf.core.index import Index, as_index


Expand Down Expand Up @@ -572,7 +572,7 @@ def from_arrow(cls, table):
names=['a', 'b'])
"""

return super(FrameOneD, cls).from_arrow(table)
return super(SingleColumnFrame, cls).from_arrow(table)

def to_arrow(self):
"""Convert MultiIndex to PyArrow Table
Expand Down Expand Up @@ -606,7 +606,7 @@ def to_arrow(self):
]
"""

return super(FrameOneD, self).to_arrow()
return super(SingleColumnFrame, self).to_arrow()

@property
def codes(self):
Expand Down
8 changes: 4 additions & 4 deletions python/cudf/cudf/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from cudf.core.column.string import StringMethods
from cudf.core.column.struct import StructMethods
from cudf.core.column_accessor import ColumnAccessor
from cudf.core.frame import FrameOneD, _drop_rows_by_labels
from cudf.core.frame import SingleColumnFrame, _drop_rows_by_labels
from cudf.core.groupby.groupby import SeriesGroupBy
from cudf.core.index import Index, RangeIndex, as_index
from cudf.core.indexing import _SeriesIlocIndexer, _SeriesLocIndexer
Expand All @@ -61,7 +61,7 @@
)


class Series(FrameOneD, Serializable):
class Series(SingleColumnFrame, Serializable):
# The `constructor*` properties are used by `dask` (and `dask_cudf`)
@property
def _constructor(self):
Expand Down Expand Up @@ -1043,9 +1043,9 @@ def __getitem__(self, arg):
else:
return self.loc[arg]

iteritems = FrameOneD.__iter__
iteritems = SingleColumnFrame.__iter__

items = FrameOneD.__iter__
items = SingleColumnFrame.__iter__

def to_dict(self, into=dict):
raise TypeError(
Expand Down

0 comments on commit 6c2ee13

Please sign in to comment.