File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -565,6 +565,30 @@ def test_no_field_error_barbs():
565
565
barbs .draw ()
566
566
567
567
568
+ def test_too_big_error_barbs ():
569
+ """Make sure we get an error when we are about to draw too many pennants."""
570
+ data = xr .open_dataset (get_test_data ('narr_example.nc' , as_file_obj = False )).squeeze ()
571
+
572
+ bp = BarbPlot ()
573
+ bp .data = data
574
+ bp .field = ['u_wind' , 'v_wind' ]
575
+ bp .level = 500
576
+ bp .scale = 1e4
577
+ bp .skip = [8 , 8 ]
578
+
579
+ mp = MapPanel ()
580
+ mp .layout = (1 , 1 , 1 )
581
+ mp .area = (- 100 , - 70 , 30 , 45 )
582
+ mp .plots = [bp ]
583
+
584
+ pc = PanelContainer ()
585
+ pc .size = (10 , 8 )
586
+ pc .panels = [mp ]
587
+
588
+ with pytest .raises (ValueError ):
589
+ pc .draw ()
590
+
591
+
568
592
@pytest .mark .mpl_image_compare (remove_text = True , tolerance = 0.377 )
569
593
def test_projection_object (ccrs , cfeature ):
570
594
"""Test that we can pass a custom map projection."""
You can’t perform that action at this time.
0 commit comments