Skip to content

[WIP] Blockwise from array#6984

Closed
ian-r-rose wants to merge 5 commits intodask:mainfrom
ian-r-rose:blockwise-from-array
Closed

[WIP] Blockwise from array#6984
ian-r-rose wants to merge 5 commits intodask:mainfrom
ian-r-rose:blockwise-from-array

Conversation

@ian-r-rose
Copy link
Collaborator

@ian-r-rose ian-r-rose commented Dec 17, 2020

Follow-up to #6931. Switches from_array and its ilk (zarr, hdf5) to use BlockwiseIO.

  • Tests added / passed
  • Passes black dask / flake8 dask

@ian-r-rose ian-r-rose changed the title ]WIP] Blockwise from array [WIP] Blockwise from array Dec 17, 2020
else:
# Common case, drop extra parameters
values = [(getitem, arr, x) for x in slices]
getter = partial(getitem, arr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general we prefer to avoid including partial, lambdas, closures, or other dynamically generated functions in task graphs. They're harder to serialize.

return list(product(*slices))


def getem(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check with Xarray tests to make sure that we don't break anything there. They may use this (I hope not though).

@mrocklin
Copy link
Member

@rjzamora if you have a moment can you take a look at this?

@ian-r-rose
Copy link
Collaborator Author

I think the thing which will be trickiest here is rewriting slicing to propagate down to the array access level. The blockwise IO layer is opaque, so any subsequent slicing can't get past it. If I understand the corresponding parquet code on the dataframe side, there is rewriting of the blockwise IO in the optimization phase to get around this. Is that right @rjzamora?

Base automatically changed from master to main March 8, 2021 20:19
@ian-r-rose ian-r-rose mentioned this pull request Mar 19, 2021
2 tasks
@ian-r-rose
Copy link
Collaborator Author

Superseded by #7417

@ian-r-rose ian-r-rose closed this Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants