From c073e6b3bcb271afe002cd1fb354bb2309551a28 Mon Sep 17 00:00:00 2001 From: LittleLittleCloud Date: Tue, 28 Apr 2020 12:25:38 -0700 Subject: [PATCH 1/2] upgrade to 3.1 --- .../Templates/Console/PredictProject.cs | 2 +- .../Templates/Console/PredictProject.tt | 2 +- ...s.AzureCodeGeneratorTest.test.ConsoleApp.csproj.approved.txt | 2 +- ...CodeGeneratorTest.CodeGenTest.ConsoleApp.csproj.approved.txt | 2 +- ...GeneratorTests.ConsoleAppProjectFileContentTest.approved.txt | 2 +- ...eConsoleAppProjectContents_VerifyPredictProject.approved.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.ML.CodeGenerator/Templates/Console/PredictProject.cs b/src/Microsoft.ML.CodeGenerator/Templates/Console/PredictProject.cs index 96c4bbf124..29f288a076 100644 --- a/src/Microsoft.ML.CodeGenerator/Templates/Console/PredictProject.cs +++ b/src/Microsoft.ML.CodeGenerator/Templates/Console/PredictProject.cs @@ -27,7 +27,7 @@ internal partial class PredictProject : PredictProjectBase public virtual string TransformText() { this.Write("\r\n\r\n \r\n Exe\r\n netcoreapp2.1\r\n \r\n netcoreapp3.1\r\n \r\n \r\n \r\n"); diff --git a/src/Microsoft.ML.CodeGenerator/Templates/Console/PredictProject.tt b/src/Microsoft.ML.CodeGenerator/Templates/Console/PredictProject.tt index 1dd932085e..15e82d409c 100644 --- a/src/Microsoft.ML.CodeGenerator/Templates/Console/PredictProject.tt +++ b/src/Microsoft.ML.CodeGenerator/Templates/Console/PredictProject.tt @@ -8,7 +8,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 diff --git a/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.AzureCodeGeneratorTest.test.ConsoleApp.csproj.approved.txt b/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.AzureCodeGeneratorTest.test.ConsoleApp.csproj.approved.txt index 66e5ca3695..f94467d5dc 100644 --- a/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.AzureCodeGeneratorTest.test.ConsoleApp.csproj.approved.txt +++ b/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.AzureCodeGeneratorTest.test.ConsoleApp.csproj.approved.txt @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 diff --git a/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.AzureImageCodeGeneratorTest.CodeGenTest.ConsoleApp.csproj.approved.txt b/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.AzureImageCodeGeneratorTest.CodeGenTest.ConsoleApp.csproj.approved.txt index 23fa52e0c1..5a0f249e82 100644 --- a/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.AzureImageCodeGeneratorTest.CodeGenTest.ConsoleApp.csproj.approved.txt +++ b/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.AzureImageCodeGeneratorTest.CodeGenTest.ConsoleApp.csproj.approved.txt @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 diff --git a/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.ConsoleAppProjectFileContentTest.approved.txt b/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.ConsoleAppProjectFileContentTest.approved.txt index 9ef4077dee..97df9ea672 100644 --- a/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.ConsoleAppProjectFileContentTest.approved.txt +++ b/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.ConsoleAppProjectFileContentTest.approved.txt @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 diff --git a/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.Recommendation_GenerateConsoleAppProjectContents_VerifyPredictProject.approved.txt b/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.Recommendation_GenerateConsoleAppProjectContents_VerifyPredictProject.approved.txt index 14a45f8c0c..e261bed0fd 100644 --- a/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.Recommendation_GenerateConsoleAppProjectContents_VerifyPredictProject.approved.txt +++ b/test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.Recommendation_GenerateConsoleAppProjectContents_VerifyPredictProject.approved.txt @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 From 8f0fc1a59dd3aa6186ec4e94f9cccf93fab4dae4 Mon Sep 17 00:00:00 2001 From: LittleLittleCloud Date: Tue, 28 Apr 2020 12:31:31 -0700 Subject: [PATCH 2/2] write inline data using invariantCulture --- src/Microsoft.ML.CodeGenerator/Utils.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.ML.CodeGenerator/Utils.cs b/src/Microsoft.ML.CodeGenerator/Utils.cs index 216097064c..075bc577ce 100644 --- a/src/Microsoft.ML.CodeGenerator/Utils.cs +++ b/src/Microsoft.ML.CodeGenerator/Utils.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Reflection; @@ -101,7 +102,7 @@ internal static string GetValueFromColumn(DataViewRowCursor rowCursor, DataVi return "Single.NegativeInfinity"; } - return f?.ToString() + "F"; + return f?.ToString(CultureInfo.InvariantCulture) + "F"; } if (val is bool)