Repository navigation
Asymmetrical Array Overlap - #4863
Conversation
|
Is this closing an issue? |
|
No
… On May 30, 2019, at 11:12 PM, Tom Augspurger ***@***.***> wrote:
Is this closing an issue?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#4863?email_source=notifications&email_token=AAGJCEMJWXN2LEVF2D2NMQTPYCJQTA5CNFSM4HRPMTUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWUCPPQ#issuecomment-497559486>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGJCEN2VER36GYR7RCD7K3PYCJQTANCNFSM4HRPMTUA>.
|
|
Can you provide some motivation for the Changes?
… On May 31, 2019, at 04:01, Michael Eaton ***@***.***> wrote:
No
> On May 30, 2019, at 11:12 PM, Tom Augspurger ***@***.***> wrote:
>
> Is this closing an issue?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub <#4863?email_source=notifications&email_token=AAGJCEMJWXN2LEVF2D2NMQTPYCJQTA5CNFSM4HRPMTUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWUCPPQ#issuecomment-497559486>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGJCEN2VER36GYR7RCD7K3PYCJQTANCNFSM4HRPMTUA>.
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
The change is motivated by a client that requires overlap in only one direction for specific use case.
… On May 31, 2019, at 7:26 AM, Tom Augspurger ***@***.***> wrote:
Can you provide some motivation for the Changes?
> On May 31, 2019, at 04:01, Michael Eaton ***@***.***> wrote:
>
> No
>
>
> > On May 30, 2019, at 11:12 PM, Tom Augspurger ***@***.***> wrote:
> >
> > Is this closing an issue?
> >
> > —
> > You are receiving this because you authored the thread.
> > Reply to this email directly, view it on GitHub <#4863?email_source=notifications&email_token=AAGJCEMJWXN2LEVF2D2NMQTPYCJQTA5CNFSM4HRPMTUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWUCPPQ#issuecomment-497559486>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGJCEN2VER36GYR7RCD7K3PYCJQTANCNFSM4HRPMTUA>.
> >
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub, or mute the thread.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#4863?email_source=notifications&email_token=AAGJCEKGWJT543YVWFMJQDDPYEDO3A5CNFSM4HRPMTUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWU62II#issuecomment-497675553>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGJCEPQ3M3YYEJ2C7UGCSDPYEDO3ANCNFSM4HRPMTUA>.
|
|
@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. |
|
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], [16, 17, 18, 19, 19, 20, 21, 22, 23], |
|
Also, I realize that there may be some feedback here for a comprehensive solution. Please feel free to reach out through any channel. |
|
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. |
|
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. |
|
Ok
… On Jun 6, 2019, at 6:26 PM, Matthew Rocklin ***@***.***> wrote:
@mrocklin commented on this pull request.
In dask/array/overlap.py <#4863 (comment)>:
> + def __init__(self, axes):
+ self.one = [0] * len(axes)
+ self.two = [0] * len(axes)
+ self.total = [0] * len(axes)
+
+ for i,idepth in axes.items():
+ idepth = axes.get(i,0)
+ if isinstance(idepth,tuple):
+ self.one[i] = idepth[0]
+ self.two[i] = idepth[1]
+ self.total[i] = self.one[i] + self.two[i]
+
+ else:
+ self.one[i] = idepth
+ self.two[i] = idepth
+ self.total[i] = self.one[i] + self.two[i]
It looks like this is the major blocker. @mpeaton <https://github.com/mpeaton> I think that the ask here is that you switch back to using tuples. In general in this project we try to keep to core data structures when possible. This ends up keeping things somewhat easier to review, especially because people jump around a lot, and tend not to invest much in abstractions for any particular part of the code.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#4863?email_source=notifications&email_token=AAGJCEJRY65GX2OFOHZEFOTPZGFIFA5CNFSM4HRPMTUKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB23I7VQ#discussion_r291395098>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGJCENJAWX6SAMDX7B4O3DPZGFIFANCNFSM4HRPMTUA>.
|
|
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. |
|
@jakirkham - can you make another review pass at this? |
|
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 |
|
Merging in 24hrs if no comments. |
|
Thanks @mpeaton and thanks everyone for the reviews! 😄 |
|
Thank you @jakirkham @jrbourbeau for your assistance. |
|
This is actually very timely -- we have a use case for assymetric overlap padding to do rolling windows in xarray. Thanks @mpeaton! |
flake8 dask