Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Fix reading cint16 files with dask #559

Merged
merged 1 commit into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ History
Latest
------
- BUG: Fix reading file handle with dask (issue #550)
- BUG: Fix reading cint16 files with dask (issue #542)

0.11.1
------
Expand Down
2 changes: 1 addition & 1 deletion rioxarray/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ def _prepare_dask(
chunks = normalize_chunks(
chunks=(1, "auto", "auto"),
shape=(riods.count, riods.height, riods.width),
dtype=riods.dtypes[0],
dtype=_rasterio_to_numpy_dtype(riods.dtypes),
previous_chunks=tuple((c,) for c in block_shape),
)
token = tokenize(filename, mtime, chunks)
Expand Down
6 changes: 6 additions & 0 deletions test/integration/test_integration__io.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,3 +1314,9 @@ def test_read_file_handle_with_dask():
os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"), "rb"
) as src:
rioxarray.open_rasterio(src, chunks=2048)


@cint_skip
def test_read_cint16_with_dask():
test_file = os.path.join(TEST_INPUT_DATA_DIR, "cint16.tif")
rioxarray.open_rasterio(test_file, chunks=True)