question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Switch `FileLoader` to `FileOpener`

See original GitHub issue

Should we change the name of FileLoader to FileOpener?

We split the file-loading functionality into three steps:

  • List file names in a directory: FileLister
  • Open file handles: FileLoader (I personally feel like the name is incorrect.)
  • Read files: dp.map(fn=lambda x: x.read(), input_col=1)

cc: @VitalyFedyunin @NivekT

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
NivekTcommented, Nov 9, 2021

From a purely naming perspective, I think FileOpener is more accurate but FileLoader isn’t wildly misleading either.

I had a look at numpy.load, json.load, pickle.load, these seem to either read or parse through files that have already been opened and return some structured data. In that sense, FileLoader definitely behaves differently relative to other modules. Renaming it is likely better.

Perhaps we can rename it, but still leave FileLoader functional with a deprecation warning? I would imagine most people who started using IterDataPipe in PyTorch Core would be using FileLoader and it would be a BC-breaking change.

0reactions
NivekTcommented, Nov 11, 2021

I agree that based on the prototyping policy we should be able to rename as we wish. I think the policy is very clear for things that exist in TorchData. Do you think that policy is clear to users for things that are in PyTorch Core? If so, then we can rename it without deprecation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

glide/FileLoader.java at master · bumptech/glide - GitHub
An image loading and caching library for Android focused on smooth scrolling - glide/FileLoader.java at master · bumptech/glide.
Read more >
26 File Chooser - Using JavaFX UI Controls
This chapter explains how to use the FileChooser class to enable users to navigate the file system. The samples provided in this chapter...
Read more >
File Opener - Plugin for Cordova | Ionic Documentation
File opener2 plugin for Cordova opens files on your device file system with its default application. Learn more about installation and usage.
Read more >
Tkinter Open File Dialog - Python Tutorial
Summary: in this tutorial, you'll learn how to show an open file dialog in Tkinter applications. Introduction to the Tkinter Open File Dialog...
Read more >
RequestListener (glide API)
A class for monitoring the status of a request while images load. All methods in this interface will be called from a background...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found