-
Notifications
You must be signed in to change notification settings - Fork 112
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 manual override of return type for fillvalue #72
Conversation
I thought this was the purpose of exporting the |
It was, but that's a static mechanism. What if you call the same |
Though I suppose we could use the |
My question was not as much "do we need this?" as "do we need both, or can this replace the other?" but if both are valuable I see no reason not to keep them both anyway. So it was more a curious question than criticism :) But using
Regardless of what the actual solution ends up being, I think we should try to a) make sure that we are compatible with the promotion mechanisms in base Julia as much as possible, and b) make the user-interface as seamless ass possible. Leveraging |
Btw, the test failure should be fixed once #73 is merged. |
72240c8
to
23b6007
Compare
OK, see if you like this better (I do). I deleted the docs for |
@@ -27,6 +27,8 @@ etpf = @inferred(extrapolate(itpg, NaN)) | |||
@test_throws BoundsError etpf[2.5,2] | |||
@test_throws ErrorException etpf[2.5,2,1] # this will probably become a BoundsError someday | |||
|
|||
@inferred(getindex(etpf, dual(-2.5,1))) | |||
|
|||
etpf = @inferred(FilledExtrapolation(itpg, 'x')) |
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.
Should this initialization be done some other way?
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.
This test can probably just be dropped, since it was really testing explicit control.
Since exporting the type was mainly to make the type-controlling constructor available, I think we should probably un-export it. (That's a very simple breaking change to work around, should there be anyone who has already started using it - just say |
23b6007
to
d7d84bc
Compare
Thanks for the review (and catches). Should be addressed now. There's some weird SSL error on nightly (I restarted, and that didn't fix it), but I doubt it reflects a problem with this PR. |
All package PRs are failing this way today. |
😿 |
Merge anyway? (I can't, it won't let me.) |
I assume this is since JuliaLang/julia#11196 merged, and that it'll keep being broken until the regressions are fixed. I also assume this might take a while..: I'll disable the build on nightly for now; after that, restarting the build should make it pass and allow merging (I'm using Github's semi-new "protect branch" feature on master, to prevent merging before checks pass, but it probably doesn't make sense to require that everything passes on a very unstable Julia master...). |
See #75. |
Rebasing this onto current master should fix the build (by not trying on 0.5...). |
This should promote greater type-stability
7baad90
to
67fd8f0
Compare
Allow manual override of return type for fillvalue
I'm playing with ForwardDiff as a way of computing gradients, and needed this to handle the fact that sometimes the same
FilledExtrapolation
object gets called with two different types of indexes (Float64
andGradientNumber{Float64,...}
). I added these lines (the last one being the relevant one here) to my own code:and now ForwardDiff works fine.