diff --git a/test/dataset/sampling/test_sampler_restoring.py b/test/dataset/sampling/test_sampler_restoring.py index 0c95b3dff..38719df85 100644 --- a/test/dataset/sampling/test_sampler_restoring.py +++ b/test/dataset/sampling/test_sampler_restoring.py @@ -12,7 +12,7 @@ CutPairsSampler, DynamicBucketingSampler, RoundRobinSampler, - SingleCutSampler, + SimpleCutSampler, ZipSampler, ) from lhotse.dataset.sampling.dynamic import DynamicCutSampler @@ -23,15 +23,15 @@ # fmt: off SAMPLERS_TO_TEST = [ - # Identically initialized SingleCutSampler + # Identically initialized SimpleCutSampler lambda: ( - SingleCutSampler(CUTS, max_duration=10.0, shuffle=True, drop_last=True), - SingleCutSampler(CUTS, max_duration=10.0, shuffle=True, drop_last=True), + SimpleCutSampler(CUTS, max_duration=10.0, shuffle=True, drop_last=True), + SimpleCutSampler(CUTS, max_duration=10.0, shuffle=True, drop_last=True), ), - # Differently initialized SingleCutSampler with the same CUTS + # Differently initialized SimpleCutSampler with the same CUTS lambda: ( - SingleCutSampler(CUTS, max_duration=10.0, shuffle=True, drop_last=True), - SingleCutSampler(CUTS, max_duration=11.1), + SimpleCutSampler(CUTS, max_duration=10.0, shuffle=True, drop_last=True), + SimpleCutSampler(CUTS, max_duration=11.1), ), # Differently initialized CutPairsSampler with the same CUTS lambda: ( @@ -41,12 +41,12 @@ # Differently initialized ZipSampler with the same CUTS lambda: ( ZipSampler( # CUTS_SHUF just to randomize the order of the zipped-in cutset - SingleCutSampler(CUTS, max_duration=10.0, shuffle=True, drop_last=True), - SingleCutSampler(CUTS_MOD, max_duration=10.0, shuffle=True, drop_last=True), + SimpleCutSampler(CUTS, max_duration=10.0, shuffle=True, drop_last=True), + SimpleCutSampler(CUTS_MOD, max_duration=10.0, shuffle=True, drop_last=True), ), ZipSampler( - SingleCutSampler(CUTS, max_duration=11.1), - SingleCutSampler(CUTS_MOD, max_duration=11.1), + SimpleCutSampler(CUTS, max_duration=11.1), + SimpleCutSampler(CUTS_MOD, max_duration=11.1), ), ), # Differently initialized ZipSampler with the same CUTS (cut pairs) @@ -82,12 +82,12 @@ # Differently initialized RoundRobinSampler with the same CUTS lambda: ( RoundRobinSampler( - SingleCutSampler(CUTS.subset(first=50), max_duration=10.0, shuffle=True, drop_last=True), - SingleCutSampler(CUTS_MOD.subset(first=50), max_duration=10.0, shuffle=True, drop_last=True), + SimpleCutSampler(CUTS.subset(first=50), max_duration=10.0, shuffle=True, drop_last=True), + SimpleCutSampler(CUTS_MOD.subset(first=50), max_duration=10.0, shuffle=True, drop_last=True), ), RoundRobinSampler( - SingleCutSampler(CUTS.subset(first=50), max_duration=11.1), - SingleCutSampler(CUTS_MOD.subset(first=50), max_duration=11.1), + SimpleCutSampler(CUTS.subset(first=50), max_duration=11.1), + SimpleCutSampler(CUTS_MOD.subset(first=50), max_duration=11.1), ), ), ] @@ -226,20 +226,20 @@ def __getitem__(self, item: CutSet) -> List[str]: @pytest.mark.parametrize( "create_sampler", [ - lambda: SingleCutSampler(CUTS, max_duration=10.0, shuffle=True, drop_last=True), + lambda: SimpleCutSampler(CUTS, max_duration=10.0, shuffle=True, drop_last=True), lambda: BucketingSampler( CUTS, max_duration=10.0, shuffle=True, drop_last=True, num_buckets=2 ), lambda: ZipSampler( - SingleCutSampler(CUTS, max_duration=10.0, shuffle=True, drop_last=True), - SingleCutSampler(CUTS_MOD, max_duration=10.0, shuffle=True, drop_last=True), + SimpleCutSampler(CUTS, max_duration=10.0, shuffle=True, drop_last=True), + SimpleCutSampler(CUTS_MOD, max_duration=10.0, shuffle=True, drop_last=True), ), lambda: RoundRobinSampler( # subset to first 50 cuts so that total num batches is 10, not 20 - SingleCutSampler( + SimpleCutSampler( CUTS.subset(first=50), max_duration=10.0, shuffle=True, drop_last=True ), - SingleCutSampler( + SimpleCutSampler( CUTS_MOD.subset(first=50), max_duration=10.0, shuffle=True,