Skip to content

Commit

Permalink
add higher res float32 image fixure for testing per_band
Browse files Browse the repository at this point in the history
  • Loading branch information
dugalh committed Jun 25, 2024
1 parent e0a1687 commit e83958f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,18 @@ def rgb_byte_src_file(tmp_path_factory: pytest.TempPathFactory, im_size: tuple)
return src_filename


@pytest.fixture(scope='session')
def ms_float_src_file(tmp_path_factory: pytest.TempPathFactory, im_size: tuple) -> Path:
"""An 4 band higher res float32 checkerboard image with no CRS."""
array = checkerboard((1024, 768)).astype('float32')
array = np.stack((array,) * 4, axis=0)
profile = create_profile(array)
src_filename = tmp_path_factory.mktemp('data').joinpath('ms_float32_src.tif')
with rio.open(src_filename, 'w', **profile) as im:
im.write(array)
return src_filename


@pytest.fixture(scope='session')
def float_src_file(tmp_path_factory: pytest.TempPathFactory, im_size: tuple) -> Path:
"""A single band float64 checkerboard image with no CRS."""
Expand Down

0 comments on commit e83958f

Please sign in to comment.