-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Updates copy for single partition arrays #3754
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
Merged
Merged
Conversation
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
Member
|
+1! |
Member
|
Thanks @jrbourbeau ! |
This was referenced Jul 16, 2018
Closed
pp-mo
reviewed
Aug 3, 2018
| """ | ||
| return Array(self.dask, self.name, self.chunks, self.dtype) | ||
| if self.npartitions == 1: | ||
| return self.map_blocks(np.copy) |
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.
Query: doesn't this invalidate the above "This is a no-op" comment ?
Member
|
(It wasn't correct before either)
On Fri, Aug 3, 2018 at 12:03 PM, Matthew Rocklin <[email protected]>
wrote:
… Yes, we should probably remove the comment, which is no longer entirely
correct.
On Fri, Aug 3, 2018 at 11:31 AM, Patrick Peglar ***@***.***>
wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In dask/array/core.py
> <#3754 (comment)>:
>
> > @@ -1958,7 +1958,10 @@ def copy(self):
> """
> Copy array. This is a no-op for dask.arrays, which are immutable
> """
> - return Array(self.dask, self.name, self.chunks, self.dtype)
> + if self.npartitions == 1:
> + return self.map_blocks(np.copy)
>
> Query: doesn't this break the above comment ?
>
> —
> You are receiving this because you modified the open/close state.
> Reply to this email directly, view it on GitHub
> <#3754 (review)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AASszLpmIYmoBUB4HPfBdo8jquKouLYdks5uNGzdgaJpZM4VPmSO>
> .
>
|
Member
|
Yes, we should probably remove the comment, which is no longer entirely
correct.
…On Fri, Aug 3, 2018 at 11:31 AM, Patrick Peglar ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In dask/array/core.py
<#3754 (comment)>:
> @@ -1958,7 +1958,10 @@ def copy(self):
"""
Copy array. This is a no-op for dask.arrays, which are immutable
"""
- return Array(self.dask, self.name, self.chunks, self.dtype)
+ if self.npartitions == 1:
+ return self.map_blocks(np.copy)
Query: doesn't this break the above comment ?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#3754 (review)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AASszLpmIYmoBUB4HPfBdo8jquKouLYdks5uNGzdgaJpZM4VPmSO>
.
|
3 tasks
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.
This PR updates the array
copymethod to maintain expected behavior whennpartitions == 1. Closes #3751.flake8 dask