()
| 104 | |
| 105 | #[test] |
| 106 | fn rechunk_splits_into_smaller_tiles() { |
| 107 | let src = schema(vec![100, 100]); |
| 108 | let dst = schema(vec![10, 10]); |
| 109 | let mut b = SparseTileBuilder::new(&src); |
| 110 | b.push( |
| 111 | &[CoordValue::Int64(5), CoordValue::Int64(5)], |
| 112 | &[CellValue::Int64(1)], |
| 113 | ) |
| 114 | .unwrap(); |
| 115 | b.push( |
| 116 | &[CoordValue::Int64(50), CoordValue::Int64(50)], |
| 117 | &[CellValue::Int64(2)], |
| 118 | ) |
| 119 | .unwrap(); |
| 120 | let big = b.build(); |
| 121 | let out = rechunk_sparse(&dst, &big).unwrap(); |
| 122 | assert_eq!(out.len(), 2); |
| 123 | for (_, t) in &out { |
| 124 | assert_eq!(t.nnz(), 1); |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | #[test] |
| 129 | fn rechunk_preserves_total_cells() { |
nothing calls this directly
no test coverage detected