diff --git a/torchdata/datapipes/iter/__init__.py b/torchdata/datapipes/iter/__init__.py index c118905e5..287b7b7c3 100644 --- a/torchdata/datapipes/iter/__init__.py +++ b/torchdata/datapipes/iter/__init__.py @@ -115,25 +115,16 @@ from torchdata.datapipes.iter.util.samplemultiplexer import SampleMultiplexerDataPipe as SampleMultiplexer from torchdata.datapipes.iter.util.saver import SaverIterDataPipe as Saver from torchdata.datapipes.iter.util.shardexpander import ShardExpanderIterDataPipe as ShardExpander -from torchdata.datapipes.iter.util.tararchiveloader import ( - TarArchiveLoaderIterDataPipe as TarArchiveLoader, - TarArchiveReaderIterDataPipe as TarArchiveReader, -) +from torchdata.datapipes.iter.util.tararchiveloader import TarArchiveLoaderIterDataPipe as TarArchiveLoader from torchdata.datapipes.iter.util.tfrecordloader import ( TFRecordExample, TFRecordExampleSpec, TFRecordLoaderIterDataPipe as TFRecordLoader, ) from torchdata.datapipes.iter.util.webdataset import WebDatasetIterDataPipe as WebDataset -from torchdata.datapipes.iter.util.xzfileloader import ( - XzFileLoaderIterDataPipe as XzFileLoader, - XzFileReaderIterDataPipe as XzFileReader, -) +from torchdata.datapipes.iter.util.xzfileloader import XzFileLoaderIterDataPipe as XzFileLoader from torchdata.datapipes.iter.util.zip_longest import ZipperLongestIterDataPipe as ZipperLongest -from torchdata.datapipes.iter.util.ziparchiveloader import ( - ZipArchiveLoaderIterDataPipe as ZipArchiveLoader, - ZipArchiveReaderIterDataPipe as ZipArchiveReader, -) +from torchdata.datapipes.iter.util.ziparchiveloader import ZipArchiveLoaderIterDataPipe as ZipArchiveLoader from torchdata.datapipes.map.util.converter import MapToIterConverterIterDataPipe as MapToIterConverter __all__ = [ @@ -212,14 +203,11 @@ "StreamReader", "TFRecordLoader", "TarArchiveLoader", - "TarArchiveReader", "UnBatcher", "UnZipper", "WebDataset", "XzFileLoader", - "XzFileReader", "ZipArchiveLoader", - "ZipArchiveReader", "Zipper", "ZipperLongest", ] diff --git a/torchdata/datapipes/iter/util/tararchiveloader.py b/torchdata/datapipes/iter/util/tararchiveloader.py index c2cc7ba68..e7cff2b9d 100644 --- a/torchdata/datapipes/iter/util/tararchiveloader.py +++ b/torchdata/datapipes/iter/util/tararchiveloader.py @@ -10,8 +10,6 @@ from io import BufferedIOBase from typing import cast, IO, Iterable, Iterator, Optional, Tuple -from torch.utils.data.datapipes.utils.common import _deprecation_warning - from torchdata.datapipes import functional_datapipe from torchdata.datapipes.iter import IterDataPipe @@ -87,21 +85,3 @@ def __len__(self) -> int: if self.length == -1: raise TypeError(f"{type(self).__name__} instance doesn't have valid length") return self.length - - -@functional_datapipe("read_from_tar") -class TarArchiveReaderIterDataPipe(IterDataPipe[Tuple[str, BufferedIOBase]]): - r""" - Please use ``TarArchiveLoader`` or ``.load_from_tar`` instead. - """ - - def __new__(cls, datapipe: Iterable[Tuple[str, BufferedIOBase]], mode: str = "r:*", length: int = -1): - _deprecation_warning( - cls.__name__, - deprecation_version="0.4", - removal_version="0.6", - old_functional_name="read_from_tar", - new_class_name="TarArchiveLoader", - new_functional_name="load_from_tar", - ) - return TarArchiveLoaderIterDataPipe(datapipe, mode, length) diff --git a/torchdata/datapipes/iter/util/xzfileloader.py b/torchdata/datapipes/iter/util/xzfileloader.py index 450ee05b8..9224fc8de 100644 --- a/torchdata/datapipes/iter/util/xzfileloader.py +++ b/torchdata/datapipes/iter/util/xzfileloader.py @@ -9,8 +9,6 @@ from io import BufferedIOBase from typing import Iterable, Iterator, Tuple -from torch.utils.data.datapipes.utils.common import _deprecation_warning - from torchdata.datapipes import functional_datapipe from torchdata.datapipes.iter import IterDataPipe @@ -68,21 +66,3 @@ def __len__(self) -> int: if self.length == -1: raise TypeError(f"{type(self).__name__} instance doesn't have valid length") return self.length - - -@functional_datapipe("read_from_xz") -class XzFileReaderIterDataPipe(IterDataPipe[Tuple[str, BufferedIOBase]]): - r""" - Please use ``XzFileLoader`` or ``.load_from_xz`` instead. - """ - - def __new__(cls, datapipe: Iterable[Tuple[str, BufferedIOBase]], length: int = -1): - _deprecation_warning( - cls.__name__, - deprecation_version="0.4", - removal_version="0.6", - old_functional_name="read_from_xz", - new_class_name="XzFileLoader", - new_functional_name="load_from_xz", - ) - return XzFileLoaderIterDataPipe(datapipe, length) diff --git a/torchdata/datapipes/iter/util/ziparchiveloader.py b/torchdata/datapipes/iter/util/ziparchiveloader.py index d61e061d9..d70a902d3 100644 --- a/torchdata/datapipes/iter/util/ziparchiveloader.py +++ b/torchdata/datapipes/iter/util/ziparchiveloader.py @@ -11,8 +11,6 @@ from io import BufferedIOBase from typing import cast, IO, Iterable, Iterator, Tuple -from torch.utils.data.datapipes.utils.common import _deprecation_warning - from torchdata.datapipes import functional_datapipe from torchdata.datapipes.iter import IterDataPipe @@ -80,21 +78,3 @@ def __len__(self) -> int: if self.length == -1: raise TypeError(f"{type(self).__name__} instance doesn't have valid length") return self.length - - -@functional_datapipe("read_from_zip") -class ZipArchiveReaderIterDataPipe(IterDataPipe[Tuple[str, BufferedIOBase]]): - r""" - Please use ``ZipArchiveLoader`` or ``.load_from_zip`` instead. - """ - - def __new__(cls, datapipe: Iterable[Tuple[str, BufferedIOBase]], length: int = -1): - _deprecation_warning( - cls.__name__, - deprecation_version="0.4", - removal_version="0.6", - old_functional_name="read_from_zip", - new_class_name="ZipArchiveLoader", - new_functional_name="load_from_zip", - ) - return ZipArchiveLoaderIterDataPipe(datapipe, length)