Skip to content

Commit

Permalink
Remove unused imports
Browse files Browse the repository at this point in the history
Signed-off-by: Ante Jukić <ajukic@nvidia.com>
  • Loading branch information
anteju committed May 21, 2024
1 parent c29b35e commit a8a967f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
7 changes: 2 additions & 5 deletions tests/collections/asr/test_preprocessing_segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_single_channel_input(self, channel_selector: Type[Union[str, int, List[
# Expect a failure if looking for a different channel when input is 1D
with pytest.raises(ValueError):
# UUT
signal_out = select_channels(signal_in, channel_selector)
select_channels(signal_in, channel_selector)
else:
# UUT
signal_out = select_channels(signal_in, channel_selector)
Expand All @@ -58,7 +58,6 @@ def test_multi_channel_input(self, num_channels: int, channel_selector: Type[Uni
"""Cover the case with multi-channel input signal and single-
or multi-channel output.
"""
num_samples = 1000
signal_in = np.random.rand(self.num_samples, num_channels)

# calculate golden output
Expand All @@ -85,13 +84,12 @@ def test_select_more_channels_than_available(
"""This test is expecting the UUT to fail because we ask for more channels
than available in the input signal.
"""
num_samples = 1000
signal_in = np.random.rand(self.num_samples, num_channels)

# expect failure since we ask for more channels than available
with pytest.raises(ValueError):
# UUT
signal_out = select_channels(signal_in, channel_selector)
select_channels(signal_in, channel_selector)


class TestAudioSegment:
Expand Down Expand Up @@ -445,7 +443,6 @@ def test_audio_segment_trim_match(self, tmpdir, target_sr):
signal_len_sec = 2
num_samples = signal_len_sec * sample_rate
num_examples = 10
rtol, atol = 1e-5, 1e-6

TrimSetup = namedtuple("TrimSetup", "ref top_db frame_length hop_length")
trim_setups = []
Expand Down
9 changes: 1 addition & 8 deletions tests/collections/audio/test_audio_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,14 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import copy
import filecmp
import json
import os
import shutil
import tempfile
from unittest import mock

import numpy as np
import pytest
import soundfile as sf
import torch.cuda
from omegaconf import DictConfig, OmegaConf
from torch.utils.data import DataLoader
from omegaconf import OmegaConf

from nemo.collections.asr.parts.utils.manifest_utils import write_manifest
from nemo.collections.audio.data import audio_to_audio_dataset
Expand All @@ -41,7 +35,6 @@
)
from nemo.collections.audio.parts.utils.audio import get_segment_start
from nemo.collections.common.data.lhotse import get_lhotse_dataloader_from_config
from nemo.utils import logging


class TestAudioDatasets:
Expand Down
2 changes: 0 additions & 2 deletions tests/collections/audio/utils/test_audio_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
# limitations under the License.

import os
from typing import List, Type, Union

import librosa
import matplotlib.pyplot as plt
import numpy as np
import pytest
import scipy
import soundfile as sf
import torch

from nemo.collections.audio.parts.utils.audio import SOUND_VELOCITY as sound_velocity
Expand Down

0 comments on commit a8a967f

Please sign in to comment.