-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New inline_array kwarg for open_dataset #6566
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
Changes from all commits
0fb433d
8765acb
65987a9
480fd8c
b6afdd4
ecb5cc2
a2db21f
032d9f3
cae84ea
4399569
ce5758e
d582576
a2a2419
07e2c8d
070b45a
2031154
91a955f
8bed2bb
cebd89a
7dbe364
7eb0569
058630f
102b503
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1023,6 +1023,7 @@ def chunk( | |
) = {}, | ||
name: str = None, | ||
lock: bool = False, | ||
inline_array: bool = False, | ||
**chunks_kwargs: Any, | ||
) -> Variable: | ||
"""Coerce this array's data into a dask array with the given chunks. | ||
|
@@ -1046,13 +1047,23 @@ def chunk( | |
lock : optional | ||
Passed on to :py:func:`dask.array.from_array`, if the array is not | ||
already as dask array. | ||
inline_array: optional | ||
Passed on to :py:func:`dask.array.from_array`, if the array is not | ||
already as dask array. | ||
**chunks_kwargs : {dim: chunks, ...}, optional | ||
The keyword arguments form of ``chunks``. | ||
One of chunks or chunks_kwargs must be provided. | ||
|
||
Returns | ||
------- | ||
chunked : xarray.Variable | ||
|
||
See Also | ||
-------- | ||
Variable.chunks | ||
Variable.chunksizes | ||
xarray.unify_chunks | ||
dask.array.from_array | ||
""" | ||
import dask.array as da | ||
|
||
|
@@ -1098,7 +1109,9 @@ def chunk( | |
if utils.is_dict_like(chunks): | ||
chunks = tuple(chunks.get(n, s) for n, s in enumerate(self.shape)) | ||
|
||
data = da.from_array(data, chunks, name=name, lock=lock, **kwargs) | ||
data = da.from_array( | ||
data, chunks, name=name, lock=lock, inline_array=inline_array, **kwargs | ||
) | ||
|
||
return self._replace(data=data) | ||
|
||
|
@@ -2710,7 +2723,7 @@ def values(self, values): | |
f"Please use DataArray.assign_coords, Dataset.assign_coords or Dataset.assign as appropriate." | ||
) | ||
|
||
def chunk(self, chunks={}, name=None, lock=False): | ||
def chunk(self, chunks={}, name=None, lock=False, inline_array=False): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the point of this function if it doesn't do anything? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It means that |
||
# Dummy - do not chunk. This method is invoked e.g. by Dataset.chunk() | ||
return self.copy(deep=False) | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.