@@ -579,3 +579,27 @@ def test_tri_map_map_uint_d(self) -> None:
579579 del dst
580580 self .assertEqual (post_dst .dtype , np .dtype (np .int16 ))
581581 self .assertEqual (post_dst .tolist (), [17 , 20 , 20 , 8 , 8 , 7 ])
582+
583+
584+ def test_tri_map_map_uint_e (self ) -> None :
585+ src = np .array ([0 , 20 , 8 , 8 ], dtype = np .uint8 )
586+ dst = np .array ([7 , 20 , 20 , 8 ], dtype = np .uint8 )
587+
588+ # full outer
589+ tm = TriMap (len (src ), len (dst ))
590+ tm .register_one (0 , - 1 )
591+ tm .register_many (1 , np .array ([1 , 2 ], dtype = np .dtype (np .int64 )))
592+ tm .register_one (2 , 3 )
593+ tm .register_one (3 , 3 )
594+ tm .register_unmatched_dst ()
595+
596+ # import ipdb; ipdb.set_trace()
597+ post_src = tm .map_src_fill (src , 17 , np .dtype (np .int32 ))
598+ del src
599+ self .assertEqual (post_src .tolist (), [0 , 20 , 20 , 8 , 8 , 17 ])
600+ self .assertEqual (post_src .dtype , np .dtype (np .int32 ))
601+
602+ post_dst = tm .map_dst_fill (dst , 17 , np .dtype (np .int32 ))
603+ del dst
604+ self .assertEqual (post_dst .dtype , np .dtype (np .int32 ))
605+ self .assertEqual (post_dst .tolist (), [17 , 20 , 20 , 8 , 8 , 7 ])
0 commit comments