Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a07091b
Add PartitionedFileLoader
May 7, 2018
67a358c
Roll back to the original DataType.
May 7, 2018
0bc8a2b
Address comments.
May 11, 2018
ce3edce
Add exception handling for failed loader.
May 11, 2018
eebf207
Merge branch 'master' into tyclintw/partitionedloader
May 11, 2018
bcd4aad
Fix Generator issues. This is change is a hack and will be addressed …
May 11, 2018
748ffe7
Address comments.
May 11, 2018
4549388
Remove unused namespaces.
May 11, 2018
781a45e
Move subLoader to a byteArray so we aren't recreating with args.
May 15, 2018
e54698a
Save and load ISchema directly instead of the Column [].
May 15, 2018
885ff30
Update help text for clarity.
May 15, 2018
bbf8de8
Fix linux test failures.
May 15, 2018
9a2d641
Merge branch 'master' into tyclintw/partitionedloader
May 16, 2018
225b7ee
Force path output to be unix formatted for consistency between OS tests.
May 16, 2018
4497c35
Fix ZBaselines release folder name.
May 16, 2018
1e01903
Sort file listings to guarantee "Expand" ordering across operating sy…
May 16, 2018
10f47b4
Whitespace.
May 16, 2018
90bedc4
Move test files from Samples to test/data
May 22, 2018
c0467e6
Address comments.
May 22, 2018
674b5cb
Modify exception handling to use Contracts instead.
May 23, 2018
5265c90
Add UnescapeDataString to realtive path method.
May 23, 2018
a040b51
Rename PathUtils to prevent name conflicts.
May 23, 2018
fe6ca03
Address comments.
May 23, 2018
097086f
Fix ExceptParam call.
May 24, 2018
fe3229f
Merge branch 'master' into tyclintw/partitionedloader
May 30, 2018
d3997cb
Merge branch 'master' into tyclintw/partitionedloader
May 30, 2018
3c5d6d8
Merge branch 'tyclintw/partitionedloader' of https://github.com/tycli…
May 30, 2018
5edd446
Merge branch 'master' into tyclintw/partitionedloader
May 31, 2018
c1a5897
Move ZBaselines to new test\BaselineOutput location.
May 31, 2018
7d09e32
Merge branch 'tyclintw/partitionedloader' of https://github.com/tycli…
May 31, 2018
d9905bb
address comments
Jun 1, 2018
ec92ecd
Modify all Exceptions to use Contracts.Exception.
Jun 5, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/Microsoft.ML.Core/Utilities/PathUtils.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

Expand Down Expand Up @@ -67,13 +67,17 @@ public static string FindExistentFileOrNull(string fileName, string folderPrefix
// 1. Search in customSearchDir.
if (!string.IsNullOrWhiteSpace(customSearchDir)
&& TryFindFile(fileName, folderPrefix, customSearchDir, out candidate))
return candidate;
{
return candidate;
}

// 2. Search in the path specified by the environment variable.
var envDir = Environment.GetEnvironmentVariable(CustomSearchDirEnvVariable);
if (!string.IsNullOrWhiteSpace(envDir)
&& TryFindFile(fileName, folderPrefix, envDir, out candidate))
return candidate;
{
return candidate;
}

// 3. Search in the path specified by the assemblyForBasePath.
if (assemblyForBasePath != null)
Expand Down
14 changes: 14 additions & 0 deletions src/Microsoft.ML.Data/Commands/DataCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,20 @@ public static void SaveLoader(IDataLoader loader, IFileHandle file)
Contracts.CheckParam(file.CanWrite, nameof(file), "Must be writable");

using (var stream = file.CreateWriteStream())
{
SaveLoader(loader, stream);
}
}

/// <summary>
/// Saves <paramref name="loader"/> to the specified <paramref name="stream"/>.
/// </summary>
public static void SaveLoader(IDataLoader loader, Stream stream)
{
Contracts.CheckValue(loader, nameof(loader));
Contracts.CheckValue(stream, nameof(stream));
Contracts.CheckParam(stream.CanWrite, nameof(stream), "Must be writable");

using (var rep = RepositoryWriter.CreateNew(stream))
{
ModelSaveContext.SaveModel(rep, loader, ModelFileUtils.DirDataLoaderModel);
Expand Down
Loading