test: add unit tests for data simulation utility functions#15412
Open
stanley1208 wants to merge 3 commits intoNVIDIA-NeMo:mainfrom
Open
test: add unit tests for data simulation utility functions#15412stanley1208 wants to merge 3 commits intoNVIDIA-NeMo:mainfrom
stanley1208 wants to merge 3 commits intoNVIDIA-NeMo:mainfrom
Conversation
Signed-off-by: stanley1208 <stanley.mei08@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: stanley1208 <stanley1208@users.noreply.github.com>
Contributor
Author
|
@nithinraok @pzelasko Ready for review — adds 7 unit tests for 4 untested data simulation utility functions, addressing the TODO at line 296. All tests pass locally. Thanks! |
Collaborator
|
CC @tango4j |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Address the TODO at
tests/collections/asr/utils/test_data_simul_utils_asr.py:296requesting tests for all utility functions by adding 7 new unit tests for 4 previously untested functions indata_simulation_utils.py:get_speaker_ids: Test correct speaker ID selection and session index wrap-around via modulobuild_speaker_samples_map: Test building speaker-to-samples mapping from manifest, including empty manifest edge caseget_speaker_samples: Test subsetting speaker samples by given speaker IDsper_speaker_normalize: Test that output audio RMS matches the target volume level (parametrized over 3 volume values)All 7 new tests pass locally (32 total in the test class, 0 failures).
Collection: ASR
Changelog
get_speaker_ids,build_speaker_samples_map,get_speaker_samples, andper_speaker_normalizeUsage
python -m pytest tests/collections/asr/utils/test_data_simul_utils_asr.py::TestDataSimulatorUtils -v