-
Notifications
You must be signed in to change notification settings - Fork 52
Breaking: add combine method for groupby output, fixing similar for AbstractDimStack
#903
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
Conversation
| If `dims` is given, combine only the dimensions in `dims`. The reducing function | ||
| `f` must accept a `dims` keyword. | ||
| """ | ||
| function combine(f::Function, gb::DimGroupByArray{G}; dims=:) where G |
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.
DataAPI.combine? Since DD owns one of the types...
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.
It doesn't exist yet JuliaData/DataAPI.jl#65 ;)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## breaking #903 +/- ##
=========================================
Coverage 80.60% 80.61%
=========================================
Files 54 54
Lines 5130 5168 +38
=========================================
+ Hits 4135 4166 +31
- Misses 995 1002 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Did this close #745? |
This PR introduces a
combinemethod to make things like this easier:combine(f, groupby(dim_array_or_stack, Ti=month); dims=Ti)It helps with recomposing grouped output into a single DimArray/DimStack allowing for partial reductions of the grouped content.
Surprisingly hardly any code needed to do this, once I actually fixed
similarto make more sense on DimStack, and a few bugs insetindex!on stacks. I guess in the past it wasn't totally clear how these things should work. But makingcombinejust work like this for arrays or stacks probably means the design is correct now.similarnow matchesNamedTupleeltypes as layer types, and keeps the same dimension structure as the original stack (layers missing dimensions are still missing dimensions aftersimilar).