@@ -149,7 +149,7 @@ pub struct RequestData {
149149 /// Axis over which to perform the reduction operation
150150 // pub axis: Option<usize>,
151151 #[ serde( default ) ]
152- pub axes : ReductionAxes ,
152+ pub axis : ReductionAxes ,
153153 /// Order of the multi-dimensional array
154154 pub order : Option < Order > ,
155155 /// Subset of the data to operate on
@@ -249,7 +249,7 @@ fn validate_request_data(request_data: &RequestData) -> Result<(), ValidationErr
249249 _ => ( ) ,
250250 } ;
251251 // Check axis is compatible with shape
252- match ( & request_data. shape , & request_data. axes ) {
252+ match ( & request_data. shape , & request_data. axis ) {
253253 ( Some ( shape) , ReductionAxes :: One ( axis) ) => {
254254 if * axis > shape. len ( ) - 1 {
255255 return Err ( ValidationError :: new ( "Axis must be within shape" ) ) ;
@@ -377,7 +377,7 @@ mod tests {
377377 Token :: U32 ( 5 ) ,
378378 Token :: U32 ( 1 ) ,
379379 Token :: SeqEnd ,
380- Token :: Str ( "axes " ) ,
380+ Token :: Str ( "axis " ) ,
381381 Token :: Seq { len : Some ( 2 ) } ,
382382 Token :: U32 ( 1 ) ,
383383 Token :: U32 ( 2 ) ,
@@ -715,15 +715,15 @@ mod tests {
715715 #[ should_panic( expected = "Axis requires shape to be specified" ) ]
716716 fn test_axis_without_shape ( ) {
717717 let mut request_data = test_utils:: get_test_request_data ( ) ;
718- request_data. axes = ReductionAxes :: One ( 1 ) ;
718+ request_data. axis = ReductionAxes :: One ( 1 ) ;
719719 request_data. validate ( ) . unwrap ( )
720720 }
721721
722722 #[ test]
723723 #[ should_panic( expected = "Axis must be within shape" ) ]
724724 fn test_axis_gt_shape ( ) {
725725 let mut request_data = test_utils:: get_test_request_data ( ) ;
726- request_data. axes = ReductionAxes :: One ( 2 ) ;
726+ request_data. axis = ReductionAxes :: One ( 2 ) ;
727727 request_data. shape = Some ( vec ! [ 2 , 5 ] ) ;
728728 request_data. validate ( ) . unwrap ( )
729729 }
@@ -801,7 +801,7 @@ mod tests {
801801 Token :: Str ( "foo" ) ,
802802 Token :: StructEnd
803803 ] ,
804- "unknown field `foo`, expected one of `source`, `bucket`, `object`, `dtype`, `byte_order`, `offset`, `size`, `shape`, `axes `, `order`, `selection`, `compression`, `filters`, `missing`"
804+ "unknown field `foo`, expected one of `source`, `bucket`, `object`, `dtype`, `byte_order`, `offset`, `size`, `shape`, `axis `, `order`, `selection`, `compression`, `filters`, `missing`"
805805 )
806806 }
807807
@@ -825,7 +825,7 @@ mod tests {
825825 "offset": 4,
826826 "size": 8,
827827 "shape": [2, 5, 1],
828- "axes ": [1, 2],
828+ "axis ": [1, 2],
829829 "order": "C",
830830 "selection": [[1, 2, 3], [4, 5, 6], [1, 1, 1]],
831831 "compression": {"id": "gzip"},
@@ -847,7 +847,7 @@ mod tests {
847847 "offset": 4,
848848 "size": 8,
849849 "shape": [2, 5, 10],
850- "axes ": 2,
850+ "axis ": 2,
851851 "order": "F",
852852 "selection": [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
853853 "compression": {"id": "zlib"},
@@ -859,7 +859,7 @@ mod tests {
859859 expected. dtype = DType :: Float64 ;
860860 expected. byte_order = Some ( ByteOrder :: Big ) ;
861861 expected. shape = Some ( vec ! [ 2 , 5 , 10 ] ) ;
862- expected. axes = ReductionAxes :: One ( 2 ) ;
862+ expected. axis = ReductionAxes :: One ( 2 ) ;
863863 expected. order = Some ( Order :: F ) ;
864864 expected. selection = Some ( vec ! [
865865 Slice :: new( 1 , 2 , 3 ) ,
0 commit comments