File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 17
17
FileOpener ,
18
18
IterableWrapper ,
19
19
IoPathFileLister ,
20
- IoPathFileLoader ,
20
+ IoPathFileOpener ,
21
21
IoPathSaver ,
22
22
CSVParser ,
23
23
CSVDictParser ,
@@ -539,7 +539,7 @@ def test_io_path_file_lister_iterdatapipe(self):
539
539
@skipIfNoIoPath
540
540
def test_io_path_file_loader_iterdatapipe (self ):
541
541
datapipe1 = IoPathFileLister (root = self .temp_sub_dir .name )
542
- datapipe2 = IoPathFileLoader (datapipe1 )
542
+ datapipe2 = IoPathFileOpener (datapipe1 )
543
543
544
544
# check contents of file match
545
545
for _ , f in datapipe2 :
@@ -548,7 +548,7 @@ def test_io_path_file_loader_iterdatapipe(self):
548
548
# Reset Test: Ensure the resulting streams are still readable after the DataPipe is reset/exhausted
549
549
self ._write_text_files ()
550
550
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" )
552
552
553
553
n_elements_before_reset = 2
554
554
res_before_reset , res_after_reset = reset_after_n_next_calls (iopath_file_loader_dp , n_elements_before_reset )
Original file line number Diff line number Diff line change 31
31
)
32
32
from torchdata .datapipes .iter .load .iopath import (
33
33
IoPathFileListerIterDataPipe as IoPathFileLister ,
34
- IoPathFileLoaderIterDataPipe as IoPathFileLoader ,
34
+ IoPathFileOpenerIterDataPipe as IoPathFileOpener ,
35
35
IoPathSaverIterDataPipe as IoPathSaver ,
36
36
)
37
37
from torchdata .datapipes .iter .load .fsspec import (
103
103
"InMemoryCacheHolder" ,
104
104
"IndexAdder" ,
105
105
"IoPathFileLister" ,
106
- "IoPathFileLoader " ,
106
+ "IoPathFileOpener " ,
107
107
"IoPathSaver" ,
108
108
"IterDataPipe" ,
109
109
"IterKeyZipper" ,
Original file line number Diff line number Diff line change @@ -80,9 +80,9 @@ def __iter__(self) -> Iterator[str]:
80
80
yield os .path .join (self .root , file_name )
81
81
82
82
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 `.
86
86
87
87
Iterable DataPipe to open files from input datapipe which contains pathnames or URLs,
88
88
and yields a tuple of pathname and opened file stream.
You can’t perform that action at this time.
0 commit comments