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

Prettier tests #608

Merged
merged 8 commits into from
Dec 13, 2024
Merged

Prettier tests #608

merged 8 commits into from
Dec 13, 2024

Conversation

wheeheee
Copy link
Member

No description provided.

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.96%. Comparing base (f33b262) to head (ef474bb).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #608   +/-   ##
=======================================
  Coverage   97.96%   97.96%           
=======================================
  Files          19       19           
  Lines        3248     3248           
=======================================
  Hits         3182     3182           
  Misses         66       66           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

test/FilterTestHelpers.jl Outdated Show resolved Hide resolved
test/estimation.jl Show resolved Hide resolved
Comment on lines +105 to +107
one_buffer = similar(x1, 1)
for (i, p) in enumerate(x1)
y1[i] = filt(myfilt, setindex!(one_buffer, p, 1))[1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure these @timeinteractive should be taken seriously at all (I never look at them), so this optimization might be nothing more than an unnecessary complication. But even if care about the allocations here, wouldn't

Suggested change
one_buffer = similar(x1, 1)
for (i, p) in enumerate(x1)
y1[i] = filt(myfilt, setindex!(one_buffer, p, 1))[1]
for i in eachindex(x1)
y1[i] = filt(myfilt, @view(x[i:i]))[1]

cut it? (And likewise below.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, should have done that...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the view also allocates, once every iteration. So I did actually try that some time ago, which was probably why I set up a buffer here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that's unfortunate. Rework after fixing #605, then 😄

test/filt_stream.jl Outdated Show resolved Hide resolved
@@ -36,7 +36,7 @@ julia> diric(0, 4)
```
"""
function diric(Ω::T, n::Integer) where T <: AbstractFloat
n > 0 || throw(ArgumentError("n=$n not positive"))
n > 0 || throw(DomainError(n, "n not positive"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't file this under "prettier tests", but still a good change.

@wheeheee wheeheee merged commit 3e79857 into JuliaDSP:master Dec 13, 2024
10 checks passed
@wheeheee wheeheee deleted the prettier_tests branch December 13, 2024 13:09
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