@@ -101,6 +101,96 @@ def test_map_view_bc_gwfs_disv(example_data_path):
101101 )
102102
103103
104+ @pytest .mark .mf2005
105+ @pytest .mark .xfail (reason = "sometimes get wrong collection type" )
106+ def test_map_view_bc_freyberg_subset (example_data_path ):
107+ mpath = example_data_path / "freyberg"
108+ name_file = "freyberg.nam"
109+ ml = Modflow .load (name_file , model_ws = mpath , verbose = True )
110+ mapview = flopy .plot .PlotMapView (model = ml )
111+ mapview .plot_bc (
112+ "RIV" ,
113+ subset = [
114+ (0 , 34 , 14 ),
115+ (0 , 35 , 14 ),
116+ (0 , 36 , 14 ),
117+ (0 , 37 , 14 ),
118+ (0 , 38 , 14 ),
119+ (0 , 39 , 14 ),
120+ ],
121+ )
122+ ax = mapview .ax
123+
124+ if len (ax .collections ) == 0 :
125+ raise AssertionError ("Boundary condition was not drawn" )
126+
127+ for col in ax .collections :
128+ assert isinstance (col , (QuadMesh , PathCollection )), (
129+ f"Unexpected collection type: { type (col )} "
130+ )
131+ if isinstance (col , QuadMesh ):
132+ count = col .get_array ().count ()
133+ assert count == 6 , f"More than six river cells plotted ({ count } )"
134+
135+ # plt.show(block=True)
136+
137+
138+ @pytest .mark .mf2005
139+ @pytest .mark .xfail (reason = "sometimes get wrong collection type" )
140+ def test_map_view_bc_freyberg_ml_subset_plotAll (example_data_path ):
141+ mpath = example_data_path / "freyberg_multilayer_transient"
142+ name_file = "freyberg.nam"
143+ ml = Modflow .load (name_file , model_ws = mpath , verbose = True )
144+ mapview = flopy .plot .PlotMapView (model = ml , layer = 2 )
145+ mapview .plot_bc (
146+ "WEL" ,
147+ plotAll = True ,
148+ subset = [
149+ (0 , 8 , 15 ),
150+ (0 , 28 , 5 ),
151+ ],
152+ )
153+
154+ ax = mapview .ax
155+
156+ if len (ax .collections ) == 0 :
157+ raise AssertionError ("Boundary condition was not drawn" )
158+
159+ for col in ax .collections :
160+ assert isinstance (col , (QuadMesh , PathCollection , LineCollection )), (
161+ f"Unexpected collection type: { type (col )} "
162+ )
163+ if isinstance (col , QuadMesh ):
164+ count = col .get_array ().count ()
165+ assert count == 2 , f"More than two wells plotted ({ count } )"
166+
167+ # plt.show(block=True)
168+
169+
170+ @pytest .mark .mf6
171+ @pytest .mark .xfail (reason = "sometimes get wrong collection type" )
172+ def test_map_view_bc_gwfs_disv_subset (example_data_path ):
173+ mpath = example_data_path / "mf6" / "test003_gwfs_disv"
174+ sim = MFSimulation .load (sim_ws = mpath )
175+ ml6 = sim .get_model ("gwf_1" )
176+ ml6 .modelgrid .set_coord_info (angrot = - 14 )
177+ mapview = flopy .plot .PlotMapView (model = ml6 )
178+ mapview .plot_bc (
179+ "CHD" , subset = [(0 , 10 ), (0 , 30 ), (0 , 50 ), (0 , 70 ), (0 , 90 ), (0 , 49 )]
180+ )
181+ ax = mapview .ax
182+
183+ if len (ax .collections ) == 0 :
184+ raise AssertionError ("Boundary condition was not drawn" )
185+
186+ for col in ax .collections :
187+ assert isinstance (col , (QuadMesh , PathCollection )), (
188+ f"Unexpected collection type: { type (col )} "
189+ )
190+
191+ # plt.show(block=True)
192+
193+
104194@pytest .mark .mf6
105195@pytest .mark .xfail (reason = "sometimes get wrong collection type" )
106196def test_map_view_bc_lake2tr (example_data_path ):
0 commit comments