pytorch / pytorch/audio

Remove insignificant test assets

Open
#764 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted module: tests
Dominant language
Python
Stars
2.9k
Forks
799
Avg merge
58m
Merged PRs (30d)
3

Description

@astaff had introduced guideline for test assets in https://github.com/pytorch/audio/pull/759 and we can get rid of the following existing assets.

  • 100Hz_44100Hz_16bit_05sec.wav sine wave, should be replaced by on-the-fly generation.
  • 440Hz_44100Hz_16bit_05sec.wav sine wave, should be replaced by on-the-fly generation.
  • CommonVoice/cv-corpus-4-2019-12-10/tt/clips/common_voice_tt_00000000.mp3 whitenoise, should be converted to wav so that test does not require mp3 decoder.
  • dtmf_30s_stereo.mp3 not used.
  • genres/noise/noise.0000.wav should be replaced by on-the-fly generation.
  • kaldi_file.wav sine wave only contains 20 samples and I do not think this is appropriate for test.
  • kaldi_file_8000.wav sine wave, should prefer on-the-fly generation.
  • sinewave.wav sine wave, should prefer on-the-fly generation.
  • steam-train-whistle-daniel_simon.mp3 should be replaced by steam-train-whistle-daniel_simon.wav
  • test.wav file generated during test_io.py accidentally checked in
  • waves_yesno/0_1_0_1_0_1_1_0.wav
  • whitenoise_1min.mp3 should be replaced by on-the-fly generation.
  • whitenoise.mp3 should be replaced by on-the-fly generation.
  • whitenoise.wav should be replaced by on-the-fly generation.

General Direction for replacing assets with on-the-fly generation

  1. Create Tensor
common_utils.get_sinusoid
common_utils.get_whitenoise
  1. Get temporary file path
self.get_temp_path('foo.wav')
# suppose this class is composed of `common_utils.TempDirMixin`
  1. Save wav file
common_utils.save_wav(path, data)
  1. Load wav file
common_utils.load_wav(path)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the test suite for kaldi_file.wav, kaldi_file_8000.wav, and sinewave.wav, then inspect the relevant uses of common_utils.get_sinusoid, save_wav, and load_wav. Replace the remaining checked-in assets with temporary, generated WAV files and remove assets that are no longer used; run the affected tests to confirm they still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.