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
Rename ghost module to overlap #3830
Conversation
This looks really nice to me. cc @jakirkham @jni
It's encouraing seeing that the old test suite works cleanly. Question for the group, do we want to keep it around, or clean it up / remove it? |
Thank you for putting this together @rmsare . I think that this new name will help a lot of people find this functionality. |
Nice! I agree that this is the least-jargony name. |
If no one else has any comments then I suggest that we remove the old test suite and then merge this in. If we want to keep some tests I think that they should probably only test the warning behavior, and leave the correctness tests for test_overlap.py . I don't think it's essential that we test the warning behavior though. |
What do you mean by old tests? |
test_ghost.py and test_overlap.py are near-copies of each other
…On Wed, Aug 1, 2018 at 7:20 AM, jakirkham ***@***.***> wrote:
What do you mean by old tests?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3830 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AASszFz5nnvnOUVEWZyq9wQskAlm3JyLks5uMbkfgaJpZM4VnmuD>
.
|
I agree with removing the old tests, done. Not sure what the accepted practice would be on testing the warnings, but my preference is to not write specific tests for that kind of behavior. |
Merging this tomorrow if there are no further comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the late review here. Overall this looks fine, requested a few additional cleanups to the warnings.
dask/array/ghost.py
Outdated
|
||
index = tuple(index) | ||
warn('ghost module will be renamed to overlap, ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Request to change "will be" -> "has been". This should be done throughout.
Also request to be a bit more descriptive, since this may show up deeper in other functions. Perhaps:
warn("the dask.array.ghost module has been renamed to dask.array.overlap, ...")
dask/array/ghost.py
Outdated
index = tuple(index) | ||
warn('ghost module will be renamed to overlap, ' | ||
'use overlap.fractional_slice.', | ||
DeprecationWarning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DeprecationWarning
s are ignored by default on non-python 2, so users won't see this warning (which is unhelpful). In other parts of dask we have been using raw warnings prefixed with the string "DeprecationWarning:"
, which seems to work fairly well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, completely forgot those are ignored with default warnings. I've updated the warning type and message text.
docs/source/array-overlap.rst
Outdated
Map a function across blocks | ||
---------------------------- | ||
|
||
Ghosting goes hand-in-hand with mapping a function across blocks. This |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ghosting
-> Overlapping
?
shape2 = [d if axes.get(i, 0) else 1 for i, d in enumerate(shape)] | ||
result = reshapelist(shape2, seq) | ||
return result | ||
return overlap.expand_key(k, dims, name, axes) | ||
|
||
|
||
def ghost_internal(x, axes): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rename ghost_internal
to overlap_internal
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NVM. Overlooked the warning below.
docs/source/array-overlap.rst
Outdated
|
||
Consider two neighboring blocks in a Dask array. | ||
|
||
.. image:: images/unghosted-neighbors.png |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of nitpicky, but should we rename the images as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth noting there are SVGs like this as well that may need the same renaming. SVGs contain a docname
parameter internally (why?) that includes the name too, which would need renaming as well.
docs/source/array-overlap.rst
Outdated
|
||
.. image:: images/unghosted-neighbors.png | ||
:width: 30% | ||
:alt: un-overlapped neighbors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-overlapping
docs/source/array-overlap.rst
Outdated
|
||
.. image:: images/ghosted-neighbors.png | ||
:width: 30% | ||
:alt: overlapped neighbors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overlapping
docs/source/array-overlap.rst
Outdated
|
||
.. image:: images/ghosted-blocks.png | ||
:width: 40% | ||
:alt: overlapped blocks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overlapping
Should we (re)move |
Looks pretty good, @rmsare. Added a few comments above. Thanks for working on this. |
Perhaps rename and add a redirect?
…On Thu, Aug 2, 2018 at 10:55 AM, jakirkham ***@***.***> wrote:
Should we (re)move docs/source/array-ghost.rst?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3830 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AASszDJjSYir50QZpt26a95ICtOTlacHks5uMxLqgaJpZM4VnmuD>
.
|
Thanks @jcrist and @jakirkham ! I've addressed most of your comments. TODO later today: Edit the SVGs, and redirect on the Unfortunately these changes are pushed under my work account username, hope that's alright. |
We should add a redirect in |
@jakirkham thank you for the extensive review here. Are you ok with the revised changes? |
Just the redirect that you mentioned and there were a couple "ghost" SVGs remaining. |
@mrocklin Thanks for pointing out the redirect list. I think these changes take care of the rest of the comments above. Sorry for the delay on these. |
Anything left to do here? @jakirkham are you ok with these changes? |
There still appears to be |
@jakirkham Oops, it is deleted now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @rmsare. 😄
Thanks @rmsare! Merging. |
This is causing xarray's test suite to fail (see pydata/xarray#2349). In particular, please restore the top level import of |
@jcrist beat me to it. Thanks, and sorry to break the imports!
…On Tue, Aug 7, 2018, 19:26 Jim Crist ***@***.***> wrote:
Apologies @shoyer <https://github.com/shoyer>, this is fixed in #3861
<#3861>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3830 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADcJRMBDcwkXS10oRC0inzyY8Yy2c-vdks5uOj5LgaJpZM4VnmuD>
.
|
This replaces
ghost
with an identicaloverlap
module and makes the same changes to the docs. All of the old ghost tests or documentation are kept as is, and tests are duplicated foroverlap
.Calling an old function warns and returns the result from the corresponding function in
overlap
. I went ahead and replacedghost.ghost
withoverlap.overlap
for consistency, as it seemed confusing to be able to calloverlap.ghost(...)
.There are probably better ways to deprecate the old ghost module, too, but couldn't find any examples of deprecation warnings used elsewhere in dask so I tried to be conservative. Any pointers or feedback would be much appreciated!
Addresses #3639.
flake8 dask