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

Disallow mixing offset and non-offset axes in conv input #586

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

martinholters
Copy link
Member

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.

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.84%. Comparing base (a98e64f) to head (4c19923).

Files with missing lines Patch % Lines
src/dspbase.jl 92.85% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

src/dspbase.jl Outdated Show resolved Hide resolved
@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
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants