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

Group the windows arguments into a single arguments #47

Closed
hadware opened this issue Sep 30, 2022 · 1 comment
Closed

Group the windows arguments into a single arguments #47

hadware opened this issue Sep 30, 2022 · 1 comment

Comments

@hadware
Copy link
Contributor

hadware commented Sep 30, 2022

This is plea for grouping the three arguments that parameterize the windowing step into a single argument, that would take a SlidingWindow argument. This would greatly de-bloat some of the functions while retaining the same functionalities.

This SlidingWindow could be, for instance, a dataclass, with the same default parameters as already defined everywhere in the package:

# default values are the same as already defined in the functions headers
@dataclass
class SlidingWindow:
    length: float = 0.25
    hop: float = 0.10
    wtype : WindowType = "hamming" # bad idea to shadow "type" keyword

Each function making use of a sliding window could then be like this

def feat_fn(
    ...
    window : Optional[SlidingWindow] = None, 
    ...):
    ...
    if window is None:
         window = SlidingWindow()
    ...

What does @hbredin thinks of this?

@SuperKogito
Copy link
Owner

This looks nice and will lower the number of inputs in certain functions. I will include it in #46 later today :))

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

No branches or pull requests

2 participants