@@ -14,7 +14,7 @@ def _get_chunk(cube, sl):
1414 else :
1515 grid_dims = (cube .mesh_dim (),)
1616 full_slice = [np .s_ [:]] * len (cube .shape )
17- for s , d in zip (sl , grid_dims ):
17+ for s , d in zip (sl , grid_dims , strict = True ):
1818 full_slice [d ] = np .s_ [s [0 ] : s [1 ]]
1919 return cube [* full_slice ]
2020
@@ -56,16 +56,16 @@ def _determine_blocks(shape, chunks, num_chunks, explicit_blocks):
5656 raise ValueError (msg )
5757 # TODO: This is currently blocked by the fact that slicing an Iris cube on its mesh dimension
5858 # does not currently yield another cube with a mesh. When this is fixed, the following
59- # code can be uncommented.
59+ # code can be uncommented and the noqa on the following line can be removed .
6060 # explicit_blocks = [
6161 # [[int(lower), int(upper)]]
62- # for lower, upper in zip(bounds[0][:-1], bounds[0][1:])
62+ # for lower, upper in zip(bounds[0][:-1], bounds[0][1:], strict=True )
6363 # ]
64- elif len (bounds ) == 2 :
64+ elif len (bounds ) == 2 : # noqa: RET506
6565 explicit_blocks = [
6666 [[int (ly ), int (uy )], [int (lx ), int (ux )]]
67- for ly , uy in zip (bounds [0 ][:- 1 ], bounds [0 ][1 :])
68- for lx , ux in zip (bounds [1 ][:- 1 ], bounds [1 ][1 :])
67+ for ly , uy in zip (bounds [0 ][:- 1 ], bounds [0 ][1 :], strict = True )
68+ for lx , ux in zip (bounds [1 ][:- 1 ], bounds [1 ][1 :], strict = True )
6969 ]
7070 else :
7171 msg = "Chunks must not exceed two dimensions."
@@ -170,7 +170,7 @@ def __init__(
170170 raise NotImplementedError (msg )
171171
172172 # Note: this may need to become more sophisticated when both src and tgt are large
173- self .file_block_dict = dict (zip (self .file_names , self .src_blocks ))
173+ self .file_block_dict = dict (zip (self .file_names , self .src_blocks , strict = True ))
174174
175175 if saved_files is None :
176176 self .saved_files = []
0 commit comments