Skip to content
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

Allow block_reduce to take a weights argument #50

Closed
leouieda opened this issue May 21, 2018 · 0 comments
Closed

Allow block_reduce to take a weights argument #50

leouieda opened this issue May 21, 2018 · 0 comments
Labels
enhancement Idea or request for a new feature

Comments

@leouieda
Copy link
Member

Right now, only the data gets passed to the reducer function. If we want to do a weighted average, there is currently no way to have the windowing select the weights as well. To overcome this, block_reduce can take an optional weights=array argument. If it's given, then select the values from it as well and pass it as weights=windowed_array to the reducer function.

@leouieda leouieda added enhancement Idea or request for a new feature help wanted labels May 21, 2018
leouieda added a commit that referenced this issue May 24, 2018
`BlockReduce` now accepts multiple data components and weights.
Weights will only work if the reduction function accepts a `weights`
keyword argument. 
Separate the coordinate calculation into a private method for reuse
when making specialized classes, like `BlockMean`.
These classes will be necessary to output weights as well. 
There is no generic solution for that because each reduction will 
have a different way of estimating weights.

Fixes #50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Idea or request for a new feature
Projects
None yet
Development

No branches or pull requests

1 participant