Python error: "IndexError: tuple index out of range" when using damaris4py.dask.damaris_dask.return_dask_array_v3() when Damaris array is not 3D
In function damaris_dask.return_dask_block_layout_v2, the dimensions of an array was meant to be determined using the block_offset tuple that is packaged by the PyScript class into the "sort_list" dictionary which is a list of [ S_I_dask_pub, P_B_key, block_offset ] lists. The tuple was being referenced incorrectly as the outer list:
# Selecting the third element of the list
tup_len = len(mylist_sorted[2]) # this is the list of lists and is always of length 3
# not as the 3rd element of the inner list:
tup_len = len(mylist_sorted[0][2]) # This is the list component specifying the block offsets, it has a length that depends on the arrays dimensions
So, we now use the second version to determine the number of dimensions of the array being processed.