Skip to content

Rename CreateTextReader to CreateTextLoader #2125

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

Merged
merged 2 commits into from
Jan 17, 2019

Conversation

najeeb-kazmi
Copy link
Member

Fixes #1690

Rename CreateTextReader to CreateTextLoader to conform to the return type:

TextLoader textLoader = mlContext.Data.CreateTextLoader(new TextLoader.Arguments() ...

@@ -11,33 +11,33 @@ namespace Microsoft.ML
public static class TextLoaderSaverCatalog
{
/// <summary>
/// Create a text reader <see cref="TextLoader"/>.
/// Create a text loader <see cref="TextLoader"/>.
/// </summary>
/// <param name="catalog">The <see cref="DataOperations"/> catalog.</param>
/// <param name="columns">The columns of the schema.</param>
/// <param name="hasHeader">Whether the file has a header.</param>
/// <param name="separatorChar">The character used as separator between data points in a row. By default the tab character is used as separator.</param>
/// <param name="dataSample">The optional location of a data sample.</param>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/// The optional location of a data sample.</para [](start = 8, length = 74)

?Do you want to also create a small sample, for the apis of this file, and link it from here?

/// </summary>
/// <param name="catalog">The <see cref="DataOperations"/> catalog.</param>
/// <param name="columns">The columns of the schema.</param>
/// <param name="hasHeader">Whether the file has a header.</param>
/// <param name="separatorChar">The character used as separator between data points in a row. By default the tab character is used as separator.</param>
/// <param name="dataSample">The optional location of a data sample.</param>
public static TextLoader CreateTextReader(this DataOperations catalog,
public static TextLoader CreateTextLoader(this DataOperations catalog,
Copy link
Member

@sfilipi sfilipi Jan 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreateTextLoader [](start = 33, length = 16)

My personal take on this is: TextReader is a much better name than TextLoader. I would rather rename the TextLoader class to TextReader..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct, we are replacing the IDataLoader idiom with the IDataReader idiom, as part of #581 and much subsequent work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TextReader is conflated with System.IO.TextReader and should be avoided. I've filed #2144 for renaming the class. I propose making the method name and return type consistent in this PR and revisiting the name when we rename the class.

cc: @glebuk @eerhardt

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. Good point,. Maybe we should actually yname IDataReader to IDataLoader? And call the existing legacy IDataLoader interface something like IDataLoaderLegacy? What we all think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar renames to IDataReaderEstimator to I suppose IDataLoaderEstimator.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point is to be consistent between method's name and returned type, so either on of the following would be good for me: 👍

public static TextLoader CreateTextLoader()

public static TextReader CreateTextReader()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Can't name it reader, guess we have to reuse the old "loader" thing.

Copy link
Member

@sfilipi sfilipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Contributor

@TomFinley TomFinley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @najeeb-kazmi .

@najeeb-kazmi najeeb-kazmi merged commit 61ab00e into dotnet:master Jan 17, 2019
@najeeb-kazmi najeeb-kazmi mentioned this pull request Jan 17, 2019
@najeeb-kazmi najeeb-kazmi deleted the 1690 branch January 30, 2020 01:15
@ghost ghost locked as resolved and limited conversation to collaborators Mar 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants