@@ -526,6 +526,8 @@ def _prepare_cmap_norm(
526526
527527 cmap = copy (cmap )
528528
529+ assert isinstance (cmap , Colormap ), f"Invalid type of `cmap`: { type (cmap )} , expected `Colormap`."
530+
529531 if norm is None :
530532 norm = Normalize (vmin = None , vmax = None , clip = False )
531533
@@ -2076,7 +2078,7 @@ def _validate_image_render_params(
20762078 if isinstance (palette , list ):
20772079 # case A: single palette for all channels
20782080 if len (palette ) == 1 :
2079- palette_length = len (channel ) if channel is not None else len (spatial_element_ch )
2081+ palette_length = len (channel_list ) if channel_list is not None else len (spatial_element_ch )
20802082 palette = palette * palette_length
20812083 # case B: one palette per channel (either given or derived from channel length)
20822084 channels_to_use = spatial_element_ch if element_params [el ]["channel" ] is None else channel
@@ -2090,9 +2092,9 @@ def _validate_image_render_params(
20902092
20912093 if (cmap := param_dict ["cmap" ]) is not None :
20922094 if len (cmap ) == 1 :
2093- cmap_length = len (channel ) if channel is not None else len (spatial_element_ch )
2095+ cmap_length = len (channel_list ) if channel_list is not None else len (spatial_element_ch )
20942096 cmap = cmap * cmap_length
2095- if (channel is not None and len (cmap ) != len (channel )) or len (cmap ) != len (spatial_element_ch ):
2097+ if (channel_list is not None and len (cmap ) != len (channel_list )) or len (cmap ) != len (spatial_element_ch ):
20962098 cmap = None
20972099 element_params [el ]["cmap" ] = cmap
20982100 element_params [el ]["norm" ] = param_dict ["norm" ]
@@ -2388,7 +2390,9 @@ def _get_datashader_trans_matrix_of_single_element(
23882390 # no flipping needed
23892391 return tm
23902392 # for a Translation, we need the transposed transformation matrix
2391- return tm .T
2393+ tm_T = tm .T
2394+ assert isinstance (tm_T , np .ndarray )
2395+ return tm_T
23922396
23932397
23942398def _get_transformation_matrix_for_datashader (
0 commit comments