Check all tuples are the same length, i.e. check that all lists are nested to the same depth.
(combined_tile_ids)
| 182 | |
| 183 | |
| 184 | def _check_dimension_depth_tile_ids(combined_tile_ids): |
| 185 | """ |
| 186 | Check all tuples are the same length, i.e. check that all lists are |
| 187 | nested to the same depth. |
| 188 | """ |
| 189 | tile_ids = combined_tile_ids.keys() |
| 190 | nesting_depths = [len(tile_id) for tile_id in tile_ids] |
| 191 | if not nesting_depths: |
| 192 | nesting_depths = [0] |
| 193 | if set(nesting_depths) != {nesting_depths[0]}: |
| 194 | raise ValueError( |
| 195 | "The supplied objects do not form a hypercube because" |
| 196 | " sub-lists do not have consistent depths" |
| 197 | ) |
| 198 | # return these just to be reused in _check_shape_tile_ids |
| 199 | return tile_ids, nesting_depths |
| 200 | |
| 201 | |
| 202 | def _check_shape_tile_ids(combined_tile_ids): |
no test coverage detected
searching dependent graphs…