Skip to content

Commit c544d51

Browse files
PaulTFreedmanartidoro
authored andcommitted
Removed Read methods taking string parameters from TextLoader (#1797) (#2323)
1 parent 2dfc51a commit c544d51

File tree

4 files changed

+44
-18
lines changed

4 files changed

+44
-18
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using Microsoft.Data.DataView;
6+
using Microsoft.ML.Core.Data;
7+
using Microsoft.ML.Data;
8+
9+
namespace Microsoft.ML
10+
{
11+
public static class DataReaderExtensions
12+
{
13+
public static IDataView Read(this IDataReader<IMultiStreamSource> reader, string path)
14+
{
15+
return reader.Read(new MultiFileSource(path));
16+
}
17+
18+
public static IDataView Read(this IDataReader<IMultiStreamSource> reader, params string[] path)
19+
{
20+
return reader.Read(new MultiFileSource(path));
21+
}
22+
}
23+
}

src/Microsoft.ML.Data/DataLoadSave/Text/TextLoader.cs

-4
Original file line numberDiff line numberDiff line change
@@ -1312,10 +1312,6 @@ public void Save(ModelSaveContext ctx)
13121312

13131313
public IDataView Read(IMultiStreamSource source) => new BoundLoader(this, source);
13141314

1315-
public IDataView Read(string path) => Read(new MultiFileSource(path));
1316-
1317-
public IDataView Read(params string[] path) => Read(new MultiFileSource(path));
1318-
13191315
internal static TextLoader CreateTextReader<TInput>(IHostEnvironment host,
13201316
bool hasHeader = DefaultArguments.HasHeader,
13211317
char separator = DefaultArguments.Separator,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using Microsoft.ML.Data;
6+
7+
namespace Microsoft.ML.StaticPipe
8+
{
9+
public static class LocalPathReader
10+
{
11+
public static DataView<TShape> Read<TShape>(this DataReader<IMultiStreamSource, TShape> reader, string path)
12+
{
13+
return reader.Read(new MultiFileSource(path));
14+
}
15+
16+
public static DataView<TShape> Read<TShape>(this DataReader<IMultiStreamSource, TShape> reader, params string[] path)
17+
{
18+
return reader.Read(new MultiFileSource(path));
19+
}
20+
}
21+
}

src/Microsoft.ML.StaticPipe/TextLoaderStatic.cs

-14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
using System;
66
using System.Collections.Generic;
7-
using Microsoft.Data.DataView;
87
using Microsoft.ML.Core.Data;
98
using Microsoft.ML.Data;
109
using Microsoft.ML.StaticPipe.Runtime;
@@ -306,17 +305,4 @@ public TextLoader.Column Create()
306305
}
307306
}
308307
}
309-
310-
public static class LocalPathReader
311-
{
312-
public static IDataView Read(this IDataReader<IMultiStreamSource> reader, params string[] path)
313-
{
314-
return reader.Read(new MultiFileSource(path));
315-
}
316-
317-
public static DataView<TShape> Read<TShape>(this DataReader<IMultiStreamSource, TShape> reader, params string[] path)
318-
{
319-
return reader.Read(new MultiFileSource(path));
320-
}
321-
}
322308
}

0 commit comments

Comments
 (0)