Skip to content

Commit

Permalink
Merge pull request rapidsai#129 from vyasr/feat/rename_proxy_xdf_members
Browse files Browse the repository at this point in the history
Rename proxy members
  • Loading branch information
shwina committed Oct 26, 2023
2 parents 53d7b5e + 5c35ff3 commit cad93bd
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 103 deletions.
10 changes: 5 additions & 5 deletions python/cudf/cudf/pandas/_wrappers/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


def array_method(self: _FastSlowProxy, *args, **kwargs):
return self._xdf_slow.__array__(*args, **kwargs)
return self._fsproxy_slow.__array__(*args, **kwargs)


def array_function_method(self, func, types, args, kwargs):
Expand All @@ -43,15 +43,15 @@ def arrow_array_method(self: _FastSlowProxy, *args, **kwargs):
import pyarrow as pa

try:
return self._xdf_fast.to_arrow(*args, **kwargs)
return self._fsproxy_fast.to_arrow(*args, **kwargs)
except Exception:
return pa.array(self._xdf_slow, *args, **kwargs)
return pa.array(self._fsproxy_slow, *args, **kwargs)


@property # type: ignore
def cuda_array_interface(self: _FastSlowProxy):
return self._xdf_fast.__cuda_array_interface__
return self._fsproxy_fast.__cuda_array_interface__


def custom_iter(self: _FastSlowProxy):
return iter(self._xdf_slow)
return iter(self._fsproxy_slow)
6 changes: 3 additions & 3 deletions python/cudf/cudf/pandas/_wrappers/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ def wrap_ndarray(cls, arr: cupy.ndarray | numpy.ndarray, constructor):
else:
# Note, this super call means that the constructed ndarray
# class cannot be subclassed (because then super(cls,
# cls)._xdf_wrap produces an infinite loop). Really this
# cls)._fsproxy_wrap produces an infinite loop). Really this
# should be super(ndarray, cls), but we don't have access to
# the ndarray type until after we need to pass this function
# in. So it works for now since without subclassing,
# super(ndarray, cls) == super(ndarray, ndarray) == super(cls,
# cls)
return super(cls, cls)._xdf_wrap(arr, constructor)
return super(cls, cls)._fsproxy_wrap(arr, constructor)


ndarray = make_final_proxy_type(
Expand All @@ -128,7 +128,7 @@ def wrap_ndarray(cls, arr: cupy.ndarray | numpy.ndarray, constructor):
# iter(numpy-array) produces an iterable of scalars)
"__iter__": custom_iter,
# Special wrapping to handle scalar values
"_xdf_wrap": classmethod(wrap_ndarray),
"_fsproxy_wrap": classmethod(wrap_ndarray),
},
)

Expand Down
Loading

0 comments on commit cad93bd

Please sign in to comment.