Refactor Namespace and Seald Classes in Microsoft.ML.AutoML.SourceGenerator Project (#7223)
* Make all classes in Microsoft.ML.AutoML.SourceGenerator project `sealed` * Refactor namespace from Microsoft.ML.ModelBuilder.SweepableEstimator.CodeGenerator to Microsoft.ML.AutoML.SourceGenerator
This commit is contained in:
Родитель
70e5ab1e27
Коммит
1612edc770
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Microsoft.ML.AutoML.SourceGenerator
|
||||
{
|
||||
internal class Constant
|
||||
internal sealed class Constant
|
||||
{
|
||||
public const string CodeGeneratorNameSpace = "Microsoft.ML.AutoML.CodeGen";
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ using System.Text.Json.Serialization;
|
|||
|
||||
namespace Microsoft.ML.AutoML.SourceGenerator
|
||||
{
|
||||
internal class EstimatorContract
|
||||
internal sealed class EstimatorContract
|
||||
{
|
||||
[JsonPropertyName("functionName")]
|
||||
public string FunctionName { get; set; }
|
||||
|
|
|
@ -15,7 +15,7 @@ using Microsoft.ML.AutoML.SourceGenerator.Template;
|
|||
namespace Microsoft.ML.AutoML.SourceGenerator
|
||||
{
|
||||
[Generator]
|
||||
public class EstimatorTypeGenerator : ISourceGenerator
|
||||
public sealed class EstimatorTypeGenerator : ISourceGenerator
|
||||
{
|
||||
private const string className = "EstimatorType";
|
||||
private const string fullName = Constant.CodeGeneratorNameSpace + "." + className;
|
||||
|
|
|
@ -15,7 +15,7 @@ using Microsoft.ML.AutoML.SourceGenerator.Template;
|
|||
namespace Microsoft.ML.AutoML.SourceGenerator
|
||||
{
|
||||
[Generator]
|
||||
public class SearchSpaceGenerator : ISourceGenerator
|
||||
public sealed class SearchSpaceGenerator : ISourceGenerator
|
||||
{
|
||||
public void Execute(GeneratorExecutionContext context)
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@ using Microsoft.ML.AutoML.SourceGenerator.Template;
|
|||
namespace Microsoft.ML.AutoML.SourceGenerator
|
||||
{
|
||||
[Generator]
|
||||
public class SweepableEstimatorFactoryGenerator : ISourceGenerator
|
||||
public sealed class SweepableEstimatorFactoryGenerator : ISourceGenerator
|
||||
{
|
||||
private const string className = "SweepableEstimatorFactory";
|
||||
|
||||
|
|
|
@ -2,22 +2,17 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Text;
|
||||
using Microsoft.ML.AutoML.SourceGenerator;
|
||||
using SweepableEstimator = Microsoft.ML.AutoML.SourceGenerator.Template.SweepableEstimator;
|
||||
using SweepableEstimatorT = Microsoft.ML.AutoML.SourceGenerator.Template.SweepableEstimator_T_;
|
||||
namespace Microsoft.ML.ModelBuilder.SweepableEstimator.CodeGenerator
|
||||
namespace Microsoft.ML.AutoML.SourceGenerator
|
||||
{
|
||||
[Generator]
|
||||
public class SweepableEstimatorGenerator : ISourceGenerator
|
||||
public sealed class SweepableEstimatorGenerator : ISourceGenerator
|
||||
{
|
||||
private const string SweepableEstimatorAttributeDisplayName = Constant.CodeGeneratorNameSpace + "." + "SweepableEstimatorAttribute";
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ using System.Text.Json;
|
|||
|
||||
namespace Microsoft.ML.AutoML.SourceGenerator
|
||||
{
|
||||
internal class Utils
|
||||
internal sealed class Utils
|
||||
{
|
||||
public static EstimatorsContract GetEstimatorsFromJson(string json)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче