Skip to content

Commit

Permalink
test(export_array): check exported raster's bounds with modelgrid (#2315
Browse files Browse the repository at this point in the history
)

* include windows platform for test_export_array

* check exported raster's bounds with modelgrid
  • Loading branch information
martclanor authored Sep 27, 2024
1 parent 181e101 commit 49c508c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions autotest/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ def test_export_shapefile_polygon_closed(function_tmpdir):
shp.close()


@excludes_platform("Windows")
@requires_pkg("rasterio", "pyshp", "scipy", name_map={"pyshp": "shapefile"})
def test_export_array(function_tmpdir, example_data_path):
import rasterio
Expand Down Expand Up @@ -467,10 +466,10 @@ def test_export_array(function_tmpdir, example_data_path):
with rasterio.open(function_tmpdir / "fb.tif") as src:
arr = src.read(1)
assert src.shape == (m.nrow, m.ncol)
# TODO: these tests currently fail -- fix is in progress
# assert np.abs(src.bounds[0] - m.modelgrid.extent[0]) < 1e-6
# assert np.abs(src.bounds[1] - m.modelgrid.extent[1]) < 1e-6
pass
assert np.abs(src.bounds[0] - m.modelgrid.extent[0]) < 1e-6
assert np.abs(src.bounds[2] - m.modelgrid.extent[1]) < 1e-6
assert np.abs(src.bounds[1] - m.modelgrid.extent[2]) < 1e-6
assert np.abs(src.bounds[3] - m.modelgrid.extent[3]) < 1e-6


@requires_pkg("netCDF4", "pyproj")
Expand Down

0 comments on commit 49c508c

Please sign in to comment.