Skip to content

Adding deprecation warnings for archive readers #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions torchdata/datapipes/iter/util/tararchiveloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
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

Expand Down Expand Up @@ -78,4 +80,5 @@ class TarArchiveReaderIterDataPipe(IterDataPipe[Tuple[str, BufferedIOBase]]):
"""

def __new__(cls, datapipe: Iterable[Tuple[str, BufferedIOBase]], mode: str = "r:*", length: int = -1):
deprecation_warning(type(cls).__name__, new_name="TarArchiveLoader")
return TarArchiveLoaderIterDataPipe(datapipe, mode, length)
3 changes: 3 additions & 0 deletions torchdata/datapipes/iter/util/xzfileloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
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

Expand Down Expand Up @@ -67,4 +69,5 @@ class XzFileReaderIterDataPipe(IterDataPipe[Tuple[str, BufferedIOBase]]):
"""

def __new__(cls, datapipe: Iterable[Tuple[str, BufferedIOBase]], length: int = -1):
deprecation_warning(type(cls).__name__, new_name="XzFileLoader")
return XzFileLoaderIterDataPipe(datapipe, length)
3 changes: 3 additions & 0 deletions torchdata/datapipes/iter/util/ziparchiveloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
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

Expand Down Expand Up @@ -79,4 +81,5 @@ class ZipArchiveReaderIterDataPipe(IterDataPipe[Tuple[str, BufferedIOBase]]):
"""

def __new__(cls, datapipe: Iterable[Tuple[str, BufferedIOBase]], length: int = -1):
deprecation_warning(type(cls).__name__, new_name="ZipArchiveLoader")
return ZipArchiveLoaderIterDataPipe(datapipe, length)