File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -935,6 +935,24 @@ def test_trirefine():
935935 assert_array_almost_equal (xyz_data [0 ], xyz_data [1 ])
936936
937937
938+ @pytest .mark .parametrize ('interpolator' ,
939+ [mtri .LinearTriInterpolator ,
940+ mtri .CubicTriInterpolator ],
941+ ids = ['linear' , 'cubic' ])
942+ def test_trirefine_masked (interpolator ):
943+ # Repeated points means we will have fewer triangles than points, and thus
944+ # get masking.
945+ x , y = np .mgrid [:2 , :2 ]
946+ x = np .repeat (x .flatten (), 2 )
947+ y = np .repeat (y .flatten (), 2 )
948+
949+ z = np .zeros_like (x )
950+ tri = mtri .Triangulation (x , y )
951+ refiner = mtri .UniformTriRefiner (tri )
952+ interp = interpolator (tri , z )
953+ refiner .refine_field (z , triinterpolator = interp , subdiv = 2 )
954+
955+
938956def meshgrid_triangles (n ):
939957 """
940958 Return (2*(N-1)**2, 3) array of triangles to mesh (N, N)-point np.meshgrid.
You can’t perform that action at this time.
0 commit comments