Skip to content

Commit 488e8fb

Browse files
committed
Renaming IoPathFileLoader to IoPathFileOpener
ghstack-source-id: 5cc14cd Pull Request resolved: #151
1 parent f51e095 commit 488e8fb

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

test/test_local_io.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
FileOpener,
1818
IterableWrapper,
1919
IoPathFileLister,
20-
IoPathFileLoader,
20+
IoPathFileOpener,
2121
IoPathSaver,
2222
CSVParser,
2323
CSVDictParser,
@@ -539,7 +539,7 @@ def test_io_path_file_lister_iterdatapipe(self):
539539
@skipIfNoIoPath
540540
def test_io_path_file_loader_iterdatapipe(self):
541541
datapipe1 = IoPathFileLister(root=self.temp_sub_dir.name)
542-
datapipe2 = IoPathFileLoader(datapipe1)
542+
datapipe2 = IoPathFileOpener(datapipe1)
543543

544544
# check contents of file match
545545
for _, f in datapipe2:
@@ -548,7 +548,7 @@ def test_io_path_file_loader_iterdatapipe(self):
548548
# Reset Test: Ensure the resulting streams are still readable after the DataPipe is reset/exhausted
549549
self._write_text_files()
550550
lister_dp = FileLister(self.temp_dir.name, "*.text")
551-
iopath_file_loader_dp = IoPathFileLoader(lister_dp, mode="rb")
551+
iopath_file_loader_dp = IoPathFileOpener(lister_dp, mode="rb")
552552

553553
n_elements_before_reset = 2
554554
res_before_reset, res_after_reset = reset_after_n_next_calls(iopath_file_loader_dp, n_elements_before_reset)

torchdata/datapipes/iter/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
)
3232
from torchdata.datapipes.iter.load.iopath import (
3333
IoPathFileListerIterDataPipe as IoPathFileLister,
34-
IoPathFileLoaderIterDataPipe as IoPathFileLoader,
34+
IoPathFileOpenerIterDataPipe as IoPathFileOpener,
3535
IoPathSaverIterDataPipe as IoPathSaver,
3636
)
3737
from torchdata.datapipes.iter.load.fsspec import (
@@ -103,7 +103,7 @@
103103
"InMemoryCacheHolder",
104104
"IndexAdder",
105105
"IoPathFileLister",
106-
"IoPathFileLoader",
106+
"IoPathFileOpener",
107107
"IoPathSaver",
108108
"IterDataPipe",
109109
"IterKeyZipper",

torchdata/datapipes/iter/load/iopath.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ def __iter__(self) -> Iterator[str]:
8080
yield os.path.join(self.root, file_name)
8181

8282

83-
@functional_datapipe("load_file_by_iopath")
84-
class IoPathFileLoaderIterDataPipe(IterDataPipe[Tuple[str, StreamWrapper]]):
85-
r""":class:`IoPathFileLoaderIterDataPipe`.
83+
@functional_datapipe("open_file_by_iopath")
84+
class IoPathFileOpenerIterDataPipe(IterDataPipe[Tuple[str, StreamWrapper]]):
85+
r""":class:`IoPathFileOpenerIterDataPipe`.
8686
8787
Iterable DataPipe to open files from input datapipe which contains pathnames or URLs,
8888
and yields a tuple of pathname and opened file stream.

0 commit comments

Comments
 (0)