Repository navigation
Align coarsen chunks by default - #6580
Merged
Merged
Conversation
dcherian
commented
Aug 30, 2020
| def test_coarsen_with_excess(): | ||
| x = da.arange(10, chunks=5) | ||
| assert_eq(da.coarsen(np.min, x, {0: 3}, trim_excess=True), np.array([0, 5])) | ||
| assert_eq(da.coarsen(np.min, x, {0: 5}, trim_excess=True), np.array([0, 5])) |
Collaborator
Author
There was a problem hiding this comment.
This function tests for the existing behaviour so it had to be changed...
This is a big backwards incompatible change. I do not know how you want to deal with that.
|
|
||
| def test_aligned_coarsen_chunks(): | ||
|
|
||
| from ..routines import aligned_coarsen_chunks as acc |
Collaborator
Author
There was a problem hiding this comment.
as acc avoids bad black formatting in the assert statements below
mrocklin
reviewed
Aug 30, 2020
mrocklin
reviewed
Aug 30, 2020
Member
|
Thanks @dcherian ! |
Collaborator
Author
|
You're welcome! |
kumarprabhu1988
pushed a commit
to kumarprabhu1988/dask
that referenced
this pull request
Oct 29, 2020
Member
|
I'm seeing an error in chunks = (3125,3125) # sums to 6250
aligned_coarsen_chunks(chunks, 16)
# returns (3136, 3120), sums to 6256, will cause exceptions laterI'm still trying to figure out where this creeps in, but maybe @dcherian will find it faster :) In particular, I'm suspicious of / confused by the third branch in this conditional (what is special about 5?): if q == 0:
continue
elif r == 0:
newchunks.append(chunk_size)
elif r >= 5:
newchunks.append(choose_new_size(multiple, q + 1, left))
else:
newchunks.append(choose_new_size(multiple, q, left)) |
Collaborator
Author
|
5 is definitely wrong I think it should be |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
black dask/flake8 dask