Skip to content

Commit 75283fd

Browse files
committed
move type to NumPyWithDType
1 parent d11a68e commit 75283fd

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

src/NumSharp/NDArrayWithDType.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ namespace NumSharp
3232
/// </summary>
3333
public partial class NDArrayWithDType
3434
{
35-
public static Type int16 = typeof(short);
36-
public static Type double8 = typeof(double);
37-
public static Type decimal16 = typeof(decimal);
38-
3935
public Type dtype { get; set; }
4036

4137
public NDStorage Storage { get; set; }

src/NumSharp/NumPyWithDType.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ namespace NumSharp
66
{
77
public class NumPyWithDType
88
{
9+
public static Type int16 = typeof(short);
10+
public static Type double8 = typeof(double);
11+
public static Type decimal16 = typeof(decimal);
12+
913
public NDArrayWithDType arange(int stop, Type dtype = null)
1014
{
1115
if(dtype == null)
1216
{
13-
dtype = NDArrayWithDType.int16;
17+
dtype = NumPyWithDType.int16;
1418
}
1519

1620
return arange(0, stop, 1, dtype);
@@ -27,14 +31,14 @@ public NDArrayWithDType arange(int start, int stop, int step = 1, Type dtype = n
2731
{
2832
case "Int32":
2933
{
30-
var n = new NDArrayWithDType(NDArrayWithDType.int16);
34+
var n = new NDArrayWithDType(NumPyWithDType.int16);
3135
n.arange(stop, start, step);
3236
return n;
3337
}
3438

3539
case "Double":
3640
{
37-
var n = new NDArrayWithDType(NDArrayWithDType.double8);
41+
var n = new NDArrayWithDType(NumPyWithDType.double8);
3842
n.arange(stop, start, step);
3943
return n;
4044
}

test/NumSharp.Benchmark/np.amin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void amin0axis()
3939
[Benchmark]
4040
public void amin0axisWithDType()
4141
{
42-
var nd2 = new NDArrayWithDType(NDArrayWithDType.double8);
42+
var nd2 = new NDArrayWithDType(NumPyWithDType.double8);
4343
nd2 = nd2.arange(1000 * 8 * 8 * 8, 0, 1).reshape(1000, 8, 8, 8);
4444
var nd3 = nd2.AMin(0);
4545
}

test/NumSharp.Benchmark/np.arange.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void arange()
3838
[Benchmark]
3939
public void arange_ndarraywithdtype()
4040
{
41-
var nd2 = new NDArrayWithDType(NDArrayWithDType.int16);
41+
var nd2 = new NDArrayWithDType(NumPyWithDType.int16);
4242
var nd3 = nd2.arange(length, start, step);
4343
}
4444

test/NumSharp.UnitTest/Creation/NdArray.ARange.Test.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void arange()
2727
n = np.arange(0, 11, 3);
2828
Assert.IsTrue(Enumerable.SequenceEqual(n.Data, new int[] { 0, 3, 6, 9 }));
2929

30-
var nd2 = new NDArrayWithDType(NDArrayWithDType.int16);
30+
var nd2 = new NDArrayWithDType(NumPyWithDType.int16);
3131
var nd3 = nd2.arange(3);
3232
}
3333
}

test/NumSharp.UnitTest/Extensions/NDArray.AMin.Test.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void amin()
5050
Assert.IsTrue(n1[1, 2, 1] == 22);
5151

5252
var np2 = new NumPyWithDType();
53-
var nd2 = np2.arange(0, 4, 1, NDArrayWithDType.double8).reshape(2, 2);
53+
var nd2 = np2.arange(0, 4, 1, NumPyWithDType.double8).reshape(2, 2);
5454
nd2 = nd2.AMin(0);
5555
}
5656
}

0 commit comments

Comments
 (0)