Skip to content
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

Enable MSML_SingleVariableDeclaration for the full solution #4765

Merged
merged 1 commit into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ dotnet_diagnostic.MSML_GeneralName.severity = none
# MSML_PrivateFieldName: Private field name not in: _camelCase format
dotnet_diagnostic.MSML_PrivateFieldName.severity = none

# MSML_SingleVariableDeclaration: Have only a single variable present per declaration
dotnet_diagnostic.MSML_SingleVariableDeclaration.severity = none

# MSML_NoBestFriendInternal: Cross-assembly internal access requires referenced item to have Microsoft.ML.BestFriendAttribute attribute.
dotnet_diagnostic.MSML_NoBestFriendInternal.severity = none

Expand Down
3 changes: 2 additions & 1 deletion test/Microsoft.ML.Core.Tests/UnitTests/ColumnTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public void TestEqualAndGetHashCode()
{
var dict = new Dictionary<DataViewType, string>();
// add PrimitiveTypes, KeyType & corresponding VectorTypes
VectorDataViewType tmp1, tmp2;
VectorDataViewType tmp1;
VectorDataViewType tmp2;
var types = new PrimitiveDataViewType[] { NumberDataViewType.SByte, NumberDataViewType.Int16, NumberDataViewType.Int32, NumberDataViewType.Int64,
NumberDataViewType.Byte, NumberDataViewType.UInt16, NumberDataViewType.UInt32, NumberDataViewType.UInt64, RowIdDataViewType.Instance,
TextDataViewType.Instance, BooleanDataViewType.Instance, DateTimeDataViewType.Instance, DateTimeOffsetDataViewType.Instance, TimeSpanDataViewType.Instance };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ public abstract class PerformanceTests
internal AlignedArray testSrcVectorAligned;
internal AlignedArray testDstVectorAligned;

protected float[] src, dst, original, src1, src2, result;
protected float[] src;
protected float[] dst;
protected float[] original;
protected float[] src1;
protected float[] src2;
protected float[] result;
protected int[] idx;
protected int[] matrixIdx;

Expand Down
6 changes: 4 additions & 2 deletions test/Microsoft.ML.TestFrameworkCommon/TestCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public static bool CheckSameSchemas(DataViewSchema sch1, DataViewSchema sch2, bo
Assert.True(EqualTypes(type1, type2, exactTypes), $"column type mismatch at index {col}");

// This ensures that the two schemas map names to the same column indices.
int col1, col2;
int col1;
int col2;
bool f1 = sch1.TryGetColumnIndex(name1, out col1);
bool f2 = sch2.TryGetColumnIndex(name2, out col2);

Expand Down Expand Up @@ -152,7 +153,8 @@ public static bool CompareVec<T>(in VBuffer<T> v1, in VBuffer<T> v2, int size, F
{
int iv1 = v1.IsDense ? iiv1 : iiv1 < v1Indices.Length ? v1Indices[iiv1] : v1.Length;
int iv2 = v2.IsDense ? iiv2 : iiv2 < v2Indices.Length ? v2Indices[iiv2] : v2.Length;
T x1, x2;
T x1;
T x2;
int iv;
if (iv1 == iv2)
{
Expand Down
10 changes: 5 additions & 5 deletions test/Microsoft.ML.Tests/CalibratedModelParametersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ private IDataView GetDenseDataset()
// Setup synthetic dataset.
const int numberOfInstances = 1000;
var rand = new Random(10);
float[] yArray = new float[numberOfInstances],
x1Array = new float[numberOfInstances],
x2Array = new float[numberOfInstances],
x3Array = new float[numberOfInstances],
x4RandArray = new float[numberOfInstances];
float[] yArray = new float[numberOfInstances];
float[] x1Array = new float[numberOfInstances];
float[] x2Array = new float[numberOfInstances];
float[] x3Array = new float[numberOfInstances];
float[] x4RandArray = new float[numberOfInstances];

for (var i = 0; i < numberOfInstances; i++)
{
Expand Down
6 changes: 3 additions & 3 deletions test/Microsoft.ML.Tests/FeatureContributionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ private IDataView GetSparseDataset(TaskType task = TaskType.Regression, int numb
{
// Setup synthetic dataset.
var rand = new Random(10);
float[] yArray = new float[numberOfInstances],
x1Array = new float[numberOfInstances],
x3Array = new float[numberOfInstances];
float[] yArray = new float[numberOfInstances];
float[] x1Array = new float[numberOfInstances];
float[] x3Array = new float[numberOfInstances];

VBuffer<float>[] vbArray = new VBuffer<float>[numberOfInstances];

Expand Down
16 changes: 8 additions & 8 deletions test/Microsoft.ML.Tests/PermutationFeatureImportanceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -559,11 +559,11 @@ private IDataView GetDenseDataset(TaskType task = TaskType.Regression)
// Setup synthetic dataset.
const int numberOfInstances = 1000;
var rand = new Random(10);
float[] yArray = new float[numberOfInstances],
x1Array = new float[numberOfInstances],
x2Array = new float[numberOfInstances],
x3Array = new float[numberOfInstances],
x4RandArray = new float[numberOfInstances];
float[] yArray = new float[numberOfInstances];
float[] x1Array = new float[numberOfInstances];
float[] x2Array = new float[numberOfInstances];
float[] x3Array = new float[numberOfInstances];
float[] x4RandArray = new float[numberOfInstances];

for (var i = 0; i < numberOfInstances; i++)
{
Expand Down Expand Up @@ -626,9 +626,9 @@ private IDataView GetSparseDataset(TaskType task = TaskType.Regression)
// Setup synthetic dataset.
const int numberOfInstances = 10000;
var rand = new Random(10);
float[] yArray = new float[numberOfInstances],
x1Array = new float[numberOfInstances],
x3Array = new float[numberOfInstances];
float[] yArray = new float[numberOfInstances];
float[] x1Array = new float[numberOfInstances];
float[] x3Array = new float[numberOfInstances];

VBuffer<float>[] vbArray = new VBuffer<float>[numberOfInstances];

Expand Down