Skip to content
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

LAMA to Dask: (deprecate) Data.concatenate_data #426

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions cf/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5640,37 +5640,6 @@ def apply_masking(

return d

@classmethod
def concatenate_data(cls, data_list, axis):
"""Concatenates a list of Data objects into a single Data object
along the specified access (see cf.Data.concatenate for
details). In the case that the list contains only one element,
that element is simply returned.

:Parameters:

data_list: `list`
The list of data objects to concatenate.

axis: `int`
The axis along which to perform the concatenation.

:Returns:

`Data`
The resulting single `Data` object.

"""
if len(data_list) > 1:
data = cls.concatenate(data_list, axis=axis)
if data.fits_in_one_chunk_in_memory(data.dtype.itemsize):
data.varray

return data
else:
assert len(data_list) == 1
return data_list[0]

def argmax(self, axis=None, unravel=False):
"""Return the indices of the maximum values along an axis.

Expand Down
29 changes: 29 additions & 0 deletions cf/data/mixin/deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,3 +966,32 @@ def reconstruct_sectioned_data(cls, sections, cyclic=(), hardmask=None):
"Data method 'reconstruct_sectioned_data' has been deprecated "
"at version TODODASK and is no longer available"
)

@classmethod
def concatenate_data(cls, data_list, axis):
"""Concatenates a list of Data objects along the specified axis.

See cf.Data.concatenate for details.

In the case that the list contains only one element, that element
is simply returned.

:Parameters:

data_list: `list`
The list of data objects to concatenate.

axis: `int`
The axis along which to perform the concatenation.

:Returns:

`Data`
The resulting single `Data` object.

"""
raise DeprecationError(
"Data method 'concatenate_data' has been deprecated at "
"version TODODASK and is no longer available. Use "
"'concatenate' instead."
)