diff --git a/xbout/load.py b/xbout/load.py index 4f565f8b..97bd20d1 100644 --- a/xbout/load.py +++ b/xbout/load.py @@ -1155,10 +1155,6 @@ def _open_grid(datapath, chunks, keep_xboundaries, keep_yboundaries, mxg=2, **kw if len(unrecognised_dims) > 0: # Weird string formatting is a workaround to deal with possible bug in # pytest warnings capture - doesn't match strings containing brackets - warn( - "Will drop all variables containing the dimensions {} because " - "they are not recognised".format(str(unrecognised_dims)[1:-1]) - ) grid = grid.drop_dims(unrecognised_dims) if keep_xboundaries: diff --git a/xbout/tests/test_grid.py b/xbout/tests/test_grid.py index 87ff4a98..7c7d76c5 100644 --- a/xbout/tests/test_grid.py +++ b/xbout/tests/test_grid.py @@ -41,27 +41,6 @@ def test_open_grid(self, create_example_grid_file): assert_equal(result, open_dataset(example_grid)) result.close() - def test_open_grid_extra_dims(self, create_example_grid_file, tmp_path_factory): - example_grid = open_dataset(create_example_grid_file) - - new_var = DataArray( - name="new", - data=[[1, 2], [8, 9], [16, 17], [27, 28], [37, 38]], - dims=["x", "w"], - ) - - dodgy_grid_directory = tmp_path_factory.mktemp("dodgy_grid") - dodgy_grid_path = dodgy_grid_directory.joinpath("dodgy_grid.nc") - merge([example_grid, new_var]).to_netcdf(dodgy_grid_path, engine="h5netcdf") - - with pytest.warns( - UserWarning, match="drop all variables containing " "the dimensions 'w'" - ): - result = open_boutdataset(datapath=dodgy_grid_path) - result = result.drop_vars(["x", "y"]) - assert_equal(result, example_grid) - result.close() - def test_open_grid_apply_geometry(self, create_example_grid_file): @register_geometry(name="Schwarzschild") def add_schwarzschild_coords(ds, coordinates=None):