-
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
Disallow mixing offset and non-offset axes in conv
input
#586
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #586 +/- ##
=======================================
Coverage 97.84% 97.84%
=======================================
Files 19 19
Lines 3249 3254 +5
=======================================
+ Hits 3179 3184 +5
Misses 70 70 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
97e6c31
to
4c19923
Compare
@test_throws ArgumentError conv!(zeros(6), offset_arr, 1:3) # output needs to be OA, too | ||
@test_throws ArgumentError conv!(OffsetVector{Int}(undef, 1:6), 1:4, 1:3) # output mustn't be OA | ||
|
||
@test conv(fa, fill(true)) == conv(fill(true), fa) == fa | ||
@test_broken conv(offset_arr_f, fill(true)) == conv(fill(true), offset_arr_f) == offset_arr_f |
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.
As fill(true)
doesn't have any axes, this should arguably work. However, conv
currently first brings all arguments to the same dimensionality, turning fill(true)
into [true]
here, and the axis compatibility check then says no. Fixing that is probably not important and certainly beyond the scope of this PR, but I thought leaving a @test_broken
as a reminder might be in order.
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.
LGTM, could also @test_throws
for the ArgumentError
For what currently is the |
I was referring to |
Ah, ok. Well, could of course directly test @test_throws ArgumentError conv_axis_with_offset("foo") But I don't think that adds much value. And for any axis that might actually appear in the wild, we might conceivably support it in the future, so not much point in explicitly testing that it errors now. |
Yeah that makes sense too. Merge? |
In reference to #583, but doesn't fix it. Rather, it explicitly throws an error for any input where we're not quite sure what it should do. That would leave us the opportunity to make a more informed choice later when (and if) concrete use cases for mixed offset/non-offset inputs are reported.