desh2608 / gss

A simple package for Guided source separation (GSS)
MIT License
105 stars 13 forks source link

Fixed code for right context equal to 0 #38

Closed marcinwitkowski closed 1 year ago

marcinwitkowski commented 1 year ago

When right_context is set to 0 (which is its default value in function args), the line changed in this PR becomes:

x_hat = x_hat[:, left_context:-0]

which basically makes x_hat empty matrix of size (number_of_channels,0). The conditioning proposed in this PR prevents from this.

desh2608 commented 1 year ago

Thanks! For the case when right_context is negative, I think it is better to just set it to 0 and raise a warning to inform the user about it, instead of raising an error.

marcinwitkowski commented 1 year ago

@desh2608 , changed as you suggested. Please take a look now.

marcinwitkowski commented 1 year ago

I have also updated isort in pre-commit-config.yaml as the previous version resulted in the following error:

 RuntimeError: The Poetry configuration is invalid:
            - [extras.pipfile_deprecated_finder.2] 'pip-shims<=0.3.4' does not match '^[a-zA-Z-_.0-9]+$'