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

Support multi-column filtering for DF2TFilter #602

Merged
merged 6 commits into from
Dec 3, 2024

Conversation

martinholters
Copy link
Member

Fixes #372. I mostly wanted to see whether #372 could be tackled in a non-breaking way. The answer is yes, so this could wait until after release of v0.8. OTOH, it seems simple enough that it's unlikely to stall v0.8 even more, so here it is.

Note that while this is API-wise orthogonal to #599, there will be some clean-up possible after both of them have been merged. (Or rather, after the first one merges, the second one can be extended to include the clean-up.)

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.91%. Comparing base (be65e83) to head (307428a).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #602      +/-   ##
==========================================
+ Coverage   97.90%   97.91%   +0.01%     
==========================================
  Files          19       19              
  Lines        3246     3262      +16     
==========================================
+ Hits         3178     3194      +16     
  Misses         68       68              

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

src/dspbase.jl Outdated Show resolved Hide resolved
src/Filters/filt.jl Outdated Show resolved Hide resolved
@martinholters martinholters force-pushed the mh/multicol-df2tfilter branch from 83c9df4 to 5bfcfb0 Compare December 3, 2024 08:02
Copy link
Member

@wheeheee wheeheee left a comment

Choose a reason for hiding this comment

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

LGTM, apart from documentation and some formatting.

src/Filters/filt.jl Outdated Show resolved Hide resolved
src/Filters/filt.jl Outdated Show resolved Hide resolved
src/Filters/filt.jl Outdated Show resolved Hide resolved
src/Filters/filt.jl Outdated Show resolved Hide resolved
src/Filters/filt.jl Outdated Show resolved Hide resolved
src/Filters/filt.jl Outdated Show resolved Hide resolved
src/Filters/filt.jl Outdated Show resolved Hide resolved
@martinholters
Copy link
Member Author

How do you like the rewritten docstring?

@wheeheee
Copy link
Member

wheeheee commented Dec 3, 2024

The explanation about what coldims and sitype do is much clearer after the rewrite.
Actually, I think I was just unfamiliar with what the square brackets imply about the number / configurations of optional arguments that can be provided. So we could just merge now, or follow what JuliaLang/julia#4902 proposes, since maybe not everyone is that familiar with the bracket syntax.

@martinholters
Copy link
Member Author

Yes, worth considering. (For docstrings being edited anyway; I wouldn't want to go through the whole code base and change this.)

This could become

    DF2TFilter(coef::FilterCoefficients{:z}, coldims::Tuple = ())
    DF2TFilter(coef::FilterCoefficients{:z}, sitype::Type, coldims::Tuple = ())
    DF2TFilter(coef::FilterCoefficients{:z}, si)

or without using default args

    DF2TFilter(coef::FilterCoefficients{:z})
    DF2TFilter(coef::FilterCoefficients{:z}, coldims::Tuple)
    DF2TFilter(coef::FilterCoefficients{:z}, sitype::Type)
    DF2TFilter(coef::FilterCoefficients{:z}, sitype::Type, coldims::Tuple)
    DF2TFilter(coef::FilterCoefficients{:z}, si)

The latter seems excessive, although I like that the one-argument case is more explicit, as it will probably by the one most often used. So maybe

    DF2TFilter(coef::FilterCoefficients{:z})
    DF2TFilter(coef::FilterCoefficients{:z}, coldims::Tuple)
    DF2TFilter(coef::FilterCoefficients{:z}, sitype::Type, coldims::Tuple = ())
    DF2TFilter(coef::FilterCoefficients{:z}, si)

?
I think I prefer the last option. I'll push a change with that, but am open to switching to one of the others.

@martinholters martinholters force-pushed the mh/multicol-df2tfilter branch from b25e962 to 307428a Compare December 3, 2024 11:20
@wheeheee
Copy link
Member

wheeheee commented Dec 3, 2024

Looks good!

@martinholters
Copy link
Member Author

Ok, will merge once CI is green.

@martinholters martinholters merged commit 710ee46 into master Dec 3, 2024
11 checks passed
@martinholters martinholters deleted the mh/multicol-df2tfilter branch December 3, 2024 11:32
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.

Stateful filtering fails with multi-dim array
2 participants