Skip to content

Add median along an axis with automatic rechunking#5575

Merged
mrocklin merged 4 commits intodask:masterfrom
mrocklin:median
Nov 12, 2019
Merged

Add median along an axis with automatic rechunking#5575
mrocklin merged 4 commits intodask:masterfrom
mrocklin:median

Conversation

@mrocklin
Copy link
Copy Markdown
Member

This rechunks the array along the axes to be medianed and then performs a
blockwise call to np.median.

Fixes #5062
This was specifically asked for by astronomers.

  • Tests added / passed
  • Passes black dask / flake8 dask

This rechunks the array along the axes to be medianed and then performs a
blockwise call to `np.median`.

Fixes dask#5062
This was specifically asked for by astronomers.
@mrocklin
Copy link
Copy Markdown
Member Author

@TomAugspurger any thoughts on this?

Copy link
Copy Markdown
Member

@TomAugspurger TomAugspurger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable. Are there other places where we automatically rechunk?

Just to confirm, if our auto rechunking results in many more chunks, the user would get the usual warning, right? That seems like the best behavior.

A note in the docstring that this rechunks would be nice I think. If you use derived_from instead of wraps I think it's included automatically.

@mrocklin
Copy link
Copy Markdown
Member Author

Just to confirm, if our auto rechunking results in many more chunks, the user would get the usual warning, right? That seems like the best behavior.

Yes, but I think that this is unlikely in most cases. The rechunking algorithms are decent.

A note in the docstring that this rechunks would be nice I think. If you use derived_from instead of wraps I think it's included automatically.

Done

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.

Implement np.median along an axis

2 participants