Skip to content

Asymmetrical Array Overlap - #4863

Merged
jakirkham merged 13 commits into
dask:masterfrom
Quansight-Labs:overlap
Jun 20, 2019
Merged

jakirkham merged 13 commits into
dask:masterfrom
Quansight-Labs:overlap

Conversation

@mpeaton

@mpeaton mpeaton commented May 31, 2019

Copy link
Copy Markdown
Contributor
  • [ x] Tests added / passed
  • [x ] Passes flake8 dask

@mpeaton mpeaton changed the title Overlap Allow dictionary of tuples to be passed as depth to overlap_internal for asymmetrical overlap May 31, 2019
@mpeaton mpeaton changed the title Allow dictionary of tuples to be passed as depth to overlap_internal for asymmetrical overlap Assymetrical Array Overlap May 31, 2019
@mpeaton mpeaton changed the title Assymetrical Array Overlap Asymmetrical Array Overlap May 31, 2019
@TomAugspurger

Copy link
Copy Markdown
Member

Is this closing an issue?

@mpeaton

mpeaton commented May 31, 2019 via email

Copy link
Copy Markdown
Contributor Author

@TomAugspurger

TomAugspurger commented May 31, 2019 via email

Copy link
Copy Markdown
Member

@mpeaton

mpeaton commented May 31, 2019 via email

Copy link
Copy Markdown
Contributor Author

@mrocklin

Copy link
Copy Markdown
Member

@mpeaton please include motivation for why this change should be merged into this codebase. Ideally you would present what didn't work before and an english description of what this PR changes to improve the situation, and why it's important.

Please note that while you may be paid, you're asking people who are not being paid by your client to review your work, and then maintain it going forward.

You may want to look at some of the other PRs to get a sense for what is expected.

@mpeaton

mpeaton commented May 31, 2019

Copy link
Copy Markdown
Contributor Author

Yes of course, sorry for the brevity, I presumed that the value of the aforementioned change would be evident upon inspection.

Currently, the overlap functions take an argument depth which can be a scaler, or a dictionary of scalers which represent the overlap region between chunks to be included in neighboring chunks.

For applications, such as causal processing or other directional flow, it may be unnecessary or even erroneous to include equivalent overlap in both directions.

This change introduces the possibility to include a tuple of ( - / + ) directional scaler parameters to specify the overlap between blocks in different directions.

For example, in test_overlap_internal_asym() . the following results from overlap specified as depth={0: (0, 2), 1:(0, 1)}. As such, chunks are appended overlap of 0 for the left chunk, 2 for the right chunk, in the first dimension; 0 for the top chunk, and 1 for the bottom chunk in the second dimension yielding the following result with chunk sizes (4,6) (4,5) . given an original 8x8 array of chunk (4,4) (4,4)

[ 0, 1, 2, 3, 3, 4, 5, 6, 7],
[ 8, 9, 10, 11, 11, 12, 13, 14, 15],
[16, 17, 18, 19, 19, 20, 21, 22, 23],
[24, 25, 26, 27, 27, 28, 29, 30, 31],

[16, 17, 18, 19, 19, 20, 21, 22, 23],
[24, 25, 26, 27, 27, 28, 29, 30, 31],
[32, 33, 34, 35, 35, 36, 37, 38, 39],
[40, 41, 42, 43, 43, 44, 45, 46, 47],
[48, 49, 50, 51, 51, 52, 53, 54, 55],
[56, 57, 58, 59, 59, 60, 61, 62, 63]])

@mpeaton

mpeaton commented May 31, 2019

Copy link
Copy Markdown
Contributor Author

Also, I realize that there may be some feedback here for a comprehensive solution. Please feel free to reach out through any channel.

@jakirkham

Copy link
Copy Markdown
Member

I'll echo what others have said and encourage raising an issue if the change is non-trivial before opening a PR. This will give us time to discuss and help us reach consensus in terms of how to approach the fix and maximize efficiency when coding a fix.

@jakirkham

jakirkham commented May 31, 2019 •

Copy link
Copy Markdown
Member

That said, it sounds like what is being solved here is issue ( #2254 ), which I should add is great. Thanks for thinking about this. Have cc'd you on that issue as well.

Comment thread dask/array/overlap.py Resolved
@mpeaton

mpeaton commented Jun 6, 2019 via email

Copy link
Copy Markdown
Contributor Author

Comment thread dask/array/overlap.py Resolved
Comment thread dask/array/overlap.py Resolved
Comment thread dask/array/overlap.py Resolved
@jakirkham

Copy link
Copy Markdown
Member

I pushed some minor stylistic fixes. Hope that is ok.

Looks like there are some pieces that appear to be incomplete above. So had some questions about what still remains to be done there.

@jcrist

jcrist commented Jun 17, 2019

Copy link
Copy Markdown
Member

@jakirkham - can you make another review pass at this?

Comment thread dask/array/overlap.py Resolved
Comment thread dask/array/overlap.py Resolved
Comment thread dask/array/overlap.py Resolved
Comment thread dask/array/overlap.py Resolved
Comment thread dask/array/overlap.py Resolved
@jrbourbeau

Copy link
Copy Markdown
Member

I just pushed a few small commits, hope that's okay @mpeaton. At this point, all tests are passing and I think this should be ready for a final review

@jakirkham

Copy link
Copy Markdown
Member

Merging in 24hrs if no comments.

@jakirkham jakirkham mentioned this pull request Jun 20, 2019
@jakirkham
jakirkham merged commit 5406d77 into dask:master Jun 20, 2019
@jakirkham

jakirkham commented Jun 20, 2019 •

Copy link
Copy Markdown
Member

Thanks @mpeaton and thanks everyone for the reviews! 😄

@mpeaton

mpeaton commented Jun 20, 2019

Copy link
Copy Markdown
Contributor Author

Thank you @jakirkham @jrbourbeau for your assistance.

@shoyer

shoyer commented Jun 20, 2019

Copy link
Copy Markdown
Member

This is actually very timely -- we have a use case for assymetric overlap padding to do rolling windows in xarray. Thanks @mpeaton!

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.

7 participants