Skip to content

Failing tests with predictor = 2 #19

@maxrjones

Description

@maxrjones

There are a couple GDAL test images that I couldn't figure out how to decode properly in #12. Here's how to replicate the issue outside pytest:

Failure 1

download https://dagshub.com/maxrjones/virtual-tiff/raw/40997bc52e1c2d61014220f4a87849015a7555e0/tests/dvc/gdal_autotest/float32_LZW_predictor_2.tif

from obstore.store import LocalStore
from virtual_tiff.reader import create_manifest_store
import zarr
import rioxarray
import numpy as np

filepath = "float32_LZW_predictor_2.tif"

ms = create_manifest_store(
    filepath=filepath, group="0", store = LocalStore()
)
a = zarr.open_array(ms, mode="r", zarr_format=3, path="0")
observed = a[:]
expected = rioxarray.open_rasterio(filepath).data.squeeze()
np.testing.assert_allclose(observed, expected)

Failure 2

Download https://dagshub.com/maxrjones/virtual-tiff/raw/40997bc52e1c2d61014220f4a87849015a7555e0/tests/dvc/gdal_gcore/test_hgrid_with_subgrid.tif

from obstore.store import LocalStore
from virtual_tiff.reader import create_manifest_store
import zarr
import rioxarray
import numpy as np

filepath = "test_hgrid_with_subgrid.tif"

ms = create_manifest_store(
    filepath=filepath, group="0", store = LocalStore()
)
a = zarr.open_array(ms, mode="r", zarr_format=3, path="0")
observed = a[:]
expected = rioxarray.open_rasterio(filepath)[0]
expected = expected[filepath.replace("/", "_").lstrip("_")]
expected = expected.data.squeeze()
np.testing.assert_allclose(observed, expected)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions