-
Notifications
You must be signed in to change notification settings - Fork 68
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
Make map/reduce APIs more intuitive #1686
Conversation
80ca1cf
to
9c3fc18
Compare
Codecov Report
@@ Coverage Diff @@
## master #1686 +/- ##
==========================================
- Coverage 89.79% 89.76% -0.03%
==========================================
Files 239 239
Lines 8975 9020 +45
==========================================
+ Hits 8059 8097 +38
- Misses 916 923 +7
Continue to review full report at Codecov.
|
47676a9
to
43adfd3
Compare
Right now, specifying a FunctionSource along with function parameters makes for a confusing function call. For instance, `Map('divide', 2, module=FunctionSource.np)` means the FunctionSource comes last, which is not intuitive. This adds the ability for `FunctionSource`s to be called and return a Bundle that includes both the package name and the function name. The call above would then become: `Map(FunctionSource.np('divide'), 2)`. Backwards compatibility with the prior API is maintained, but a warning is generated. If the top-level package is provided twice, it is treated as an error. Test plan: added test cases to cover the new approach, the old approach that should generate the warning, and the ugly combination that should fail.
43adfd3
to
4e9ccad
Compare
I actually didn't find the old method confusing. Was it breaking anything? I don't have a huge preference if you think this makes more sense but seems like a lot of changes |
It gets even more confusing when the function takes kwargs, because it becomes:
|
Ahhh ok then I support this. |
Right now, specifying a FunctionSource along with function parameters makes for a confusing function call.
For instance,
Map('divide', 2, module=FunctionSource.np)
means the FunctionSource comes last, which is not intuitive.This adds the ability for
FunctionSource
s to be called and return a Bundle that includes both the package name and the function name. The call above would then become:Map(FunctionSource.np('divide'), 2)
.Backwards compatibility with the prior API is maintained, but a warning is generated.
If the top-level package is provided twice, it is treated as an error.
Test plan: added test cases to cover the new approach, the old approach that should generate the warning, and the ugly combination that should fail.