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

added check for N=0 #429

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

added check for N=0 #429

wants to merge 10 commits into from

Conversation

rafia17
Copy link
Contributor

@rafia17 rafia17 commented Oct 3, 2023

No description provided.

@rafia17 rafia17 self-assigned this Oct 3, 2023
@rafia17 rafia17 requested a review from alecgunny October 3, 2023 17:13
@alecgunny
Copy link
Collaborator

These looks great. Couple points of feedback:

  • It might be helpful to have some tests for these two. For the N=0 issue, you can use unittest.mock.patch to make torch.rand return all 0s to ensure the N=0 case gets triggered and then do some tests on that output to ensure it's what you expect. For the length issue, it should be enough to use a pytest.raises context and call the function with bad values to make sure the appropriate error is getting raised.
  • I think the pre-commit checks are failing because you have unnecessary empty lines in the code. As a rule, we only allow double empty lines between top-level class and function definitions, not inside them.

Copy link
Collaborator

@alecgunny alecgunny left a comment

Choose a reason for hiding this comment

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

See my notes in the comment

@rafia17
Copy link
Contributor Author

rafia17 commented Oct 23, 2023

Thanks for the feedback:

  • Regarding testing, I have tested both instances extensively in last few weeks. Printing out values for mask on every run and verifying that if N < 0: block only gets executed for the correct value of the mask and subsequently for N.
  • Similarly tested for the psd_length such that the error gets raised only when psd_length is less than the window length, otherwise it doesn't get raised.
  • Regarding pre-commit checks failing, I have checked yet again but cannot see any double empty lines in either augmentor.py or train.py. So I am very puzzled here.

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.

None yet

2 participants