@@ -34,7 +34,6 @@ public void NumpyNPZRoundTripTest()
34
34
}
35
35
36
36
[ TestMethod ]
37
- // [DataRow(@"data/arange_f2_le.npy")] // Ignore: Half-precision floats not supported
38
37
[ DataRow ( @"data/arange_f4_le.npy" ) ]
39
38
[ DataRow ( @"data/arange_f8_le.npy" ) ]
40
39
[ DataRow ( @"data/arange_i1.npy" ) ]
@@ -45,20 +44,9 @@ public void NumpyNPZRoundTripTest()
45
44
[ DataRow ( @"data/arange_u2_le.npy" ) ]
46
45
[ DataRow ( @"data/arange_u4_le.npy" ) ]
47
46
[ DataRow ( @"data/arange_u8_le.npy" ) ]
48
- // [DataRow(@"data/arange_f2_be.npy")] // Ignore: Big-endian types not supported
49
- // [DataRow(@"data/arange_f4_be.npy")] // Ignore: Big-endian types not supported
50
- // [DataRow(@"data/arange_f8_be.npy")] // Ignore: Big-endian types not supported
51
- // [DataRow(@"data/arange_i2_be.npy")] // Ignore: Big-endian types not supported
52
- // [DataRow(@"data/arange_i4_be.npy")] // Ignore: Big-endian types not supported
53
- // [DataRow(@"data/arange_i8_be.npy")] // Ignore: Big-endian types not supported
54
- // [DataRow(@"data/arange_u2_be.npy")] // Ignore: Big-endian types not supported
55
- // [DataRow(@"data/arange_u4_be.npy")] // Ignore: Big-endian types not supported
56
- // [DataRow(@"data/arange_u8_be.npy")] // Ignore: Big-endian types not supported
57
47
public void load_Arange ( string path )
58
48
{
59
- NDArray arr = np . load ( path ) ;
60
- // Assert.IsNotNull(arr);
61
- // Assert.IsTrue(arr.ndim == 1 && arr.shape[0] > 0);
49
+ NDArray arr = np . load ( path ) ;
62
50
63
51
for ( int i = 0 ; i < arr . shape [ 0 ] ; ++ i )
64
52
{
@@ -69,19 +57,15 @@ public void load_Arange(string path)
69
57
70
58
[ TestMethod ]
71
59
[ DataRow ( @"data/hello_S5.npy" ) ]
72
- // [DataRow(@"data/hello_U5_be.npy")] // Ignore: Unicode strings not supported
73
- // [DataRow(@"data/hello_U5_le.npy")] // Ignore: Unicode strings not supported
74
60
public void load_HelloWorld ( string path )
75
61
{
76
62
string [ ] arr = np . Load < string [ ] > ( path ) ;
77
-
78
63
Assert . AreEqual ( "Hello" , arr [ 0 ] ) ;
79
64
Assert . AreEqual ( "World" , arr [ 1 ] ) ;
80
65
}
81
66
82
67
[ TestMethod ]
83
68
[ DataRow ( @"data/mgrid_i4.npy" ) ]
84
- // [DataRow(@"data/mgrid_i4_fortran_order.npy")] // Ignore: Fortran order not supported
85
69
public void load_Mgrid ( string path )
86
70
{
87
71
NDArray arr = np . load ( path ) ;
@@ -99,11 +83,18 @@ public void load_Mgrid(string path)
99
83
[ TestMethod ]
100
84
[ DataRow ( @"data/scalar_b1.npy" , false ) ]
101
85
[ DataRow ( @"data/scalar_i4_le.npy" , 42 ) ]
102
- // [DataRow(@"data/scalar_i4_be.npy", 42)] // Ignore: Big-endian types not supported
103
86
public void load_Scalar ( string path , object expected )
104
87
{
105
88
NDArray arr = np . load ( path ) ;
89
+ Assert . AreEqual ( expected , arr . GetValue ( 0 ) ) ;
90
+ }
106
91
92
+ [ TestMethod ]
93
+ [ DataRow ( @"data/scalar_b1.npy" , false ) ]
94
+ [ DataRow ( @"data/scalar_i4_le.npy" , 42 ) ]
95
+ public void LoadMatrix_Scalar ( string path , object expected )
96
+ {
97
+ Array arr = np . LoadMatrix ( path ) ;
107
98
Assert . AreEqual ( expected , arr . GetValue ( 0 ) ) ;
108
99
}
109
100
}
0 commit comments