Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sourcing python-remove-tests-dir-hook
- Sourcing python-catch-conflicts-hook.sh
- Sourcing python-remove-bin-bytecode-hook.sh
- Sourcing pypa-build-hook
- Using pypaBuildPhase
- Sourcing python-runtime-deps-check-hook
- Using pythonRuntimeDepsCheckHook
- Sourcing pypa-install-hook
- Using pypaInstallPhase
- Sourcing python-imports-check-hook.sh
- Using pythonImportsCheckPhase
- Sourcing python-namespaces-hook
- Sourcing python-catch-conflicts-hook.sh
- Sourcing pytest-check-hook
- Using pytestCheckPhase
- Running phase: unpackPhase
- unpacking source archive /nix/store/hwvdjqfaczah10wcjxsyvvqnj8as8brl-source
- source root is source
- setting SOURCE_DATE_EPOCH to timestamp 315619200 of file source/test/unit/test_unit_reproject_match.py
- Running phase: patchPhase
- Running phase: updateAutotoolsGnuConfigScriptsPhase
- Running phase: configurePhase
- no configure script, doing nothing
- Running phase: buildPhase
- Executing pypaBuildPhase
- Creating a wheel...
- * Getting build dependencies for wheel...
- running egg_info
- creating rioxarray.egg-info
- writing rioxarray.egg-info/PKG-INFO
- writing dependency_links to rioxarray.egg-info/dependency_links.txt
- writing entry points to rioxarray.egg-info/entry_points.txt
- writing requirements to rioxarray.egg-info/requires.txt
- writing top-level names to rioxarray.egg-info/top_level.txt
- writing manifest file 'rioxarray.egg-info/SOURCES.txt'
- reading manifest file 'rioxarray.egg-info/SOURCES.txt'
- reading manifest template 'MANIFEST.in'
- warning: no previously-included files matching '*' found under directory 'test'
- warning: no previously-included files matching '__pycache__' found under directory '*'
- warning: no previously-included files matching '*.py[co]' found under directory '*'
- no previously-included directories found matching 'docs/'
- adding license file 'LICENSE'
- adding license file 'LICENSE_datacube'
- adding license file 'LICENSE_xarray'
- adding license file 'AUTHORS.rst'
- writing manifest file 'rioxarray.egg-info/SOURCES.txt'
- * Building wheel...
- running bdist_wheel
- running build
- running build_py
- creating build
- creating build/lib
- creating build/lib/rioxarray
- copying rioxarray/__init__.py -> build/lib/rioxarray
- copying rioxarray/_io.py -> build/lib/rioxarray
- copying rioxarray/_options.py -> build/lib/rioxarray
- copying rioxarray/_show_versions.py -> build/lib/rioxarray
- copying rioxarray/crs.py -> build/lib/rioxarray
- copying rioxarray/exceptions.py -> build/lib/rioxarray
- copying rioxarray/merge.py -> build/lib/rioxarray
- copying rioxarray/raster_array.py -> build/lib/rioxarray
- copying rioxarray/raster_dataset.py -> build/lib/rioxarray
- copying rioxarray/raster_writer.py -> build/lib/rioxarray
- copying rioxarray/rioxarray.py -> build/lib/rioxarray
- copying rioxarray/xarray_plugin.py -> build/lib/rioxarray
- running egg_info
- writing rioxarray.egg-info/PKG-INFO
- writing dependency_links to rioxarray.egg-info/dependency_links.txt
- writing entry points to rioxarray.egg-info/entry_points.txt
- writing requirements to rioxarray.egg-info/requires.txt
- writing top-level names to rioxarray.egg-info/top_level.txt
- reading manifest file 'rioxarray.egg-info/SOURCES.txt'
- reading manifest template 'MANIFEST.in'
- warning: no previously-included files matching '*' found under directory 'test'
- warning: no previously-included files matching '__pycache__' found under directory '*'
- warning: no previously-included files matching '*.py[co]' found under directory '*'
- no previously-included directories found matching 'docs/'
- adding license file 'LICENSE'
- adding license file 'LICENSE_datacube'
- adding license file 'LICENSE_xarray'
- adding license file 'AUTHORS.rst'
- writing manifest file 'rioxarray.egg-info/SOURCES.txt'
- copying rioxarray/py.typed -> build/lib/rioxarray
- installing to build/bdist.linux-aarch64/wheel
- running install
- running install_lib
- creating build/bdist.linux-aarch64
- creating build/bdist.linux-aarch64/wheel
- creating build/bdist.linux-aarch64/wheel/rioxarray
- copying build/lib/rioxarray/__init__.py -> build/bdist.linux-aarch64/wheel/rioxarray
- copying build/lib/rioxarray/_io.py -> build/bdist.linux-aarch64/wheel/rioxarray
- copying build/lib/rioxarray/_options.py -> build/bdist.linux-aarch64/wheel/rioxarray
- copying build/lib/rioxarray/_show_versions.py -> build/bdist.linux-aarch64/wheel/rioxarray
- copying build/lib/rioxarray/crs.py -> build/bdist.linux-aarch64/wheel/rioxarray
- copying build/lib/rioxarray/exceptions.py -> build/bdist.linux-aarch64/wheel/rioxarray
- copying build/lib/rioxarray/merge.py -> build/bdist.linux-aarch64/wheel/rioxarray
- copying build/lib/rioxarray/raster_array.py -> build/bdist.linux-aarch64/wheel/rioxarray
- copying build/lib/rioxarray/raster_dataset.py -> build/bdist.linux-aarch64/wheel/rioxarray
- copying build/lib/rioxarray/raster_writer.py -> build/bdist.linux-aarch64/wheel/rioxarray
- copying build/lib/rioxarray/rioxarray.py -> build/bdist.linux-aarch64/wheel/rioxarray
- copying build/lib/rioxarray/xarray_plugin.py -> build/bdist.linux-aarch64/wheel/rioxarray
- copying build/lib/rioxarray/py.typed -> build/bdist.linux-aarch64/wheel/rioxarray
- running install_egg_info
- Copying rioxarray.egg-info to build/bdist.linux-aarch64/wheel/rioxarray-0.15.5-py3.11.egg-info
- running install_scripts
- creating build/bdist.linux-aarch64/wheel/rioxarray-0.15.5.dist-info/WHEEL
- creating '/build/source/dist/.tmp-jlz2ku01/rioxarray-0.15.5-py3-none-any.whl' and adding 'build/bdist.linux-aarch64/wheel' to it
- adding 'rioxarray/__init__.py'
- adding 'rioxarray/_io.py'
- adding 'rioxarray/_options.py'
- adding 'rioxarray/_show_versions.py'
- adding 'rioxarray/crs.py'
- adding 'rioxarray/exceptions.py'
- adding 'rioxarray/merge.py'
- adding 'rioxarray/py.typed'
- adding 'rioxarray/raster_array.py'
- adding 'rioxarray/raster_dataset.py'
- adding 'rioxarray/raster_writer.py'
- adding 'rioxarray/rioxarray.py'
- adding 'rioxarray/xarray_plugin.py'
- adding 'rioxarray-0.15.5.dist-info/AUTHORS.rst'
- adding 'rioxarray-0.15.5.dist-info/LICENSE'
- adding 'rioxarray-0.15.5.dist-info/LICENSE_datacube'
- adding 'rioxarray-0.15.5.dist-info/LICENSE_xarray'
- adding 'rioxarray-0.15.5.dist-info/METADATA'
- adding 'rioxarray-0.15.5.dist-info/WHEEL'
- adding 'rioxarray-0.15.5.dist-info/entry_points.txt'
- adding 'rioxarray-0.15.5.dist-info/top_level.txt'
- adding 'rioxarray-0.15.5.dist-info/RECORD'
- removing build/bdist.linux-aarch64/wheel
- Successfully built rioxarray-0.15.5-py3-none-any.whl
- Finished creating a wheel...
- Finished executing pypaBuildPhase
- Running phase: pythonRuntimeDepsCheckHook
- Executing pythonRuntimeDepsCheck
- Checking runtime dependencies for rioxarray-0.15.5-py3-none-any.whl
- Finished executing pythonRuntimeDepsCheck
- Running phase: installPhase
- Executing pypaInstallPhase
- Successfully installed rioxarray-0.15.5-py3-none-any.whl
- Finished executing pypaInstallPhase
- Running phase: pythonOutputDistPhase
- Executing pythonOutputDistPhase
- Finished executing pythonOutputDistPhase
- Running phase: fixupPhase
- shrinking RPATHs of ELF executables and libraries in /nix/store/k52kyfman0i2lljapwc8yjxm1v9d9dpz-python3.11-rioxarray-0.15.5
- checking for references to /build/ in /nix/store/k52kyfman0i2lljapwc8yjxm1v9d9dpz-python3.11-rioxarray-0.15.5...
- patching script interpreter paths in /nix/store/k52kyfman0i2lljapwc8yjxm1v9d9dpz-python3.11-rioxarray-0.15.5
- stripping (with command strip and flags -S -p) in /nix/store/k52kyfman0i2lljapwc8yjxm1v9d9dpz-python3.11-rioxarray-0.15.5/lib
- shrinking RPATHs of ELF executables and libraries in /nix/store/6m28s7jdgqwzay2k7795f6snzzlzkmsd-python3.11-rioxarray-0.15.5-dist
- checking for references to /build/ in /nix/store/6m28s7jdgqwzay2k7795f6snzzlzkmsd-python3.11-rioxarray-0.15.5-dist...
- patching script interpreter paths in /nix/store/6m28s7jdgqwzay2k7795f6snzzlzkmsd-python3.11-rioxarray-0.15.5-dist
- Executing pythonRemoveTestsDir
- Finished executing pythonRemoveTestsDir
- Running phase: installCheckPhase
- no Makefile or custom installCheckPhase, doing nothing
- Running phase: pythonCatchConflictsPhase
- Running phase: pythonRemoveBinBytecodePhase
- Running phase: pythonImportsCheckPhase
- Executing pythonImportsCheckPhase
- Check whether the following modules can be imported: rioxarray
- Running phase: pytestCheckPhase
- Executing pytestCheckPhase
- ============================= test session starts ==============================
- platform linux -- Python 3.11.9, pytest-8.1.1, pluggy-1.4.0
- rootdir: /build/source
- configfile: pyproject.toml
- collected 459 items / 8 deselected / 451 selected
- test/integration/test_integration__io.py .............................F. [ 6%]
- ............x....x........................................... [ 20%]
- test/integration/test_integration__io_uri_manager.py ........ [ 22%]
- test/integration/test_integration_merge.py ....... [ 23%]
- test/integration/test_integration_rioxarray.py ......................... [ 29%]
- .............FFFFFFFFFFFF......s........................................ [ 45%]
- ......................................................sss.sssssssss...s. [ 61%]
- .................................................................XX..... [ 77%]
- .................................................ss..................... [ 93%]
- ........s....... [ 96%]
- test/integration/test_integration_xarray_plugin.py ...... [ 98%]
- test/unit/test_options.py .... [ 98%]
- test/unit/test_show_versions.py .... [ 99%]
- test/unit/test_unit_reproject_match.py . [100%]
- =================================== FAILURES ===================================
- ______________________ test_open_rasterio_mask_chunk_clip ______________________
- def test_open_rasterio_mask_chunk_clip():
- with rioxarray.open_rasterio(
- os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
- masked=True,
- chunks=True,
- default_name="dem",
- ) as xdi:
- if isinstance(xdi, xarray.Dataset):
- xdi = xdi.dem
- assert xdi.name == "dem"
- assert str(xdi.dtype) == "float32"
- assert str(xdi.data.dtype) == "float32"
- assert str(type(xdi.data)) == "<class 'dask.array.core.Array'>"
- assert xdi.chunks == ((1,), (245,), (574,))
- assert numpy.isnan(xdi.values).sum() == 52119
- test_encoding = dict(xdi.encoding)
- assert test_encoding.pop("source").endswith("small_dem_3m_merged.tif")
- assert test_encoding == {
- "_FillValue": 0.0,
- "grid_mapping": "spatial_ref",
- "dtype": "uint16",
- "rasterio_dtype": "uint16",
- }
- attrs = dict(xdi.attrs)
- assert_almost_equal(
- tuple(xdi.rio._cached_transform())[:6],
- (3.0, 0.0, 425047.68381405267, 0.0, -3.0, 4615780.040546387),
- )
- assert attrs == {
- "AREA_OR_POINT": "Area",
- "add_offset": 0.0,
- "scale_factor": 1.0,
- }
- # get subset for testing
- subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
- comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
- # add transform for test
- comp_subset.rio.write_transform()
- geometries = [
- {
- "type": "Polygon",
- "coordinates": [
- [
- [subset.x.values[0], subset.y.values[-1]],
- [subset.x.values[0], subset.y.values[0]],
- [subset.x.values[-1], subset.y.values[0]],
- [subset.x.values[-1], subset.y.values[-1]],
- [subset.x.values[0], subset.y.values[-1]],
- ]
- ],
- }
- ]
- # test data array
- clipped = xdi.rio.clip(geometries, comp_subset.rio.crs)
- > _assert_xarrays_equal(clipped, comp_subset)
- test/integration/test_integration__io.py:338:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/conftest.py:84: in _assert_xarrays_equal
- assert_almost_equal(
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d628d60>, array([[[30692., 30696., 30699., 30702., 307... 30621.],
- [30611., 30610., 30610., 30610., 30610., 30611., 30612., 30614.,
- 30616.]]], dtype=float32))
- kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
- @wraps(func)
- def inner(*args, **kwds):
- with self._recreate_cm():
- > return func(*args, **kwds)
- E AssertionError:
- E Arrays are not almost equal to 7 decimals
- E
- E Mismatched elements: 375 / 441 (85%)
- E Max absolute difference: 7.
- E Max relative difference: 0.00022836
- E x: array([[[30692., 30696., 30699., 30702., 30704., 30705., 30705., 30704.,
- E 30703.],
- E [30690., 30694., 30697., 30700., 30703., 30705., 30704., 30704.,...
- E y: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
- E 30701.],
- E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- [30692. 30696. 30699. 30702. 30704. 30705. 30704. 30703. 30690. 30694.
- 30697. 30700. 30703. 30705. 30704. 30703. 30687. 30692. 30695. 30699.
- 30703. 30704. 30703. 30702. 30701. 30682. 30688. 30692. 30696. 30699.
- 30702. 30701. 30700. 30678. 30684. 30689. 30691. 30695. 30698. 30674.
- 30680. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30670. 30675.
- 30678. 30683. 30687. 30690. 30691. 30693. 30692. 30668. 30671. 30675.
- 30679. 30683. 30686. 30688. 30666. 30668. 30672. 30675. 30679. 30684.
- 30685. 30686. 30663. 30666. 30668. 30672. 30676. 30680. 30681. 30682.
- 30683. 30661. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30660.
- 30663. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30659. 30662.
- 30664. 30667. 30672. 30675. 30676. 30677. 30676. 30658. 30660. 30663.
- 30665. 30668. 30671. 30673. 30674. 30673. 30659. 30661. 30663. 30665.
- 30666. 30669. 30672. 30673. 30672. 30659. 30661. 30664. 30665. 30667.
- 30669. 30672. 30673. 30672. 30662. 30663. 30665. 30666. 30668. 30670.
- 30671. 30672. 30665. 30666. 30667. 30669. 30671. 30673. 30672. 30671.
- 30668. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30670. 30671.
- 30672. 30673. 30674. 30673. 30672. 30671. 30673. 30675. 30673. 30672.
- 30672. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30673. 30675.
- 30677. 30675. 30673. 30672. 30670. 30672. 30675. 30676. 30675. 30674.
- 30673. 30672. 30671. 30675. 30676. 30675. 30674. 30673. 30668. 30672.
- 30675. 30676. 30677. 30676. 30675. 30673. 30665. 30670. 30674. 30675.
- 30677. 30676. 30674. 30673. 30662. 30668. 30672. 30675. 30676. 30674.
- 30673. 30658. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30654.
- 30661. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30650. 30657.
- 30662. 30668. 30671. 30672. 30671. 30670. 30647. 30654. 30659. 30665.
- 30668. 30669. 30668. 30645. 30651. 30656. 30662. 30665. 30666. 30667.
- 30643. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30641.
- 30646. 30651. 30655. 30659. 30661. 30662. 30639. 30644. 30648. 30652.
- 30655. 30658. 30636. 30642. 30645. 30648. 30651. 30654. 30655. 30657.
- 30635. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30634. 30638.
- 30640. 30643. 30646. 30648. 30650. 30632. 30635. 30637. 30640. 30643.
- 30645. 30647. 30630. 30632. 30635. 30636. 30639. 30641. 30643. 30644.
- 30628. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30626. 30628.
- 30630. 30632. 30634. 30636. 30638. 30624. 30625. 30627. 30629. 30631.
- 30633. 30634. 30635. 30622. 30623. 30624. 30625. 30627. 30629. 30630.
- 30631. 30620. 30621. 30622. 30623. 30625. 30626. 30627. 30617. 30616.
- 30617. 30618. 30619. 30621. 30623. 30614. 30615. 30617. 30619. 30612.
- 30611. 30610. 30611. 30612. 30614.]
- [30696. 30699. 30702. 30704. 30705. 30704. 30703. 30701. 30694. 30697.
- 30700. 30703. 30705. 30704. 30703. 30700. 30692. 30695. 30699. 30703.
- 30704. 30703. 30702. 30701. 30698. 30688. 30692. 30696. 30699. 30702.
- 30701. 30700. 30697. 30684. 30689. 30691. 30695. 30698. 30694. 30680.
- 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30691. 30675. 30678.
- 30683. 30687. 30690. 30691. 30693. 30692. 30689. 30671. 30675. 30679.
- 30683. 30686. 30688. 30686. 30668. 30672. 30675. 30679. 30684. 30685.
- 30686. 30684. 30666. 30668. 30672. 30676. 30680. 30681. 30682. 30683.
- 30680. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30676. 30663.
- 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30675. 30662. 30664.
- 30667. 30672. 30675. 30676. 30677. 30676. 30674. 30660. 30663. 30665.
- 30668. 30671. 30673. 30674. 30673. 30671. 30661. 30663. 30665. 30666.
- 30669. 30672. 30673. 30672. 30669. 30661. 30664. 30665. 30667. 30669.
- 30672. 30673. 30672. 30670. 30663. 30665. 30666. 30668. 30670. 30671.
- 30672. 30669. 30666. 30667. 30669. 30671. 30673. 30672. 30671. 30668.
- 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30667. 30671. 30672.
- 30673. 30674. 30673. 30672. 30668. 30673. 30675. 30673. 30672. 30668.
- 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30668. 30675. 30677.
- 30675. 30673. 30672. 30670. 30668. 30675. 30676. 30675. 30674. 30673.
- 30672. 30669. 30675. 30676. 30675. 30674. 30673. 30670. 30672. 30675.
- 30676. 30677. 30676. 30675. 30673. 30671. 30670. 30674. 30675. 30677.
- 30676. 30674. 30673. 30671. 30668. 30672. 30675. 30676. 30674. 30673.
- 30671. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30671. 30661.
- 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30671. 30657. 30662.
- 30668. 30671. 30672. 30671. 30670. 30669. 30654. 30659. 30665. 30668.
- 30669. 30668. 30667. 30651. 30656. 30662. 30665. 30666. 30667. 30666.
- 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30663. 30646.
- 30651. 30655. 30659. 30661. 30662. 30661. 30644. 30648. 30652. 30655.
- 30658. 30659. 30642. 30645. 30648. 30651. 30654. 30655. 30657. 30656.
- 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30653. 30638. 30640.
- 30643. 30646. 30648. 30650. 30651. 30635. 30637. 30640. 30643. 30645.
- 30647. 30648. 30632. 30635. 30636. 30639. 30641. 30643. 30644. 30645.
- 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30642. 30628. 30630.
- 30632. 30634. 30636. 30638. 30639. 30625. 30627. 30629. 30631. 30633.
- 30634. 30635. 30636. 30623. 30624. 30625. 30627. 30629. 30630. 30631.
- 30632. 30621. 30622. 30623. 30625. 30626. 30627. 30628. 30616. 30617.
- 30618. 30619. 30621. 30623. 30625. 30615. 30617. 30619. 30621. 30611.
- 30610. 30611. 30612. 30614. 30616.]
- ____________________ test_clip_geojson[open_rasterio-True] _____________________
- open_func = <function open_rasterio at 0xffff5dd15c60>, from_disk = True
- @pytest.mark.parametrize("from_disk", [True, False])
- @pytest.mark.parametrize(
- "open_func",
- [
- rioxarray.open_rasterio,
- partial(rioxarray.open_rasterio, parse_coordinates=False),
- partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
- open_rasterio_engine,
- partial(open_rasterio_engine, parse_coordinates=False),
- partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
- ],
- )
- def test_clip_geojson(open_func, from_disk):
- with open_func(
- os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
- ) as xdi:
- # get subset for testing
- subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
- comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
- if isinstance(comp_subset, xarray.Dataset):
- comp_subset = comp_subset.band_data
- # add transform for test
- comp_subset.rio.write_transform(inplace=True)
- # add grid mapping for test
- comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
- if comp_subset.rio.encoded_nodata is None:
- comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
- geometries = [
- {
- "type": "Polygon",
- "coordinates": [
- [
- [425499.18381405267, 4615331.540546387],
- [425499.18381405267, 4615478.540546387],
- [425526.18381405267, 4615478.540546387],
- [425526.18381405267, 4615331.540546387],
- [425499.18381405267, 4615331.540546387],
- ]
- ],
- }
- ]
- # test data array
- clipped = xdi.rio.clip(geometries, from_disk=from_disk)
- if from_disk and not isinstance(clipped, xarray.Dataset):
- > _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
- test/integration/test_integration_rioxarray.py:570:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/conftest.py:84: in _assert_xarrays_equal
- assert_almost_equal(
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d693ce0>, array([[[30696, 30699, 30702, 30704, 30705, ..., 30617, 30619, 30621],
- [30611, 30610, 30610, 30610, 30610, 30611, 30612, 30614, 30616]]],
- dtype=uint16))
- kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
- @wraps(func)
- def inner(*args, **kwds):
- with self._recreate_cm():
- > return func(*args, **kwds)
- E AssertionError:
- E Arrays are not almost equal to 7 decimals
- E
- E Mismatched elements: 49 / 441 (11.1%)
- E Max absolute difference: 30701
- E Max relative difference: 1.
- E x: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 0],
- E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 0],
- E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 0],...
- E y: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 30701],
- E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 30700],
- E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 30698],...
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0]
- [30701 30700 30698 30697 30694 30691 30689 30686 30684 30680 30676 30675
- 30674 30671 30669 30670 30669 30668 30667 30668 30668 30668 30668 30669
- 30670 30671 30671 30671 30671 30671 30669 30667 30666 30663 30661 30659
- 30656 30653 30651 30648 30645 30642 30639 30636 30632 30628 30625 30621
- 30616]
- ____________________ test_clip_geojson[open_rasterio-False] ____________________
- open_func = <function open_rasterio at 0xffff5dd15c60>, from_disk = False
- @pytest.mark.parametrize("from_disk", [True, False])
- @pytest.mark.parametrize(
- "open_func",
- [
- rioxarray.open_rasterio,
- partial(rioxarray.open_rasterio, parse_coordinates=False),
- partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
- open_rasterio_engine,
- partial(open_rasterio_engine, parse_coordinates=False),
- partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
- ],
- )
- def test_clip_geojson(open_func, from_disk):
- with open_func(
- os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
- ) as xdi:
- # get subset for testing
- subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
- comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
- if isinstance(comp_subset, xarray.Dataset):
- comp_subset = comp_subset.band_data
- # add transform for test
- comp_subset.rio.write_transform(inplace=True)
- # add grid mapping for test
- comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
- if comp_subset.rio.encoded_nodata is None:
- comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
- geometries = [
- {
- "type": "Polygon",
- "coordinates": [
- [
- [425499.18381405267, 4615331.540546387],
- [425499.18381405267, 4615478.540546387],
- [425526.18381405267, 4615478.540546387],
- [425526.18381405267, 4615331.540546387],
- [425499.18381405267, 4615331.540546387],
- ]
- ],
- }
- ]
- # test data array
- clipped = xdi.rio.clip(geometries, from_disk=from_disk)
- if from_disk and not isinstance(clipped, xarray.Dataset):
- _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
- if comp_subset.rio.encoded_nodata is not None:
- assert numpy.isnan(clipped.values[:, 0, :]).all()
- assert numpy.isnan(clipped.values[:, :, 0]).all()
- else:
- assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
- assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
- else:
- if isinstance(clipped, xarray.Dataset):
- clipped = clipped.band_data
- > _assert_xarrays_equal(clipped, comp_subset)
- test/integration/test_integration_rioxarray.py:580:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/conftest.py:84: in _assert_xarrays_equal
- assert_almost_equal(
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d691260>, array([[[30692, 30696, 30699, 30702, 30704, ..., 30617, 30619, 30621],
- [30611, 30610, 30610, 30610, 30610, 30611, 30612, 30614, 30616]]],
- dtype=uint16))
- kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
- @wraps(func)
- def inner(*args, **kwds):
- with self._recreate_cm():
- > return func(*args, **kwds)
- E AssertionError:
- E Arrays are not almost equal to 7 decimals
- E
- E Mismatched elements: 375 / 441 (85%)
- E Max absolute difference: 7
- E Max relative difference: 0.00022836
- E x: array([[[30692, 30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703],
- E [30690, 30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703],
- E [30687, 30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701],...
- E y: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 30701],
- E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 30700],
- E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 30698],...
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- [30692 30696 30699 30702 30704 30705 30704 30703 30690 30694 30697 30700
- 30703 30705 30704 30703 30687 30692 30695 30699 30703 30704 30703 30702
- 30701 30682 30688 30692 30696 30699 30702 30701 30700 30678 30684 30689
- 30691 30695 30698 30674 30680 30683 30686 30691 30694 30695 30696 30695
- 30670 30675 30678 30683 30687 30690 30691 30693 30692 30668 30671 30675
- 30679 30683 30686 30688 30666 30668 30672 30675 30679 30684 30685 30686
- 30663 30666 30668 30672 30676 30680 30681 30682 30683 30661 30663 30666
- 30670 30674 30676 30678 30680 30660 30663 30665 30670 30674 30675 30677
- 30679 30678 30659 30662 30664 30667 30672 30675 30676 30677 30676 30658
- 30660 30663 30665 30668 30671 30673 30674 30673 30659 30661 30663 30665
- 30666 30669 30672 30673 30672 30659 30661 30664 30665 30667 30669 30672
- 30673 30672 30662 30663 30665 30666 30668 30670 30671 30672 30665 30666
- 30667 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674
- 30673 30671 30670 30671 30672 30673 30674 30673 30672 30671 30673 30675
- 30673 30672 30672 30674 30676 30677 30674 30673 30672 30671 30673 30675
- 30677 30675 30673 30672 30670 30672 30675 30676 30675 30674 30673 30672
- 30671 30675 30676 30675 30674 30673 30668 30672 30675 30676 30677 30676
- 30675 30673 30665 30670 30674 30675 30677 30676 30674 30673 30662 30668
- 30672 30675 30676 30674 30673 30658 30665 30669 30673 30674 30675 30674
- 30672 30654 30661 30666 30671 30672 30673 30674 30673 30672 30650 30657
- 30662 30668 30671 30672 30671 30670 30647 30654 30659 30665 30668 30669
- 30668 30645 30651 30656 30662 30665 30666 30667 30643 30649 30654 30659
- 30662 30663 30664 30666 30665 30641 30646 30651 30655 30659 30661 30662
- 30639 30644 30648 30652 30655 30658 30636 30642 30645 30648 30651 30654
- 30655 30657 30635 30640 30642 30646 30649 30650 30652 30654 30634 30638
- 30640 30643 30646 30648 30650 30632 30635 30637 30640 30643 30645 30647
- 30630 30632 30635 30636 30639 30641 30643 30644 30628 30630 30633 30634
- 30635 30637 30639 30641 30626 30628 30630 30632 30634 30636 30638 30624
- 30625 30627 30629 30631 30633 30634 30635 30622 30623 30624 30625 30627
- 30629 30630 30631 30620 30621 30622 30623 30625 30626 30627 30617 30616
- 30617 30618 30619 30621 30623 30614 30615 30617 30619 30612 30611 30610
- 30611 30612 30614]
- [30696 30699 30702 30704 30705 30704 30703 30701 30694 30697 30700 30703
- 30705 30704 30703 30700 30692 30695 30699 30703 30704 30703 30702 30701
- 30698 30688 30692 30696 30699 30702 30701 30700 30697 30684 30689 30691
- 30695 30698 30694 30680 30683 30686 30691 30694 30695 30696 30695 30691
- 30675 30678 30683 30687 30690 30691 30693 30692 30689 30671 30675 30679
- 30683 30686 30688 30686 30668 30672 30675 30679 30684 30685 30686 30684
- 30666 30668 30672 30676 30680 30681 30682 30683 30680 30663 30666 30670
- 30674 30676 30678 30680 30676 30663 30665 30670 30674 30675 30677 30679
- 30678 30675 30662 30664 30667 30672 30675 30676 30677 30676 30674 30660
- 30663 30665 30668 30671 30673 30674 30673 30671 30661 30663 30665 30666
- 30669 30672 30673 30672 30669 30661 30664 30665 30667 30669 30672 30673
- 30672 30670 30663 30665 30666 30668 30670 30671 30672 30669 30666 30667
- 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674 30673
- 30671 30667 30671 30672 30673 30674 30673 30672 30668 30673 30675 30673
- 30672 30668 30674 30676 30677 30674 30673 30672 30671 30668 30675 30677
- 30675 30673 30672 30670 30668 30675 30676 30675 30674 30673 30672 30669
- 30675 30676 30675 30674 30673 30670 30672 30675 30676 30677 30676 30675
- 30673 30671 30670 30674 30675 30677 30676 30674 30673 30671 30668 30672
- 30675 30676 30674 30673 30671 30665 30669 30673 30674 30675 30674 30672
- 30671 30661 30666 30671 30672 30673 30674 30673 30672 30671 30657 30662
- 30668 30671 30672 30671 30670 30669 30654 30659 30665 30668 30669 30668
- 30667 30651 30656 30662 30665 30666 30667 30666 30649 30654 30659 30662
- 30663 30664 30666 30665 30663 30646 30651 30655 30659 30661 30662 30661
- 30644 30648 30652 30655 30658 30659 30642 30645 30648 30651 30654 30655
- 30657 30656 30640 30642 30646 30649 30650 30652 30654 30653 30638 30640
- 30643 30646 30648 30650 30651 30635 30637 30640 30643 30645 30647 30648
- 30632 30635 30636 30639 30641 30643 30644 30645 30630 30633 30634 30635
- 30637 30639 30641 30642 30628 30630 30632 30634 30636 30638 30639 30625
- 30627 30629 30631 30633 30634 30635 30636 30623 30624 30625 30627 30629
- 30630 30631 30632 30621 30622 30623 30625 30626 30627 30628 30616 30617
- 30618 30619 30621 30623 30625 30615 30617 30619 30621 30611 30610 30611
- 30612 30614 30616]
- ______________________ test_clip_geojson[open_func1-True] ______________________
- open_func = functools.partial(<function open_rasterio at 0xffff5dd15c60>, parse_coordinates=False)
- from_disk = True
- @pytest.mark.parametrize("from_disk", [True, False])
- @pytest.mark.parametrize(
- "open_func",
- [
- rioxarray.open_rasterio,
- partial(rioxarray.open_rasterio, parse_coordinates=False),
- partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
- open_rasterio_engine,
- partial(open_rasterio_engine, parse_coordinates=False),
- partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
- ],
- )
- def test_clip_geojson(open_func, from_disk):
- with open_func(
- os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
- ) as xdi:
- # get subset for testing
- subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
- comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
- if isinstance(comp_subset, xarray.Dataset):
- comp_subset = comp_subset.band_data
- # add transform for test
- comp_subset.rio.write_transform(inplace=True)
- # add grid mapping for test
- comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
- if comp_subset.rio.encoded_nodata is None:
- comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
- geometries = [
- {
- "type": "Polygon",
- "coordinates": [
- [
- [425499.18381405267, 4615331.540546387],
- [425499.18381405267, 4615478.540546387],
- [425526.18381405267, 4615478.540546387],
- [425526.18381405267, 4615331.540546387],
- [425499.18381405267, 4615331.540546387],
- ]
- ],
- }
- ]
- # test data array
- clipped = xdi.rio.clip(geometries, from_disk=from_disk)
- if from_disk and not isinstance(clipped, xarray.Dataset):
- > _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
- test/integration/test_integration_rioxarray.py:570:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/conftest.py:84: in _assert_xarrays_equal
- assert_almost_equal(
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d6b7880>, array([[[30696, 30699, 30702, 30704, 30705, ..., 30617, 30619, 30621],
- [30611, 30610, 30610, 30610, 30610, 30611, 30612, 30614, 30616]]],
- dtype=uint16))
- kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
- @wraps(func)
- def inner(*args, **kwds):
- with self._recreate_cm():
- > return func(*args, **kwds)
- E AssertionError:
- E Arrays are not almost equal to 7 decimals
- E
- E Mismatched elements: 49 / 441 (11.1%)
- E Max absolute difference: 30701
- E Max relative difference: 1.
- E x: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 0],
- E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 0],
- E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 0],...
- E y: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 30701],
- E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 30700],
- E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 30698],...
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0]
- [30701 30700 30698 30697 30694 30691 30689 30686 30684 30680 30676 30675
- 30674 30671 30669 30670 30669 30668 30667 30668 30668 30668 30668 30669
- 30670 30671 30671 30671 30671 30671 30669 30667 30666 30663 30661 30659
- 30656 30653 30651 30648 30645 30642 30639 30636 30632 30628 30625 30621
- 30616]
- _____________________ test_clip_geojson[open_func1-False] ______________________
- open_func = functools.partial(<function open_rasterio at 0xffff5dd15c60>, parse_coordinates=False)
- from_disk = False
- @pytest.mark.parametrize("from_disk", [True, False])
- @pytest.mark.parametrize(
- "open_func",
- [
- rioxarray.open_rasterio,
- partial(rioxarray.open_rasterio, parse_coordinates=False),
- partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
- open_rasterio_engine,
- partial(open_rasterio_engine, parse_coordinates=False),
- partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
- ],
- )
- def test_clip_geojson(open_func, from_disk):
- with open_func(
- os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
- ) as xdi:
- # get subset for testing
- subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
- comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
- if isinstance(comp_subset, xarray.Dataset):
- comp_subset = comp_subset.band_data
- # add transform for test
- comp_subset.rio.write_transform(inplace=True)
- # add grid mapping for test
- comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
- if comp_subset.rio.encoded_nodata is None:
- comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
- geometries = [
- {
- "type": "Polygon",
- "coordinates": [
- [
- [425499.18381405267, 4615331.540546387],
- [425499.18381405267, 4615478.540546387],
- [425526.18381405267, 4615478.540546387],
- [425526.18381405267, 4615331.540546387],
- [425499.18381405267, 4615331.540546387],
- ]
- ],
- }
- ]
- # test data array
- clipped = xdi.rio.clip(geometries, from_disk=from_disk)
- if from_disk and not isinstance(clipped, xarray.Dataset):
- _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
- if comp_subset.rio.encoded_nodata is not None:
- assert numpy.isnan(clipped.values[:, 0, :]).all()
- assert numpy.isnan(clipped.values[:, :, 0]).all()
- else:
- assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
- assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
- else:
- if isinstance(clipped, xarray.Dataset):
- clipped = clipped.band_data
- > _assert_xarrays_equal(clipped, comp_subset)
- test/integration/test_integration_rioxarray.py:580:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/conftest.py:84: in _assert_xarrays_equal
- assert_almost_equal(
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d6b7f60>, array([[[30692, 30696, 30699, 30702, 30704, ..., 30617, 30619, 30621],
- [30611, 30610, 30610, 30610, 30610, 30611, 30612, 30614, 30616]]],
- dtype=uint16))
- kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
- @wraps(func)
- def inner(*args, **kwds):
- with self._recreate_cm():
- > return func(*args, **kwds)
- E AssertionError:
- E Arrays are not almost equal to 7 decimals
- E
- E Mismatched elements: 375 / 441 (85%)
- E Max absolute difference: 7
- E Max relative difference: 0.00022836
- E x: array([[[30692, 30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703],
- E [30690, 30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703],
- E [30687, 30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701],...
- E y: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 30701],
- E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 30700],
- E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 30698],...
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- [30692 30696 30699 30702 30704 30705 30704 30703 30690 30694 30697 30700
- 30703 30705 30704 30703 30687 30692 30695 30699 30703 30704 30703 30702
- 30701 30682 30688 30692 30696 30699 30702 30701 30700 30678 30684 30689
- 30691 30695 30698 30674 30680 30683 30686 30691 30694 30695 30696 30695
- 30670 30675 30678 30683 30687 30690 30691 30693 30692 30668 30671 30675
- 30679 30683 30686 30688 30666 30668 30672 30675 30679 30684 30685 30686
- 30663 30666 30668 30672 30676 30680 30681 30682 30683 30661 30663 30666
- 30670 30674 30676 30678 30680 30660 30663 30665 30670 30674 30675 30677
- 30679 30678 30659 30662 30664 30667 30672 30675 30676 30677 30676 30658
- 30660 30663 30665 30668 30671 30673 30674 30673 30659 30661 30663 30665
- 30666 30669 30672 30673 30672 30659 30661 30664 30665 30667 30669 30672
- 30673 30672 30662 30663 30665 30666 30668 30670 30671 30672 30665 30666
- 30667 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674
- 30673 30671 30670 30671 30672 30673 30674 30673 30672 30671 30673 30675
- 30673 30672 30672 30674 30676 30677 30674 30673 30672 30671 30673 30675
- 30677 30675 30673 30672 30670 30672 30675 30676 30675 30674 30673 30672
- 30671 30675 30676 30675 30674 30673 30668 30672 30675 30676 30677 30676
- 30675 30673 30665 30670 30674 30675 30677 30676 30674 30673 30662 30668
- 30672 30675 30676 30674 30673 30658 30665 30669 30673 30674 30675 30674
- 30672 30654 30661 30666 30671 30672 30673 30674 30673 30672 30650 30657
- 30662 30668 30671 30672 30671 30670 30647 30654 30659 30665 30668 30669
- 30668 30645 30651 30656 30662 30665 30666 30667 30643 30649 30654 30659
- 30662 30663 30664 30666 30665 30641 30646 30651 30655 30659 30661 30662
- 30639 30644 30648 30652 30655 30658 30636 30642 30645 30648 30651 30654
- 30655 30657 30635 30640 30642 30646 30649 30650 30652 30654 30634 30638
- 30640 30643 30646 30648 30650 30632 30635 30637 30640 30643 30645 30647
- 30630 30632 30635 30636 30639 30641 30643 30644 30628 30630 30633 30634
- 30635 30637 30639 30641 30626 30628 30630 30632 30634 30636 30638 30624
- 30625 30627 30629 30631 30633 30634 30635 30622 30623 30624 30625 30627
- 30629 30630 30631 30620 30621 30622 30623 30625 30626 30627 30617 30616
- 30617 30618 30619 30621 30623 30614 30615 30617 30619 30612 30611 30610
- 30611 30612 30614]
- [30696 30699 30702 30704 30705 30704 30703 30701 30694 30697 30700 30703
- 30705 30704 30703 30700 30692 30695 30699 30703 30704 30703 30702 30701
- 30698 30688 30692 30696 30699 30702 30701 30700 30697 30684 30689 30691
- 30695 30698 30694 30680 30683 30686 30691 30694 30695 30696 30695 30691
- 30675 30678 30683 30687 30690 30691 30693 30692 30689 30671 30675 30679
- 30683 30686 30688 30686 30668 30672 30675 30679 30684 30685 30686 30684
- 30666 30668 30672 30676 30680 30681 30682 30683 30680 30663 30666 30670
- 30674 30676 30678 30680 30676 30663 30665 30670 30674 30675 30677 30679
- 30678 30675 30662 30664 30667 30672 30675 30676 30677 30676 30674 30660
- 30663 30665 30668 30671 30673 30674 30673 30671 30661 30663 30665 30666
- 30669 30672 30673 30672 30669 30661 30664 30665 30667 30669 30672 30673
- 30672 30670 30663 30665 30666 30668 30670 30671 30672 30669 30666 30667
- 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674 30673
- 30671 30667 30671 30672 30673 30674 30673 30672 30668 30673 30675 30673
- 30672 30668 30674 30676 30677 30674 30673 30672 30671 30668 30675 30677
- 30675 30673 30672 30670 30668 30675 30676 30675 30674 30673 30672 30669
- 30675 30676 30675 30674 30673 30670 30672 30675 30676 30677 30676 30675
- 30673 30671 30670 30674 30675 30677 30676 30674 30673 30671 30668 30672
- 30675 30676 30674 30673 30671 30665 30669 30673 30674 30675 30674 30672
- 30671 30661 30666 30671 30672 30673 30674 30673 30672 30671 30657 30662
- 30668 30671 30672 30671 30670 30669 30654 30659 30665 30668 30669 30668
- 30667 30651 30656 30662 30665 30666 30667 30666 30649 30654 30659 30662
- 30663 30664 30666 30665 30663 30646 30651 30655 30659 30661 30662 30661
- 30644 30648 30652 30655 30658 30659 30642 30645 30648 30651 30654 30655
- 30657 30656 30640 30642 30646 30649 30650 30652 30654 30653 30638 30640
- 30643 30646 30648 30650 30651 30635 30637 30640 30643 30645 30647 30648
- 30632 30635 30636 30639 30641 30643 30644 30645 30630 30633 30634 30635
- 30637 30639 30641 30642 30628 30630 30632 30634 30636 30638 30639 30625
- 30627 30629 30631 30633 30634 30635 30636 30623 30624 30625 30627 30629
- 30630 30631 30632 30621 30622 30623 30625 30626 30627 30628 30616 30617
- 30618 30619 30621 30623 30625 30615 30617 30619 30621 30611 30610 30611
- 30612 30614 30616]
- ______________________ test_clip_geojson[open_func2-True] ______________________
- open_func = functools.partial(<function open_rasterio at 0xffff5dd15c60>, parse_coordinates=False, masked=True)
- from_disk = True
- @pytest.mark.parametrize("from_disk", [True, False])
- @pytest.mark.parametrize(
- "open_func",
- [
- rioxarray.open_rasterio,
- partial(rioxarray.open_rasterio, parse_coordinates=False),
- partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
- open_rasterio_engine,
- partial(open_rasterio_engine, parse_coordinates=False),
- partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
- ],
- )
- def test_clip_geojson(open_func, from_disk):
- with open_func(
- os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
- ) as xdi:
- # get subset for testing
- subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
- comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
- if isinstance(comp_subset, xarray.Dataset):
- comp_subset = comp_subset.band_data
- # add transform for test
- comp_subset.rio.write_transform(inplace=True)
- # add grid mapping for test
- comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
- if comp_subset.rio.encoded_nodata is None:
- comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
- geometries = [
- {
- "type": "Polygon",
- "coordinates": [
- [
- [425499.18381405267, 4615331.540546387],
- [425499.18381405267, 4615478.540546387],
- [425526.18381405267, 4615478.540546387],
- [425526.18381405267, 4615331.540546387],
- [425499.18381405267, 4615331.540546387],
- ]
- ],
- }
- ]
- # test data array
- clipped = xdi.rio.clip(geometries, from_disk=from_disk)
- if from_disk and not isinstance(clipped, xarray.Dataset):
- > _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
- test/integration/test_integration_rioxarray.py:570:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/conftest.py:84: in _assert_xarrays_equal
- assert_almost_equal(
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d619940>, array([[[30696., 30699., 30702., 30704., 307... 30621.],
- [30611., 30610., 30610., 30610., 30610., 30611., 30612., 30614.,
- 30616.]]], dtype=float32))
- kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
- @wraps(func)
- def inner(*args, **kwds):
- with self._recreate_cm():
- > return func(*args, **kwds)
- E AssertionError:
- E Arrays are not almost equal to 7 decimals
- E
- E x and y nan location mismatch:
- E x: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
- E nan],
- E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
- E y: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
- E 30701.],
- E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- [nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
- nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
- nan nan nan nan nan nan nan nan nan nan nan nan nan]
- [30701. 30700. 30698. 30697. 30694. 30691. 30689. 30686. 30684. 30680.
- 30676. 30675. 30674. 30671. 30669. 30670. 30669. 30668. 30667. 30668.
- 30668. 30668. 30668. 30669. 30670. 30671. 30671. 30671. 30671. 30671.
- 30669. 30667. 30666. 30663. 30661. 30659. 30656. 30653. 30651. 30648.
- 30645. 30642. 30639. 30636. 30632. 30628. 30625. 30621. 30616.]
- _____________________ test_clip_geojson[open_func2-False] ______________________
- open_func = functools.partial(<function open_rasterio at 0xffff5dd15c60>, parse_coordinates=False, masked=True)
- from_disk = False
- @pytest.mark.parametrize("from_disk", [True, False])
- @pytest.mark.parametrize(
- "open_func",
- [
- rioxarray.open_rasterio,
- partial(rioxarray.open_rasterio, parse_coordinates=False),
- partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
- open_rasterio_engine,
- partial(open_rasterio_engine, parse_coordinates=False),
- partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
- ],
- )
- def test_clip_geojson(open_func, from_disk):
- with open_func(
- os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
- ) as xdi:
- # get subset for testing
- subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
- comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
- if isinstance(comp_subset, xarray.Dataset):
- comp_subset = comp_subset.band_data
- # add transform for test
- comp_subset.rio.write_transform(inplace=True)
- # add grid mapping for test
- comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
- if comp_subset.rio.encoded_nodata is None:
- comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
- geometries = [
- {
- "type": "Polygon",
- "coordinates": [
- [
- [425499.18381405267, 4615331.540546387],
- [425499.18381405267, 4615478.540546387],
- [425526.18381405267, 4615478.540546387],
- [425526.18381405267, 4615331.540546387],
- [425499.18381405267, 4615331.540546387],
- ]
- ],
- }
- ]
- # test data array
- clipped = xdi.rio.clip(geometries, from_disk=from_disk)
- if from_disk and not isinstance(clipped, xarray.Dataset):
- _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
- if comp_subset.rio.encoded_nodata is not None:
- assert numpy.isnan(clipped.values[:, 0, :]).all()
- assert numpy.isnan(clipped.values[:, :, 0]).all()
- else:
- assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
- assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
- else:
- if isinstance(clipped, xarray.Dataset):
- clipped = clipped.band_data
- > _assert_xarrays_equal(clipped, comp_subset)
- test/integration/test_integration_rioxarray.py:580:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/conftest.py:84: in _assert_xarrays_equal
- assert_almost_equal(
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d6b7b00>, array([[[30692., 30696., 30699., 30702., 307... 30621.],
- [30611., 30610., 30610., 30610., 30610., 30611., 30612., 30614.,
- 30616.]]], dtype=float32))
- kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
- @wraps(func)
- def inner(*args, **kwds):
- with self._recreate_cm():
- > return func(*args, **kwds)
- E AssertionError:
- E Arrays are not almost equal to 7 decimals
- E
- E Mismatched elements: 375 / 441 (85%)
- E Max absolute difference: 7.
- E Max relative difference: 0.00022836
- E x: array([[[30692., 30696., 30699., 30702., 30704., 30705., 30705., 30704.,
- E 30703.],
- E [30690., 30694., 30697., 30700., 30703., 30705., 30704., 30704.,...
- E y: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
- E 30701.],
- E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- [30692. 30696. 30699. 30702. 30704. 30705. 30704. 30703. 30690. 30694.
- 30697. 30700. 30703. 30705. 30704. 30703. 30687. 30692. 30695. 30699.
- 30703. 30704. 30703. 30702. 30701. 30682. 30688. 30692. 30696. 30699.
- 30702. 30701. 30700. 30678. 30684. 30689. 30691. 30695. 30698. 30674.
- 30680. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30670. 30675.
- 30678. 30683. 30687. 30690. 30691. 30693. 30692. 30668. 30671. 30675.
- 30679. 30683. 30686. 30688. 30666. 30668. 30672. 30675. 30679. 30684.
- 30685. 30686. 30663. 30666. 30668. 30672. 30676. 30680. 30681. 30682.
- 30683. 30661. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30660.
- 30663. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30659. 30662.
- 30664. 30667. 30672. 30675. 30676. 30677. 30676. 30658. 30660. 30663.
- 30665. 30668. 30671. 30673. 30674. 30673. 30659. 30661. 30663. 30665.
- 30666. 30669. 30672. 30673. 30672. 30659. 30661. 30664. 30665. 30667.
- 30669. 30672. 30673. 30672. 30662. 30663. 30665. 30666. 30668. 30670.
- 30671. 30672. 30665. 30666. 30667. 30669. 30671. 30673. 30672. 30671.
- 30668. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30670. 30671.
- 30672. 30673. 30674. 30673. 30672. 30671. 30673. 30675. 30673. 30672.
- 30672. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30673. 30675.
- 30677. 30675. 30673. 30672. 30670. 30672. 30675. 30676. 30675. 30674.
- 30673. 30672. 30671. 30675. 30676. 30675. 30674. 30673. 30668. 30672.
- 30675. 30676. 30677. 30676. 30675. 30673. 30665. 30670. 30674. 30675.
- 30677. 30676. 30674. 30673. 30662. 30668. 30672. 30675. 30676. 30674.
- 30673. 30658. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30654.
- 30661. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30650. 30657.
- 30662. 30668. 30671. 30672. 30671. 30670. 30647. 30654. 30659. 30665.
- 30668. 30669. 30668. 30645. 30651. 30656. 30662. 30665. 30666. 30667.
- 30643. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30641.
- 30646. 30651. 30655. 30659. 30661. 30662. 30639. 30644. 30648. 30652.
- 30655. 30658. 30636. 30642. 30645. 30648. 30651. 30654. 30655. 30657.
- 30635. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30634. 30638.
- 30640. 30643. 30646. 30648. 30650. 30632. 30635. 30637. 30640. 30643.
- 30645. 30647. 30630. 30632. 30635. 30636. 30639. 30641. 30643. 30644.
- 30628. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30626. 30628.
- 30630. 30632. 30634. 30636. 30638. 30624. 30625. 30627. 30629. 30631.
- 30633. 30634. 30635. 30622. 30623. 30624. 30625. 30627. 30629. 30630.
- 30631. 30620. 30621. 30622. 30623. 30625. 30626. 30627. 30617. 30616.
- 30617. 30618. 30619. 30621. 30623. 30614. 30615. 30617. 30619. 30612.
- 30611. 30610. 30611. 30612. 30614.]
- [30696. 30699. 30702. 30704. 30705. 30704. 30703. 30701. 30694. 30697.
- 30700. 30703. 30705. 30704. 30703. 30700. 30692. 30695. 30699. 30703.
- 30704. 30703. 30702. 30701. 30698. 30688. 30692. 30696. 30699. 30702.
- 30701. 30700. 30697. 30684. 30689. 30691. 30695. 30698. 30694. 30680.
- 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30691. 30675. 30678.
- 30683. 30687. 30690. 30691. 30693. 30692. 30689. 30671. 30675. 30679.
- 30683. 30686. 30688. 30686. 30668. 30672. 30675. 30679. 30684. 30685.
- 30686. 30684. 30666. 30668. 30672. 30676. 30680. 30681. 30682. 30683.
- 30680. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30676. 30663.
- 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30675. 30662. 30664.
- 30667. 30672. 30675. 30676. 30677. 30676. 30674. 30660. 30663. 30665.
- 30668. 30671. 30673. 30674. 30673. 30671. 30661. 30663. 30665. 30666.
- 30669. 30672. 30673. 30672. 30669. 30661. 30664. 30665. 30667. 30669.
- 30672. 30673. 30672. 30670. 30663. 30665. 30666. 30668. 30670. 30671.
- 30672. 30669. 30666. 30667. 30669. 30671. 30673. 30672. 30671. 30668.
- 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30667. 30671. 30672.
- 30673. 30674. 30673. 30672. 30668. 30673. 30675. 30673. 30672. 30668.
- 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30668. 30675. 30677.
- 30675. 30673. 30672. 30670. 30668. 30675. 30676. 30675. 30674. 30673.
- 30672. 30669. 30675. 30676. 30675. 30674. 30673. 30670. 30672. 30675.
- 30676. 30677. 30676. 30675. 30673. 30671. 30670. 30674. 30675. 30677.
- 30676. 30674. 30673. 30671. 30668. 30672. 30675. 30676. 30674. 30673.
- 30671. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30671. 30661.
- 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30671. 30657. 30662.
- 30668. 30671. 30672. 30671. 30670. 30669. 30654. 30659. 30665. 30668.
- 30669. 30668. 30667. 30651. 30656. 30662. 30665. 30666. 30667. 30666.
- 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30663. 30646.
- 30651. 30655. 30659. 30661. 30662. 30661. 30644. 30648. 30652. 30655.
- 30658. 30659. 30642. 30645. 30648. 30651. 30654. 30655. 30657. 30656.
- 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30653. 30638. 30640.
- 30643. 30646. 30648. 30650. 30651. 30635. 30637. 30640. 30643. 30645.
- 30647. 30648. 30632. 30635. 30636. 30639. 30641. 30643. 30644. 30645.
- 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30642. 30628. 30630.
- 30632. 30634. 30636. 30638. 30639. 30625. 30627. 30629. 30631. 30633.
- 30634. 30635. 30636. 30623. 30624. 30625. 30627. 30629. 30630. 30631.
- 30632. 30621. 30622. 30623. 30625. 30626. 30627. 30628. 30616. 30617.
- 30618. 30619. 30621. 30623. 30625. 30615. 30617. 30619. 30621. 30611.
- 30610. 30611. 30612. 30614. 30616.]
- ______________________ test_clip_geojson[open_func3-True] ______________________
- open_func = functools.partial(<function open_dataset at 0xffff5e34bc40>, engine='rasterio')
- from_disk = True
- @pytest.mark.parametrize("from_disk", [True, False])
- @pytest.mark.parametrize(
- "open_func",
- [
- rioxarray.open_rasterio,
- partial(rioxarray.open_rasterio, parse_coordinates=False),
- partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
- open_rasterio_engine,
- partial(open_rasterio_engine, parse_coordinates=False),
- partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
- ],
- )
- def test_clip_geojson(open_func, from_disk):
- with open_func(
- os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
- ) as xdi:
- # get subset for testing
- subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
- comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
- if isinstance(comp_subset, xarray.Dataset):
- comp_subset = comp_subset.band_data
- # add transform for test
- comp_subset.rio.write_transform(inplace=True)
- # add grid mapping for test
- comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
- if comp_subset.rio.encoded_nodata is None:
- comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
- geometries = [
- {
- "type": "Polygon",
- "coordinates": [
- [
- [425499.18381405267, 4615331.540546387],
- [425499.18381405267, 4615478.540546387],
- [425526.18381405267, 4615478.540546387],
- [425526.18381405267, 4615331.540546387],
- [425499.18381405267, 4615331.540546387],
- ]
- ],
- }
- ]
- # test data array
- clipped = xdi.rio.clip(geometries, from_disk=from_disk)
- if from_disk and not isinstance(clipped, xarray.Dataset):
- _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
- if comp_subset.rio.encoded_nodata is not None:
- assert numpy.isnan(clipped.values[:, 0, :]).all()
- assert numpy.isnan(clipped.values[:, :, 0]).all()
- else:
- assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
- assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
- else:
- if isinstance(clipped, xarray.Dataset):
- clipped = clipped.band_data
- > _assert_xarrays_equal(clipped, comp_subset)
- test/integration/test_integration_rioxarray.py:580:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/conftest.py:84: in _assert_xarrays_equal
- assert_almost_equal(
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d6b58a0>, array([[[30692., 30696., 30699., 30702., 307... 30621.],
- [30611., 30610., 30610., 30610., 30610., 30611., 30612., 30614.,
- 30616.]]], dtype=float32))
- kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
- @wraps(func)
- def inner(*args, **kwds):
- with self._recreate_cm():
- > return func(*args, **kwds)
- E AssertionError:
- E Arrays are not almost equal to 7 decimals
- E
- E Mismatched elements: 375 / 441 (85%)
- E Max absolute difference: 7.
- E Max relative difference: 0.00022836
- E x: array([[[30692., 30696., 30699., 30702., 30704., 30705., 30705., 30704.,
- E 30703.],
- E [30690., 30694., 30697., 30700., 30703., 30705., 30704., 30704.,...
- E y: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
- E 30701.],
- E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- [30692. 30696. 30699. 30702. 30704. 30705. 30704. 30703. 30690. 30694.
- 30697. 30700. 30703. 30705. 30704. 30703. 30687. 30692. 30695. 30699.
- 30703. 30704. 30703. 30702. 30701. 30682. 30688. 30692. 30696. 30699.
- 30702. 30701. 30700. 30678. 30684. 30689. 30691. 30695. 30698. 30674.
- 30680. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30670. 30675.
- 30678. 30683. 30687. 30690. 30691. 30693. 30692. 30668. 30671. 30675.
- 30679. 30683. 30686. 30688. 30666. 30668. 30672. 30675. 30679. 30684.
- 30685. 30686. 30663. 30666. 30668. 30672. 30676. 30680. 30681. 30682.
- 30683. 30661. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30660.
- 30663. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30659. 30662.
- 30664. 30667. 30672. 30675. 30676. 30677. 30676. 30658. 30660. 30663.
- 30665. 30668. 30671. 30673. 30674. 30673. 30659. 30661. 30663. 30665.
- 30666. 30669. 30672. 30673. 30672. 30659. 30661. 30664. 30665. 30667.
- 30669. 30672. 30673. 30672. 30662. 30663. 30665. 30666. 30668. 30670.
- 30671. 30672. 30665. 30666. 30667. 30669. 30671. 30673. 30672. 30671.
- 30668. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30670. 30671.
- 30672. 30673. 30674. 30673. 30672. 30671. 30673. 30675. 30673. 30672.
- 30672. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30673. 30675.
- 30677. 30675. 30673. 30672. 30670. 30672. 30675. 30676. 30675. 30674.
- 30673. 30672. 30671. 30675. 30676. 30675. 30674. 30673. 30668. 30672.
- 30675. 30676. 30677. 30676. 30675. 30673. 30665. 30670. 30674. 30675.
- 30677. 30676. 30674. 30673. 30662. 30668. 30672. 30675. 30676. 30674.
- 30673. 30658. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30654.
- 30661. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30650. 30657.
- 30662. 30668. 30671. 30672. 30671. 30670. 30647. 30654. 30659. 30665.
- 30668. 30669. 30668. 30645. 30651. 30656. 30662. 30665. 30666. 30667.
- 30643. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30641.
- 30646. 30651. 30655. 30659. 30661. 30662. 30639. 30644. 30648. 30652.
- 30655. 30658. 30636. 30642. 30645. 30648. 30651. 30654. 30655. 30657.
- 30635. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30634. 30638.
- 30640. 30643. 30646. 30648. 30650. 30632. 30635. 30637. 30640. 30643.
- 30645. 30647. 30630. 30632. 30635. 30636. 30639. 30641. 30643. 30644.
- 30628. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30626. 30628.
- 30630. 30632. 30634. 30636. 30638. 30624. 30625. 30627. 30629. 30631.
- 30633. 30634. 30635. 30622. 30623. 30624. 30625. 30627. 30629. 30630.
- 30631. 30620. 30621. 30622. 30623. 30625. 30626. 30627. 30617. 30616.
- 30617. 30618. 30619. 30621. 30623. 30614. 30615. 30617. 30619. 30612.
- 30611. 30610. 30611. 30612. 30614.]
- [30696. 30699. 30702. 30704. 30705. 30704. 30703. 30701. 30694. 30697.
- 30700. 30703. 30705. 30704. 30703. 30700. 30692. 30695. 30699. 30703.
- 30704. 30703. 30702. 30701. 30698. 30688. 30692. 30696. 30699. 30702.
- 30701. 30700. 30697. 30684. 30689. 30691. 30695. 30698. 30694. 30680.
- 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30691. 30675. 30678.
- 30683. 30687. 30690. 30691. 30693. 30692. 30689. 30671. 30675. 30679.
- 30683. 30686. 30688. 30686. 30668. 30672. 30675. 30679. 30684. 30685.
- 30686. 30684. 30666. 30668. 30672. 30676. 30680. 30681. 30682. 30683.
- 30680. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30676. 30663.
- 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30675. 30662. 30664.
- 30667. 30672. 30675. 30676. 30677. 30676. 30674. 30660. 30663. 30665.
- 30668. 30671. 30673. 30674. 30673. 30671. 30661. 30663. 30665. 30666.
- 30669. 30672. 30673. 30672. 30669. 30661. 30664. 30665. 30667. 30669.
- 30672. 30673. 30672. 30670. 30663. 30665. 30666. 30668. 30670. 30671.
- 30672. 30669. 30666. 30667. 30669. 30671. 30673. 30672. 30671. 30668.
- 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30667. 30671. 30672.
- 30673. 30674. 30673. 30672. 30668. 30673. 30675. 30673. 30672. 30668.
- 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30668. 30675. 30677.
- 30675. 30673. 30672. 30670. 30668. 30675. 30676. 30675. 30674. 30673.
- 30672. 30669. 30675. 30676. 30675. 30674. 30673. 30670. 30672. 30675.
- 30676. 30677. 30676. 30675. 30673. 30671. 30670. 30674. 30675. 30677.
- 30676. 30674. 30673. 30671. 30668. 30672. 30675. 30676. 30674. 30673.
- 30671. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30671. 30661.
- 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30671. 30657. 30662.
- 30668. 30671. 30672. 30671. 30670. 30669. 30654. 30659. 30665. 30668.
- 30669. 30668. 30667. 30651. 30656. 30662. 30665. 30666. 30667. 30666.
- 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30663. 30646.
- 30651. 30655. 30659. 30661. 30662. 30661. 30644. 30648. 30652. 30655.
- 30658. 30659. 30642. 30645. 30648. 30651. 30654. 30655. 30657. 30656.
- 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30653. 30638. 30640.
- 30643. 30646. 30648. 30650. 30651. 30635. 30637. 30640. 30643. 30645.
- 30647. 30648. 30632. 30635. 30636. 30639. 30641. 30643. 30644. 30645.
- 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30642. 30628. 30630.
- 30632. 30634. 30636. 30638. 30639. 30625. 30627. 30629. 30631. 30633.
- 30634. 30635. 30636. 30623. 30624. 30625. 30627. 30629. 30630. 30631.
- 30632. 30621. 30622. 30623. 30625. 30626. 30627. 30628. 30616. 30617.
- 30618. 30619. 30621. 30623. 30625. 30615. 30617. 30619. 30621. 30611.
- 30610. 30611. 30612. 30614. 30616.]
- _____________________ test_clip_geojson[open_func3-False] ______________________
- open_func = functools.partial(<function open_dataset at 0xffff5e34bc40>, engine='rasterio')
- from_disk = False
- @pytest.mark.parametrize("from_disk", [True, False])
- @pytest.mark.parametrize(
- "open_func",
- [
- rioxarray.open_rasterio,
- partial(rioxarray.open_rasterio, parse_coordinates=False),
- partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
- open_rasterio_engine,
- partial(open_rasterio_engine, parse_coordinates=False),
- partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
- ],
- )
- def test_clip_geojson(open_func, from_disk):
- with open_func(
- os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
- ) as xdi:
- # get subset for testing
- subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
- comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
- if isinstance(comp_subset, xarray.Dataset):
- comp_subset = comp_subset.band_data
- # add transform for test
- comp_subset.rio.write_transform(inplace=True)
- # add grid mapping for test
- comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
- if comp_subset.rio.encoded_nodata is None:
- comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
- geometries = [
- {
- "type": "Polygon",
- "coordinates": [
- [
- [425499.18381405267, 4615331.540546387],
- [425499.18381405267, 4615478.540546387],
- [425526.18381405267, 4615478.540546387],
- [425526.18381405267, 4615331.540546387],
- [425499.18381405267, 4615331.540546387],
- ]
- ],
- }
- ]
- # test data array
- clipped = xdi.rio.clip(geometries, from_disk=from_disk)
- if from_disk and not isinstance(clipped, xarray.Dataset):
- _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
- if comp_subset.rio.encoded_nodata is not None:
- assert numpy.isnan(clipped.values[:, 0, :]).all()
- assert numpy.isnan(clipped.values[:, :, 0]).all()
- else:
- assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
- assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
- else:
- if isinstance(clipped, xarray.Dataset):
- clipped = clipped.band_data
- > _assert_xarrays_equal(clipped, comp_subset)
- test/integration/test_integration_rioxarray.py:580:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/conftest.py:84: in _assert_xarrays_equal
- assert_almost_equal(
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d6b7560>, array([[[30692., 30696., 30699., 30702., 307... 30621.],
- [30611., 30610., 30610., 30610., 30610., 30611., 30612., 30614.,
- 30616.]]], dtype=float32))
- kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
- @wraps(func)
- def inner(*args, **kwds):
- with self._recreate_cm():
- > return func(*args, **kwds)
- E AssertionError:
- E Arrays are not almost equal to 7 decimals
- E
- E Mismatched elements: 375 / 441 (85%)
- E Max absolute difference: 7.
- E Max relative difference: 0.00022836
- E x: array([[[30692., 30696., 30699., 30702., 30704., 30705., 30705., 30704.,
- E 30703.],
- E [30690., 30694., 30697., 30700., 30703., 30705., 30704., 30704.,...
- E y: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
- E 30701.],
- E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- [30692. 30696. 30699. 30702. 30704. 30705. 30704. 30703. 30690. 30694.
- 30697. 30700. 30703. 30705. 30704. 30703. 30687. 30692. 30695. 30699.
- 30703. 30704. 30703. 30702. 30701. 30682. 30688. 30692. 30696. 30699.
- 30702. 30701. 30700. 30678. 30684. 30689. 30691. 30695. 30698. 30674.
- 30680. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30670. 30675.
- 30678. 30683. 30687. 30690. 30691. 30693. 30692. 30668. 30671. 30675.
- 30679. 30683. 30686. 30688. 30666. 30668. 30672. 30675. 30679. 30684.
- 30685. 30686. 30663. 30666. 30668. 30672. 30676. 30680. 30681. 30682.
- 30683. 30661. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30660.
- 30663. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30659. 30662.
- 30664. 30667. 30672. 30675. 30676. 30677. 30676. 30658. 30660. 30663.
- 30665. 30668. 30671. 30673. 30674. 30673. 30659. 30661. 30663. 30665.
- 30666. 30669. 30672. 30673. 30672. 30659. 30661. 30664. 30665. 30667.
- 30669. 30672. 30673. 30672. 30662. 30663. 30665. 30666. 30668. 30670.
- 30671. 30672. 30665. 30666. 30667. 30669. 30671. 30673. 30672. 30671.
- 30668. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30670. 30671.
- 30672. 30673. 30674. 30673. 30672. 30671. 30673. 30675. 30673. 30672.
- 30672. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30673. 30675.
- 30677. 30675. 30673. 30672. 30670. 30672. 30675. 30676. 30675. 30674.
- 30673. 30672. 30671. 30675. 30676. 30675. 30674. 30673. 30668. 30672.
- 30675. 30676. 30677. 30676. 30675. 30673. 30665. 30670. 30674. 30675.
- 30677. 30676. 30674. 30673. 30662. 30668. 30672. 30675. 30676. 30674.
- 30673. 30658. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30654.
- 30661. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30650. 30657.
- 30662. 30668. 30671. 30672. 30671. 30670. 30647. 30654. 30659. 30665.
- 30668. 30669. 30668. 30645. 30651. 30656. 30662. 30665. 30666. 30667.
- 30643. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30641.
- 30646. 30651. 30655. 30659. 30661. 30662. 30639. 30644. 30648. 30652.
- 30655. 30658. 30636. 30642. 30645. 30648. 30651. 30654. 30655. 30657.
- 30635. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30634. 30638.
- 30640. 30643. 30646. 30648. 30650. 30632. 30635. 30637. 30640. 30643.
- 30645. 30647. 30630. 30632. 30635. 30636. 30639. 30641. 30643. 30644.
- 30628. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30626. 30628.
- 30630. 30632. 30634. 30636. 30638. 30624. 30625. 30627. 30629. 30631.
- 30633. 30634. 30635. 30622. 30623. 30624. 30625. 30627. 30629. 30630.
- 30631. 30620. 30621. 30622. 30623. 30625. 30626. 30627. 30617. 30616.
- 30617. 30618. 30619. 30621. 30623. 30614. 30615. 30617. 30619. 30612.
- 30611. 30610. 30611. 30612. 30614.]
- [30696. 30699. 30702. 30704. 30705. 30704. 30703. 30701. 30694. 30697.
- 30700. 30703. 30705. 30704. 30703. 30700. 30692. 30695. 30699. 30703.
- 30704. 30703. 30702. 30701. 30698. 30688. 30692. 30696. 30699. 30702.
- 30701. 30700. 30697. 30684. 30689. 30691. 30695. 30698. 30694. 30680.
- 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30691. 30675. 30678.
- 30683. 30687. 30690. 30691. 30693. 30692. 30689. 30671. 30675. 30679.
- 30683. 30686. 30688. 30686. 30668. 30672. 30675. 30679. 30684. 30685.
- 30686. 30684. 30666. 30668. 30672. 30676. 30680. 30681. 30682. 30683.
- 30680. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30676. 30663.
- 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30675. 30662. 30664.
- 30667. 30672. 30675. 30676. 30677. 30676. 30674. 30660. 30663. 30665.
- 30668. 30671. 30673. 30674. 30673. 30671. 30661. 30663. 30665. 30666.
- 30669. 30672. 30673. 30672. 30669. 30661. 30664. 30665. 30667. 30669.
- 30672. 30673. 30672. 30670. 30663. 30665. 30666. 30668. 30670. 30671.
- 30672. 30669. 30666. 30667. 30669. 30671. 30673. 30672. 30671. 30668.
- 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30667. 30671. 30672.
- 30673. 30674. 30673. 30672. 30668. 30673. 30675. 30673. 30672. 30668.
- 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30668. 30675. 30677.
- 30675. 30673. 30672. 30670. 30668. 30675. 30676. 30675. 30674. 30673.
- 30672. 30669. 30675. 30676. 30675. 30674. 30673. 30670. 30672. 30675.
- 30676. 30677. 30676. 30675. 30673. 30671. 30670. 30674. 30675. 30677.
- 30676. 30674. 30673. 30671. 30668. 30672. 30675. 30676. 30674. 30673.
- 30671. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30671. 30661.
- 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30671. 30657. 30662.
- 30668. 30671. 30672. 30671. 30670. 30669. 30654. 30659. 30665. 30668.
- 30669. 30668. 30667. 30651. 30656. 30662. 30665. 30666. 30667. 30666.
- 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30663. 30646.
- 30651. 30655. 30659. 30661. 30662. 30661. 30644. 30648. 30652. 30655.
- 30658. 30659. 30642. 30645. 30648. 30651. 30654. 30655. 30657. 30656.
- 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30653. 30638. 30640.
- 30643. 30646. 30648. 30650. 30651. 30635. 30637. 30640. 30643. 30645.
- 30647. 30648. 30632. 30635. 30636. 30639. 30641. 30643. 30644. 30645.
- 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30642. 30628. 30630.
- 30632. 30634. 30636. 30638. 30639. 30625. 30627. 30629. 30631. 30633.
- 30634. 30635. 30636. 30623. 30624. 30625. 30627. 30629. 30630. 30631.
- 30632. 30621. 30622. 30623. 30625. 30626. 30627. 30628. 30616. 30617.
- 30618. 30619. 30621. 30623. 30625. 30615. 30617. 30619. 30621. 30611.
- 30610. 30611. 30612. 30614. 30616.]
- ______________________ test_clip_geojson[open_func4-True] ______________________
- open_func = functools.partial(<function open_dataset at 0xffff5e34bc40>, engine='rasterio', parse_coordinates=False)
- from_disk = True
- @pytest.mark.parametrize("from_disk", [True, False])
- @pytest.mark.parametrize(
- "open_func",
- [
- rioxarray.open_rasterio,
- partial(rioxarray.open_rasterio, parse_coordinates=False),
- partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
- open_rasterio_engine,
- partial(open_rasterio_engine, parse_coordinates=False),
- partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
- ],
- )
- def test_clip_geojson(open_func, from_disk):
- with open_func(
- os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
- ) as xdi:
- # get subset for testing
- subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
- comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
- if isinstance(comp_subset, xarray.Dataset):
- comp_subset = comp_subset.band_data
- # add transform for test
- comp_subset.rio.write_transform(inplace=True)
- # add grid mapping for test
- comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
- if comp_subset.rio.encoded_nodata is None:
- comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
- geometries = [
- {
- "type": "Polygon",
- "coordinates": [
- [
- [425499.18381405267, 4615331.540546387],
- [425499.18381405267, 4615478.540546387],
- [425526.18381405267, 4615478.540546387],
- [425526.18381405267, 4615331.540546387],
- [425499.18381405267, 4615331.540546387],
- ]
- ],
- }
- ]
- # test data array
- clipped = xdi.rio.clip(geometries, from_disk=from_disk)
- if from_disk and not isinstance(clipped, xarray.Dataset):
- _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
- if comp_subset.rio.encoded_nodata is not None:
- assert numpy.isnan(clipped.values[:, 0, :]).all()
- assert numpy.isnan(clipped.values[:, :, 0]).all()
- else:
- assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
- assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
- else:
- if isinstance(clipped, xarray.Dataset):
- clipped = clipped.band_data
- > _assert_xarrays_equal(clipped, comp_subset)
- test/integration/test_integration_rioxarray.py:580:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/conftest.py:84: in _assert_xarrays_equal
- assert_almost_equal(
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d691120>, array([[[30692., 30696., 30699., 30702., 307... 30621.],
- [30611., 30610., 30610., 30610., 30610., 30611., 30612., 30614.,
- 30616.]]], dtype=float32))
- kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
- @wraps(func)
- def inner(*args, **kwds):
- with self._recreate_cm():
- > return func(*args, **kwds)
- E AssertionError:
- E Arrays are not almost equal to 7 decimals
- E
- E Mismatched elements: 375 / 441 (85%)
- E Max absolute difference: 7.
- E Max relative difference: 0.00022836
- E x: array([[[30692., 30696., 30699., 30702., 30704., 30705., 30705., 30704.,
- E 30703.],
- E [30690., 30694., 30697., 30700., 30703., 30705., 30704., 30704.,...
- E y: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
- E 30701.],
- E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- [30692. 30696. 30699. 30702. 30704. 30705. 30704. 30703. 30690. 30694.
- 30697. 30700. 30703. 30705. 30704. 30703. 30687. 30692. 30695. 30699.
- 30703. 30704. 30703. 30702. 30701. 30682. 30688. 30692. 30696. 30699.
- 30702. 30701. 30700. 30678. 30684. 30689. 30691. 30695. 30698. 30674.
- 30680. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30670. 30675.
- 30678. 30683. 30687. 30690. 30691. 30693. 30692. 30668. 30671. 30675.
- 30679. 30683. 30686. 30688. 30666. 30668. 30672. 30675. 30679. 30684.
- 30685. 30686. 30663. 30666. 30668. 30672. 30676. 30680. 30681. 30682.
- 30683. 30661. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30660.
- 30663. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30659. 30662.
- 30664. 30667. 30672. 30675. 30676. 30677. 30676. 30658. 30660. 30663.
- 30665. 30668. 30671. 30673. 30674. 30673. 30659. 30661. 30663. 30665.
- 30666. 30669. 30672. 30673. 30672. 30659. 30661. 30664. 30665. 30667.
- 30669. 30672. 30673. 30672. 30662. 30663. 30665. 30666. 30668. 30670.
- 30671. 30672. 30665. 30666. 30667. 30669. 30671. 30673. 30672. 30671.
- 30668. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30670. 30671.
- 30672. 30673. 30674. 30673. 30672. 30671. 30673. 30675. 30673. 30672.
- 30672. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30673. 30675.
- 30677. 30675. 30673. 30672. 30670. 30672. 30675. 30676. 30675. 30674.
- 30673. 30672. 30671. 30675. 30676. 30675. 30674. 30673. 30668. 30672.
- 30675. 30676. 30677. 30676. 30675. 30673. 30665. 30670. 30674. 30675.
- 30677. 30676. 30674. 30673. 30662. 30668. 30672. 30675. 30676. 30674.
- 30673. 30658. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30654.
- 30661. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30650. 30657.
- 30662. 30668. 30671. 30672. 30671. 30670. 30647. 30654. 30659. 30665.
- 30668. 30669. 30668. 30645. 30651. 30656. 30662. 30665. 30666. 30667.
- 30643. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30641.
- 30646. 30651. 30655. 30659. 30661. 30662. 30639. 30644. 30648. 30652.
- 30655. 30658. 30636. 30642. 30645. 30648. 30651. 30654. 30655. 30657.
- 30635. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30634. 30638.
- 30640. 30643. 30646. 30648. 30650. 30632. 30635. 30637. 30640. 30643.
- 30645. 30647. 30630. 30632. 30635. 30636. 30639. 30641. 30643. 30644.
- 30628. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30626. 30628.
- 30630. 30632. 30634. 30636. 30638. 30624. 30625. 30627. 30629. 30631.
- 30633. 30634. 30635. 30622. 30623. 30624. 30625. 30627. 30629. 30630.
- 30631. 30620. 30621. 30622. 30623. 30625. 30626. 30627. 30617. 30616.
- 30617. 30618. 30619. 30621. 30623. 30614. 30615. 30617. 30619. 30612.
- 30611. 30610. 30611. 30612. 30614.]
- [30696. 30699. 30702. 30704. 30705. 30704. 30703. 30701. 30694. 30697.
- 30700. 30703. 30705. 30704. 30703. 30700. 30692. 30695. 30699. 30703.
- 30704. 30703. 30702. 30701. 30698. 30688. 30692. 30696. 30699. 30702.
- 30701. 30700. 30697. 30684. 30689. 30691. 30695. 30698. 30694. 30680.
- 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30691. 30675. 30678.
- 30683. 30687. 30690. 30691. 30693. 30692. 30689. 30671. 30675. 30679.
- 30683. 30686. 30688. 30686. 30668. 30672. 30675. 30679. 30684. 30685.
- 30686. 30684. 30666. 30668. 30672. 30676. 30680. 30681. 30682. 30683.
- 30680. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30676. 30663.
- 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30675. 30662. 30664.
- 30667. 30672. 30675. 30676. 30677. 30676. 30674. 30660. 30663. 30665.
- 30668. 30671. 30673. 30674. 30673. 30671. 30661. 30663. 30665. 30666.
- 30669. 30672. 30673. 30672. 30669. 30661. 30664. 30665. 30667. 30669.
- 30672. 30673. 30672. 30670. 30663. 30665. 30666. 30668. 30670. 30671.
- 30672. 30669. 30666. 30667. 30669. 30671. 30673. 30672. 30671. 30668.
- 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30667. 30671. 30672.
- 30673. 30674. 30673. 30672. 30668. 30673. 30675. 30673. 30672. 30668.
- 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30668. 30675. 30677.
- 30675. 30673. 30672. 30670. 30668. 30675. 30676. 30675. 30674. 30673.
- 30672. 30669. 30675. 30676. 30675. 30674. 30673. 30670. 30672. 30675.
- 30676. 30677. 30676. 30675. 30673. 30671. 30670. 30674. 30675. 30677.
- 30676. 30674. 30673. 30671. 30668. 30672. 30675. 30676. 30674. 30673.
- 30671. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30671. 30661.
- 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30671. 30657. 30662.
- 30668. 30671. 30672. 30671. 30670. 30669. 30654. 30659. 30665. 30668.
- 30669. 30668. 30667. 30651. 30656. 30662. 30665. 30666. 30667. 30666.
- 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30663. 30646.
- 30651. 30655. 30659. 30661. 30662. 30661. 30644. 30648. 30652. 30655.
- 30658. 30659. 30642. 30645. 30648. 30651. 30654. 30655. 30657. 30656.
- 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30653. 30638. 30640.
- 30643. 30646. 30648. 30650. 30651. 30635. 30637. 30640. 30643. 30645.
- 30647. 30648. 30632. 30635. 30636. 30639. 30641. 30643. 30644. 30645.
- 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30642. 30628. 30630.
- 30632. 30634. 30636. 30638. 30639. 30625. 30627. 30629. 30631. 30633.
- 30634. 30635. 30636. 30623. 30624. 30625. 30627. 30629. 30630. 30631.
- 30632. 30621. 30622. 30623. 30625. 30626. 30627. 30628. 30616. 30617.
- 30618. 30619. 30621. 30623. 30625. 30615. 30617. 30619. 30621. 30611.
- 30610. 30611. 30612. 30614. 30616.]
- _____________________ test_clip_geojson[open_func4-False] ______________________
- open_func = functools.partial(<function open_dataset at 0xffff5e34bc40>, engine='rasterio', parse_coordinates=False)
- from_disk = False
- @pytest.mark.parametrize("from_disk", [True, False])
- @pytest.mark.parametrize(
- "open_func",
- [
- rioxarray.open_rasterio,
- partial(rioxarray.open_rasterio, parse_coordinates=False),
- partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
- open_rasterio_engine,
- partial(open_rasterio_engine, parse_coordinates=False),
- partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
- ],
- )
- def test_clip_geojson(open_func, from_disk):
- with open_func(
- os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
- ) as xdi:
- # get subset for testing
- subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
- comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
- if isinstance(comp_subset, xarray.Dataset):
- comp_subset = comp_subset.band_data
- # add transform for test
- comp_subset.rio.write_transform(inplace=True)
- # add grid mapping for test
- comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
- if comp_subset.rio.encoded_nodata is None:
- comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
- geometries = [
- {
- "type": "Polygon",
- "coordinates": [
- [
- [425499.18381405267, 4615331.540546387],
- [425499.18381405267, 4615478.540546387],
- [425526.18381405267, 4615478.540546387],
- [425526.18381405267, 4615331.540546387],
- [425499.18381405267, 4615331.540546387],
- ]
- ],
- }
- ]
- # test data array
- clipped = xdi.rio.clip(geometries, from_disk=from_disk)
- if from_disk and not isinstance(clipped, xarray.Dataset):
- _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
- if comp_subset.rio.encoded_nodata is not None:
- assert numpy.isnan(clipped.values[:, 0, :]).all()
- assert numpy.isnan(clipped.values[:, :, 0]).all()
- else:
- assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
- assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
- else:
- if isinstance(clipped, xarray.Dataset):
- clipped = clipped.band_data
- > _assert_xarrays_equal(clipped, comp_subset)
- test/integration/test_integration_rioxarray.py:580:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/conftest.py:84: in _assert_xarrays_equal
- assert_almost_equal(
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d692020>, array([[[30692., 30696., 30699., 30702., 307... 30621.],
- [30611., 30610., 30610., 30610., 30610., 30611., 30612., 30614.,
- 30616.]]], dtype=float32))
- kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
- @wraps(func)
- def inner(*args, **kwds):
- with self._recreate_cm():
- > return func(*args, **kwds)
- E AssertionError:
- E Arrays are not almost equal to 7 decimals
- E
- E Mismatched elements: 375 / 441 (85%)
- E Max absolute difference: 7.
- E Max relative difference: 0.00022836
- E x: array([[[30692., 30696., 30699., 30702., 30704., 30705., 30705., 30704.,
- E 30703.],
- E [30690., 30694., 30697., 30700., 30703., 30705., 30704., 30704.,...
- E y: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
- E 30701.],
- E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- [30692. 30696. 30699. 30702. 30704. 30705. 30704. 30703. 30690. 30694.
- 30697. 30700. 30703. 30705. 30704. 30703. 30687. 30692. 30695. 30699.
- 30703. 30704. 30703. 30702. 30701. 30682. 30688. 30692. 30696. 30699.
- 30702. 30701. 30700. 30678. 30684. 30689. 30691. 30695. 30698. 30674.
- 30680. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30670. 30675.
- 30678. 30683. 30687. 30690. 30691. 30693. 30692. 30668. 30671. 30675.
- 30679. 30683. 30686. 30688. 30666. 30668. 30672. 30675. 30679. 30684.
- 30685. 30686. 30663. 30666. 30668. 30672. 30676. 30680. 30681. 30682.
- 30683. 30661. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30660.
- 30663. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30659. 30662.
- 30664. 30667. 30672. 30675. 30676. 30677. 30676. 30658. 30660. 30663.
- 30665. 30668. 30671. 30673. 30674. 30673. 30659. 30661. 30663. 30665.
- 30666. 30669. 30672. 30673. 30672. 30659. 30661. 30664. 30665. 30667.
- 30669. 30672. 30673. 30672. 30662. 30663. 30665. 30666. 30668. 30670.
- 30671. 30672. 30665. 30666. 30667. 30669. 30671. 30673. 30672. 30671.
- 30668. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30670. 30671.
- 30672. 30673. 30674. 30673. 30672. 30671. 30673. 30675. 30673. 30672.
- 30672. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30673. 30675.
- 30677. 30675. 30673. 30672. 30670. 30672. 30675. 30676. 30675. 30674.
- 30673. 30672. 30671. 30675. 30676. 30675. 30674. 30673. 30668. 30672.
- 30675. 30676. 30677. 30676. 30675. 30673. 30665. 30670. 30674. 30675.
- 30677. 30676. 30674. 30673. 30662. 30668. 30672. 30675. 30676. 30674.
- 30673. 30658. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30654.
- 30661. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30650. 30657.
- 30662. 30668. 30671. 30672. 30671. 30670. 30647. 30654. 30659. 30665.
- 30668. 30669. 30668. 30645. 30651. 30656. 30662. 30665. 30666. 30667.
- 30643. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30641.
- 30646. 30651. 30655. 30659. 30661. 30662. 30639. 30644. 30648. 30652.
- 30655. 30658. 30636. 30642. 30645. 30648. 30651. 30654. 30655. 30657.
- 30635. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30634. 30638.
- 30640. 30643. 30646. 30648. 30650. 30632. 30635. 30637. 30640. 30643.
- 30645. 30647. 30630. 30632. 30635. 30636. 30639. 30641. 30643. 30644.
- 30628. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30626. 30628.
- 30630. 30632. 30634. 30636. 30638. 30624. 30625. 30627. 30629. 30631.
- 30633. 30634. 30635. 30622. 30623. 30624. 30625. 30627. 30629. 30630.
- 30631. 30620. 30621. 30622. 30623. 30625. 30626. 30627. 30617. 30616.
- 30617. 30618. 30619. 30621. 30623. 30614. 30615. 30617. 30619. 30612.
- 30611. 30610. 30611. 30612. 30614.]
- [30696. 30699. 30702. 30704. 30705. 30704. 30703. 30701. 30694. 30697.
- 30700. 30703. 30705. 30704. 30703. 30700. 30692. 30695. 30699. 30703.
- 30704. 30703. 30702. 30701. 30698. 30688. 30692. 30696. 30699. 30702.
- 30701. 30700. 30697. 30684. 30689. 30691. 30695. 30698. 30694. 30680.
- 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30691. 30675. 30678.
- 30683. 30687. 30690. 30691. 30693. 30692. 30689. 30671. 30675. 30679.
- 30683. 30686. 30688. 30686. 30668. 30672. 30675. 30679. 30684. 30685.
- 30686. 30684. 30666. 30668. 30672. 30676. 30680. 30681. 30682. 30683.
- 30680. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30676. 30663.
- 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30675. 30662. 30664.
- 30667. 30672. 30675. 30676. 30677. 30676. 30674. 30660. 30663. 30665.
- 30668. 30671. 30673. 30674. 30673. 30671. 30661. 30663. 30665. 30666.
- 30669. 30672. 30673. 30672. 30669. 30661. 30664. 30665. 30667. 30669.
- 30672. 30673. 30672. 30670. 30663. 30665. 30666. 30668. 30670. 30671.
- 30672. 30669. 30666. 30667. 30669. 30671. 30673. 30672. 30671. 30668.
- 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30667. 30671. 30672.
- 30673. 30674. 30673. 30672. 30668. 30673. 30675. 30673. 30672. 30668.
- 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30668. 30675. 30677.
- 30675. 30673. 30672. 30670. 30668. 30675. 30676. 30675. 30674. 30673.
- 30672. 30669. 30675. 30676. 30675. 30674. 30673. 30670. 30672. 30675.
- 30676. 30677. 30676. 30675. 30673. 30671. 30670. 30674. 30675. 30677.
- 30676. 30674. 30673. 30671. 30668. 30672. 30675. 30676. 30674. 30673.
- 30671. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30671. 30661.
- 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30671. 30657. 30662.
- 30668. 30671. 30672. 30671. 30670. 30669. 30654. 30659. 30665. 30668.
- 30669. 30668. 30667. 30651. 30656. 30662. 30665. 30666. 30667. 30666.
- 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30663. 30646.
- 30651. 30655. 30659. 30661. 30662. 30661. 30644. 30648. 30652. 30655.
- 30658. 30659. 30642. 30645. 30648. 30651. 30654. 30655. 30657. 30656.
- 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30653. 30638. 30640.
- 30643. 30646. 30648. 30650. 30651. 30635. 30637. 30640. 30643. 30645.
- 30647. 30648. 30632. 30635. 30636. 30639. 30641. 30643. 30644. 30645.
- 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30642. 30628. 30630.
- 30632. 30634. 30636. 30638. 30639. 30625. 30627. 30629. 30631. 30633.
- 30634. 30635. 30636. 30623. 30624. 30625. 30627. 30629. 30630. 30631.
- 30632. 30621. 30622. 30623. 30625. 30626. 30627. 30628. 30616. 30617.
- 30618. 30619. 30621. 30623. 30625. 30615. 30617. 30619. 30621. 30611.
- 30610. 30611. 30612. 30614. 30616.]
- ______________________ test_clip_geojson[open_func5-True] ______________________
- open_func = functools.partial(<function open_dataset at 0xffff5e34bc40>, engine='rasterio', parse_coordinates=False, mask_and_scale=False)
- from_disk = True
- @pytest.mark.parametrize("from_disk", [True, False])
- @pytest.mark.parametrize(
- "open_func",
- [
- rioxarray.open_rasterio,
- partial(rioxarray.open_rasterio, parse_coordinates=False),
- partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
- open_rasterio_engine,
- partial(open_rasterio_engine, parse_coordinates=False),
- partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
- ],
- )
- def test_clip_geojson(open_func, from_disk):
- with open_func(
- os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
- ) as xdi:
- # get subset for testing
- subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
- comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
- if isinstance(comp_subset, xarray.Dataset):
- comp_subset = comp_subset.band_data
- # add transform for test
- comp_subset.rio.write_transform(inplace=True)
- # add grid mapping for test
- comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
- if comp_subset.rio.encoded_nodata is None:
- comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
- geometries = [
- {
- "type": "Polygon",
- "coordinates": [
- [
- [425499.18381405267, 4615331.540546387],
- [425499.18381405267, 4615478.540546387],
- [425526.18381405267, 4615478.540546387],
- [425526.18381405267, 4615331.540546387],
- [425499.18381405267, 4615331.540546387],
- ]
- ],
- }
- ]
- # test data array
- clipped = xdi.rio.clip(geometries, from_disk=from_disk)
- if from_disk and not isinstance(clipped, xarray.Dataset):
- _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
- if comp_subset.rio.encoded_nodata is not None:
- assert numpy.isnan(clipped.values[:, 0, :]).all()
- assert numpy.isnan(clipped.values[:, :, 0]).all()
- else:
- assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
- assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
- else:
- if isinstance(clipped, xarray.Dataset):
- clipped = clipped.band_data
- > _assert_xarrays_equal(clipped, comp_subset)
- test/integration/test_integration_rioxarray.py:580:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/conftest.py:84: in _assert_xarrays_equal
- assert_almost_equal(
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d6b4220>, array([[[30692, 30696, 30699, 30702, 30704, ..., 30617, 30619, 30621],
- [30611, 30610, 30610, 30610, 30610, 30611, 30612, 30614, 30616]]],
- dtype=uint16))
- kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
- @wraps(func)
- def inner(*args, **kwds):
- with self._recreate_cm():
- > return func(*args, **kwds)
- E AssertionError:
- E Arrays are not almost equal to 7 decimals
- E
- E Mismatched elements: 375 / 441 (85%)
- E Max absolute difference: 7
- E Max relative difference: 0.00022836
- E x: array([[[30692, 30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703],
- E [30690, 30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703],
- E [30687, 30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701],...
- E y: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 30701],
- E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 30700],
- E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 30698],...
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- [30692 30696 30699 30702 30704 30705 30704 30703 30690 30694 30697 30700
- 30703 30705 30704 30703 30687 30692 30695 30699 30703 30704 30703 30702
- 30701 30682 30688 30692 30696 30699 30702 30701 30700 30678 30684 30689
- 30691 30695 30698 30674 30680 30683 30686 30691 30694 30695 30696 30695
- 30670 30675 30678 30683 30687 30690 30691 30693 30692 30668 30671 30675
- 30679 30683 30686 30688 30666 30668 30672 30675 30679 30684 30685 30686
- 30663 30666 30668 30672 30676 30680 30681 30682 30683 30661 30663 30666
- 30670 30674 30676 30678 30680 30660 30663 30665 30670 30674 30675 30677
- 30679 30678 30659 30662 30664 30667 30672 30675 30676 30677 30676 30658
- 30660 30663 30665 30668 30671 30673 30674 30673 30659 30661 30663 30665
- 30666 30669 30672 30673 30672 30659 30661 30664 30665 30667 30669 30672
- 30673 30672 30662 30663 30665 30666 30668 30670 30671 30672 30665 30666
- 30667 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674
- 30673 30671 30670 30671 30672 30673 30674 30673 30672 30671 30673 30675
- 30673 30672 30672 30674 30676 30677 30674 30673 30672 30671 30673 30675
- 30677 30675 30673 30672 30670 30672 30675 30676 30675 30674 30673 30672
- 30671 30675 30676 30675 30674 30673 30668 30672 30675 30676 30677 30676
- 30675 30673 30665 30670 30674 30675 30677 30676 30674 30673 30662 30668
- 30672 30675 30676 30674 30673 30658 30665 30669 30673 30674 30675 30674
- 30672 30654 30661 30666 30671 30672 30673 30674 30673 30672 30650 30657
- 30662 30668 30671 30672 30671 30670 30647 30654 30659 30665 30668 30669
- 30668 30645 30651 30656 30662 30665 30666 30667 30643 30649 30654 30659
- 30662 30663 30664 30666 30665 30641 30646 30651 30655 30659 30661 30662
- 30639 30644 30648 30652 30655 30658 30636 30642 30645 30648 30651 30654
- 30655 30657 30635 30640 30642 30646 30649 30650 30652 30654 30634 30638
- 30640 30643 30646 30648 30650 30632 30635 30637 30640 30643 30645 30647
- 30630 30632 30635 30636 30639 30641 30643 30644 30628 30630 30633 30634
- 30635 30637 30639 30641 30626 30628 30630 30632 30634 30636 30638 30624
- 30625 30627 30629 30631 30633 30634 30635 30622 30623 30624 30625 30627
- 30629 30630 30631 30620 30621 30622 30623 30625 30626 30627 30617 30616
- 30617 30618 30619 30621 30623 30614 30615 30617 30619 30612 30611 30610
- 30611 30612 30614]
- [30696 30699 30702 30704 30705 30704 30703 30701 30694 30697 30700 30703
- 30705 30704 30703 30700 30692 30695 30699 30703 30704 30703 30702 30701
- 30698 30688 30692 30696 30699 30702 30701 30700 30697 30684 30689 30691
- 30695 30698 30694 30680 30683 30686 30691 30694 30695 30696 30695 30691
- 30675 30678 30683 30687 30690 30691 30693 30692 30689 30671 30675 30679
- 30683 30686 30688 30686 30668 30672 30675 30679 30684 30685 30686 30684
- 30666 30668 30672 30676 30680 30681 30682 30683 30680 30663 30666 30670
- 30674 30676 30678 30680 30676 30663 30665 30670 30674 30675 30677 30679
- 30678 30675 30662 30664 30667 30672 30675 30676 30677 30676 30674 30660
- 30663 30665 30668 30671 30673 30674 30673 30671 30661 30663 30665 30666
- 30669 30672 30673 30672 30669 30661 30664 30665 30667 30669 30672 30673
- 30672 30670 30663 30665 30666 30668 30670 30671 30672 30669 30666 30667
- 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674 30673
- 30671 30667 30671 30672 30673 30674 30673 30672 30668 30673 30675 30673
- 30672 30668 30674 30676 30677 30674 30673 30672 30671 30668 30675 30677
- 30675 30673 30672 30670 30668 30675 30676 30675 30674 30673 30672 30669
- 30675 30676 30675 30674 30673 30670 30672 30675 30676 30677 30676 30675
- 30673 30671 30670 30674 30675 30677 30676 30674 30673 30671 30668 30672
- 30675 30676 30674 30673 30671 30665 30669 30673 30674 30675 30674 30672
- 30671 30661 30666 30671 30672 30673 30674 30673 30672 30671 30657 30662
- 30668 30671 30672 30671 30670 30669 30654 30659 30665 30668 30669 30668
- 30667 30651 30656 30662 30665 30666 30667 30666 30649 30654 30659 30662
- 30663 30664 30666 30665 30663 30646 30651 30655 30659 30661 30662 30661
- 30644 30648 30652 30655 30658 30659 30642 30645 30648 30651 30654 30655
- 30657 30656 30640 30642 30646 30649 30650 30652 30654 30653 30638 30640
- 30643 30646 30648 30650 30651 30635 30637 30640 30643 30645 30647 30648
- 30632 30635 30636 30639 30641 30643 30644 30645 30630 30633 30634 30635
- 30637 30639 30641 30642 30628 30630 30632 30634 30636 30638 30639 30625
- 30627 30629 30631 30633 30634 30635 30636 30623 30624 30625 30627 30629
- 30630 30631 30632 30621 30622 30623 30625 30626 30627 30628 30616 30617
- 30618 30619 30621 30623 30625 30615 30617 30619 30621 30611 30610 30611
- 30612 30614 30616]
- _____________________ test_clip_geojson[open_func5-False] ______________________
- open_func = functools.partial(<function open_dataset at 0xffff5e34bc40>, engine='rasterio', parse_coordinates=False, mask_and_scale=False)
- from_disk = False
- @pytest.mark.parametrize("from_disk", [True, False])
- @pytest.mark.parametrize(
- "open_func",
- [
- rioxarray.open_rasterio,
- partial(rioxarray.open_rasterio, parse_coordinates=False),
- partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
- open_rasterio_engine,
- partial(open_rasterio_engine, parse_coordinates=False),
- partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
- ],
- )
- def test_clip_geojson(open_func, from_disk):
- with open_func(
- os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
- ) as xdi:
- # get subset for testing
- subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
- comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
- if isinstance(comp_subset, xarray.Dataset):
- comp_subset = comp_subset.band_data
- # add transform for test
- comp_subset.rio.write_transform(inplace=True)
- # add grid mapping for test
- comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
- if comp_subset.rio.encoded_nodata is None:
- comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
- geometries = [
- {
- "type": "Polygon",
- "coordinates": [
- [
- [425499.18381405267, 4615331.540546387],
- [425499.18381405267, 4615478.540546387],
- [425526.18381405267, 4615478.540546387],
- [425526.18381405267, 4615331.540546387],
- [425499.18381405267, 4615331.540546387],
- ]
- ],
- }
- ]
- # test data array
- clipped = xdi.rio.clip(geometries, from_disk=from_disk)
- if from_disk and not isinstance(clipped, xarray.Dataset):
- _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
- if comp_subset.rio.encoded_nodata is not None:
- assert numpy.isnan(clipped.values[:, 0, :]).all()
- assert numpy.isnan(clipped.values[:, :, 0]).all()
- else:
- assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
- assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
- else:
- if isinstance(clipped, xarray.Dataset):
- clipped = clipped.band_data
- > _assert_xarrays_equal(clipped, comp_subset)
- test/integration/test_integration_rioxarray.py:580:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- test/conftest.py:84: in _assert_xarrays_equal
- assert_almost_equal(
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
- return func(*args, **kwds)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d691300>, array([[[30692, 30696, 30699, 30702, 30704, ..., 30617, 30619, 30621],
- [30611, 30610, 30610, 30610, 30610, 30611, 30612, 30614, 30616]]],
- dtype=uint16))
- kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
- @wraps(func)
- def inner(*args, **kwds):
- with self._recreate_cm():
- > return func(*args, **kwds)
- E AssertionError:
- E Arrays are not almost equal to 7 decimals
- E
- E Mismatched elements: 375 / 441 (85%)
- E Max absolute difference: 7
- E Max relative difference: 0.00022836
- E x: array([[[30692, 30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703],
- E [30690, 30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703],
- E [30687, 30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701],...
- E y: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 30701],
- E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 30700],
- E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 30698],...
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- [30692 30696 30699 30702 30704 30705 30704 30703 30690 30694 30697 30700
- 30703 30705 30704 30703 30687 30692 30695 30699 30703 30704 30703 30702
- 30701 30682 30688 30692 30696 30699 30702 30701 30700 30678 30684 30689
- 30691 30695 30698 30674 30680 30683 30686 30691 30694 30695 30696 30695
- 30670 30675 30678 30683 30687 30690 30691 30693 30692 30668 30671 30675
- 30679 30683 30686 30688 30666 30668 30672 30675 30679 30684 30685 30686
- 30663 30666 30668 30672 30676 30680 30681 30682 30683 30661 30663 30666
- 30670 30674 30676 30678 30680 30660 30663 30665 30670 30674 30675 30677
- 30679 30678 30659 30662 30664 30667 30672 30675 30676 30677 30676 30658
- 30660 30663 30665 30668 30671 30673 30674 30673 30659 30661 30663 30665
- 30666 30669 30672 30673 30672 30659 30661 30664 30665 30667 30669 30672
- 30673 30672 30662 30663 30665 30666 30668 30670 30671 30672 30665 30666
- 30667 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674
- 30673 30671 30670 30671 30672 30673 30674 30673 30672 30671 30673 30675
- 30673 30672 30672 30674 30676 30677 30674 30673 30672 30671 30673 30675
- 30677 30675 30673 30672 30670 30672 30675 30676 30675 30674 30673 30672
- 30671 30675 30676 30675 30674 30673 30668 30672 30675 30676 30677 30676
- 30675 30673 30665 30670 30674 30675 30677 30676 30674 30673 30662 30668
- 30672 30675 30676 30674 30673 30658 30665 30669 30673 30674 30675 30674
- 30672 30654 30661 30666 30671 30672 30673 30674 30673 30672 30650 30657
- 30662 30668 30671 30672 30671 30670 30647 30654 30659 30665 30668 30669
- 30668 30645 30651 30656 30662 30665 30666 30667 30643 30649 30654 30659
- 30662 30663 30664 30666 30665 30641 30646 30651 30655 30659 30661 30662
- 30639 30644 30648 30652 30655 30658 30636 30642 30645 30648 30651 30654
- 30655 30657 30635 30640 30642 30646 30649 30650 30652 30654 30634 30638
- 30640 30643 30646 30648 30650 30632 30635 30637 30640 30643 30645 30647
- 30630 30632 30635 30636 30639 30641 30643 30644 30628 30630 30633 30634
- 30635 30637 30639 30641 30626 30628 30630 30632 30634 30636 30638 30624
- 30625 30627 30629 30631 30633 30634 30635 30622 30623 30624 30625 30627
- 30629 30630 30631 30620 30621 30622 30623 30625 30626 30627 30617 30616
- 30617 30618 30619 30621 30623 30614 30615 30617 30619 30612 30611 30610
- 30611 30612 30614]
- [30696 30699 30702 30704 30705 30704 30703 30701 30694 30697 30700 30703
- 30705 30704 30703 30700 30692 30695 30699 30703 30704 30703 30702 30701
- 30698 30688 30692 30696 30699 30702 30701 30700 30697 30684 30689 30691
- 30695 30698 30694 30680 30683 30686 30691 30694 30695 30696 30695 30691
- 30675 30678 30683 30687 30690 30691 30693 30692 30689 30671 30675 30679
- 30683 30686 30688 30686 30668 30672 30675 30679 30684 30685 30686 30684
- 30666 30668 30672 30676 30680 30681 30682 30683 30680 30663 30666 30670
- 30674 30676 30678 30680 30676 30663 30665 30670 30674 30675 30677 30679
- 30678 30675 30662 30664 30667 30672 30675 30676 30677 30676 30674 30660
- 30663 30665 30668 30671 30673 30674 30673 30671 30661 30663 30665 30666
- 30669 30672 30673 30672 30669 30661 30664 30665 30667 30669 30672 30673
- 30672 30670 30663 30665 30666 30668 30670 30671 30672 30669 30666 30667
- 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674 30673
- 30671 30667 30671 30672 30673 30674 30673 30672 30668 30673 30675 30673
- 30672 30668 30674 30676 30677 30674 30673 30672 30671 30668 30675 30677
- 30675 30673 30672 30670 30668 30675 30676 30675 30674 30673 30672 30669
- 30675 30676 30675 30674 30673 30670 30672 30675 30676 30677 30676 30675
- 30673 30671 30670 30674 30675 30677 30676 30674 30673 30671 30668 30672
- 30675 30676 30674 30673 30671 30665 30669 30673 30674 30675 30674 30672
- 30671 30661 30666 30671 30672 30673 30674 30673 30672 30671 30657 30662
- 30668 30671 30672 30671 30670 30669 30654 30659 30665 30668 30669 30668
- 30667 30651 30656 30662 30665 30666 30667 30666 30649 30654 30659 30662
- 30663 30664 30666 30665 30663 30646 30651 30655 30659 30661 30662 30661
- 30644 30648 30652 30655 30658 30659 30642 30645 30648 30651 30654 30655
- 30657 30656 30640 30642 30646 30649 30650 30652 30654 30653 30638 30640
- 30643 30646 30648 30650 30651 30635 30637 30640 30643 30645 30647 30648
- 30632 30635 30636 30639 30641 30643 30644 30645 30630 30633 30634 30635
- 30637 30639 30641 30642 30628 30630 30632 30634 30636 30638 30639 30625
- 30627 30629 30631 30633 30634 30635 30636 30623 30624 30625 30627 30629
- 30630 30631 30632 30621 30622 30623 30625 30626 30627 30628 30616 30617
- 30618 30619 30621 30623 30625 30615 30617 30619 30621 30611 30610 30611
- 30612 30614 30616]
- =============================== warnings summary ===============================
- test/integration/test_integration__io.py:841
- /build/source/test/integration/test_integration__io.py:841: PytestUnknownMarkWarning: Unknown pytest.mark.timeout - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
- @pytest.mark.timeout(30)
- test/integration/test_integration__io.py:914
- /build/source/test/integration/test_integration__io.py:914: PytestUnknownMarkWarning: Unknown pytest.mark.timeout - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
- @pytest.mark.timeout(30)
- test/integration/test_integration__io.py: 20 warnings
- test/integration/test_integration_rioxarray.py: 178 warnings
- /build/source/rioxarray/_io.py:518: DeprecationWarning: string or file could not be read to its end due to unmatched data; this will raise a ValueError in the future.
- new_val = numpy.fromstring(value.strip("{}"), dtype="float", sep=",")
- test/integration/test_integration__io.py::test_open_multiple_resolution
- test/integration/test_integration__io.py::test_nc_attr_loading[open_rasterio]
- test/integration/test_integration__io.py::test_nc_attr_loading[open_rasterio1]
- test/integration/test_integration__io.py::test_nc_attr_loading__disable_decode_times[open_rasterio]
- test/integration/test_integration__io.py::test_nc_attr_loading__disable_decode_times[open_rasterio1]
- <frozen _collections_abc>:801: FutureWarning: The return type of `Dataset.dims` will be changed to return a set of dimension names in future, in order to be more consistent with `DataArray.dims`. To access a mapping from dimension names to lengths, please use `Dataset.sizes`.
- test/integration/test_integration__io.py::test_open_multiple_resolution
- test/integration/test_integration__io.py::test_nc_attr_loading[open_rasterio]
- test/integration/test_integration__io.py::test_nc_attr_loading[open_rasterio1]
- test/integration/test_integration__io.py::test_nc_attr_loading__disable_decode_times[open_rasterio]
- test/integration/test_integration__io.py::test_nc_attr_loading__disable_decode_times[open_rasterio1]
- <frozen _collections_abc>:861: FutureWarning: The return type of `Dataset.dims` will be changed to return a set of dimension names in future, in order to be more consistent with `DataArray.dims`. To access a mapping from dimension names to lengths, please use `Dataset.sizes`.
- test/integration/test_integration__io.py::test_open_group_filter[open_rasterio]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/dataset.py:1423: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'HDF4_EOS:EOS_GRID:/build/source/test/test_data/input/MOD09GA.A2008296.h14v17.006.2015181011753.hdf:MODIS_Grid_1km_2D:gflags_1', mode='r', kwargs={'sharing': False}, manager_id='fb1afd28-3c5b-4235-a937-c4cad3435d54'), but file is not already closed. This may indicate a bug.
- for v in variables.values():
- test/integration/test_integration__io.py::test_open_group_filter[open_rasterio]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/dataset.py:1423: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'HDF4_EOS:EOS_GRID:/build/source/test/test_data/input/MOD09GA.A2008296.h14v17.006.2015181011753.hdf:MODIS_Grid_1km_2D:orbit_pnt_1', mode='r', kwargs={'sharing': False}, manager_id='d8cd5a7d-da6e-4829-9c76-ef50149fbbb6'), but file is not already closed. This may indicate a bug.
- for v in variables.values():
- test/integration/test_integration__io.py: 7 warnings
- test/integration/test_integration_rioxarray.py: 39 warnings
- /build/source/rioxarray/_io.py:929: DeprecationWarning: Supplying chunks as dimension-order tuples is deprecated. It will raise an error in the future. Instead use a dict with dimension names as keys.
- return result.chunk(chunks, name_prefix=name_prefix, token=token)
- test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
- /nix/store/pvkp36zy0xb8h30211z4b43md6gpckzi-python3.11-numpy-1.26.4/lib/python3.11/site-packages/numpy/core/arrayprint.py:989: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'HDF4_EOS:EOS_GRID:/build/source/test/test_data/input/MOD09GA.A2008296.h14v17.006.2015181011753.hdf:MODIS_Grid_1km_2D:num_observations_1km', mode='r', kwargs={'sharing': False}, manager_id='e6bd4678-c185-4831-a603-c0a327ade6a9'), but file is not already closed. This may indicate a bug.
- int_part, frac_part = zip(*(s.split('.') for s in strs))
- test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
- /nix/store/pvkp36zy0xb8h30211z4b43md6gpckzi-python3.11-numpy-1.26.4/lib/python3.11/site-packages/numpy/core/arrayprint.py:989: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'HDF4_EOS:EOS_GRID:/build/source/test/test_data/input/MOD09GA.A2008296.h14v17.006.2015181011753.hdf:MODIS_Grid_1km_2D:granule_pnt_1', mode='r', kwargs={'sharing': False}, manager_id='e106fe0e-ade6-434a-843c-0aa47a0b30fa'), but file is not already closed. This may indicate a bug.
- int_part, frac_part = zip(*(s.split('.') for s in strs))
- test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
- /nix/store/pvkp36zy0xb8h30211z4b43md6gpckzi-python3.11-numpy-1.26.4/lib/python3.11/site-packages/numpy/core/arrayprint.py:989: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'HDF4_EOS:EOS_GRID:/build/source/test/test_data/input/MOD09GA.A2008296.h14v17.006.2015181011753.hdf:MODIS_Grid_1km_2D:SolarAzimuth_1', mode='r', kwargs={'sharing': False}, manager_id='409ad044-4134-4752-a6c8-9648dfd107c2'), but file is not already closed. This may indicate a bug.
- int_part, frac_part = zip(*(s.split('.') for s in strs))
- test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
- /nix/store/pvkp36zy0xb8h30211z4b43md6gpckzi-python3.11-numpy-1.26.4/lib/python3.11/site-packages/numpy/core/arrayprint.py:989: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'HDF4_EOS:EOS_GRID:/build/source/test/test_data/input/MOD09GA.A2008296.h14v17.006.2015181011753.hdf:MODIS_Grid_1km_2D:state_1km_1', mode='r', kwargs={'sharing': False}, manager_id='1730640b-0b7a-403c-bfb8-68328d48b8e8'), but file is not already closed. This may indicate a bug.
- int_part, frac_part = zip(*(s.split('.') for s in strs))
- test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
- /nix/store/pvkp36zy0xb8h30211z4b43md6gpckzi-python3.11-numpy-1.26.4/lib/python3.11/site-packages/numpy/core/arrayprint.py:989: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'HDF4_EOS:EOS_GRID:/build/source/test/test_data/input/MOD09GA.A2008296.h14v17.006.2015181011753.hdf:MODIS_Grid_1km_2D:SensorZenith_1', mode='r', kwargs={'sharing': False}, manager_id='be449146-000a-4275-8b58-9d9e638fe19f'), but file is not already closed. This may indicate a bug.
- int_part, frac_part = zip(*(s.split('.') for s in strs))
- test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
- /nix/store/pvkp36zy0xb8h30211z4b43md6gpckzi-python3.11-numpy-1.26.4/lib/python3.11/site-packages/numpy/core/arrayprint.py:989: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'HDF4_EOS:EOS_GRID:/build/source/test/test_data/input/MOD09GA.A2008296.h14v17.006.2015181011753.hdf:MODIS_Grid_1km_2D:SensorAzimuth_1', mode='r', kwargs={'sharing': False}, manager_id='464b74c5-fea3-448d-84bb-c992251a2072'), but file is not already closed. This may indicate a bug.
- int_part, frac_part = zip(*(s.split('.') for s in strs))
- test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
- /nix/store/pvkp36zy0xb8h30211z4b43md6gpckzi-python3.11-numpy-1.26.4/lib/python3.11/site-packages/numpy/core/arrayprint.py:989: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'HDF4_EOS:EOS_GRID:/build/source/test/test_data/input/MOD09GA.A2008296.h14v17.006.2015181011753.hdf:MODIS_Grid_1km_2D:Range_1', mode='r', kwargs={'sharing': False}, manager_id='aba8dc9b-05c0-4ddd-ad49-bd15190493ea'), but file is not already closed. This may indicate a bug.
- int_part, frac_part = zip(*(s.split('.') for s in strs))
- test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
- /nix/store/pvkp36zy0xb8h30211z4b43md6gpckzi-python3.11-numpy-1.26.4/lib/python3.11/site-packages/numpy/core/arrayprint.py:989: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'HDF4_EOS:EOS_GRID:/build/source/test/test_data/input/MOD09GA.A2008296.h14v17.006.2015181011753.hdf:MODIS_Grid_1km_2D:SolarZenith_1', mode='r', kwargs={'sharing': False}, manager_id='a223cf91-f177-4acc-a5ba-7cbe2bc246a9'), but file is not already closed. This may indicate a bug.
- int_part, frac_part = zip(*(s.split('.') for s in strs))
- test/integration/test_integration__io.py::test_serialization
- <frozen importlib._bootstrap>:241: RuntimeWarning: numpy.ndarray size changed, may indicate binary incompatibility. Expected 16 from C header, got 96 from PyObject
- test/integration/test_integration__io.py: 12 warnings
- /build/source/test/integration/test_integration__io.py:498: DeprecationWarning: dropping variables using `drop` is deprecated; use drop_vars.
- raster_ds[band_name], expected.sel(band=band).drop("band")
- test/integration/test_integration__io.py::test_band_as_variable[open_rasterio]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/common.py:314: RuntimeWarning: deallocating CachingFileManager(functools.partial(<function _single_band_open at 0xffff5dd15bc0>, bidx=1), '/build/tmpkcyoth0_/temp-3.tif', mode='r', kwargs={'sharing': False}, manager_id='bec5746c-ad0d-4fb7-b93e-2b25890b2d1e'), but file is not already closed. This may indicate a bug.
- object.__setattr__(self, name, value)
- test/integration/test_integration__io.py::test_band_as_variable[open_rasterio]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/common.py:314: RuntimeWarning: deallocating CachingFileManager(functools.partial(<function _single_band_open at 0xffff5dd15bc0>, bidx=2), '/build/tmpkcyoth0_/temp-3.tif', mode='r', kwargs={'sharing': False}, manager_id='0004f040-2004-44b5-9816-cd96b3bd437a'), but file is not already closed. This may indicate a bug.
- object.__setattr__(self, name, value)
- test/integration/test_integration__io.py::test_band_as_variable[open_rasterio1]
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/copy.py:218: RuntimeWarning: deallocating CachingFileManager(functools.partial(<function _single_band_open at 0xffff5dd15bc0>, bidx=0), '/build/tmpkcyoth0_/temp-3.tif', mode='r', kwargs={'sharing': False}, manager_id='0fe3e5cf-84db-4c34-8629-bbd110081cb8'), but file is not already closed. This may indicate a bug.
- for k, j in zip(x, y):
- test/integration/test_integration__io.py::test_band_as_variable[open_rasterio1]
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/copy.py:218: RuntimeWarning: deallocating CachingFileManager(functools.partial(<function _single_band_open at 0xffff5dd15bc0>, bidx=0), '/build/pytest-of-nixbld/pytest-0/test_band_as_variable_open_ras0/test.tif', mode='r', kwargs={'sharing': False}, manager_id='b17f525d-5369-4a42-afd4-4c23eafac521'), but file is not already closed. This may indicate a bug.
- for k, j in zip(x, y):
- test/integration/test_integration__io.py::test_band_as_variable[open_rasterio1]
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/copy.py:218: RuntimeWarning: deallocating CachingFileManager(functools.partial(<function _single_band_open at 0xffff5dd15bc0>, bidx=1), '/build/pytest-of-nixbld/pytest-0/test_band_as_variable_open_ras0/test.tif', mode='r', kwargs={'sharing': False}, manager_id='0dc8f6fe-5859-4ddf-9338-36c1223f3c7e'), but file is not already closed. This may indicate a bug.
- for k, j in zip(x, y):
- test/integration/test_integration__io.py::test_band_as_variable[open_rasterio1]
- /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/copy.py:218: RuntimeWarning: deallocating CachingFileManager(functools.partial(<function _single_band_open at 0xffff5dd15bc0>, bidx=2), '/build/pytest-of-nixbld/pytest-0/test_band_as_variable_open_ras0/test.tif', mode='r', kwargs={'sharing': False}, manager_id='58db1b3c-ec5f-4de0-b3d2-109738c94063'), but file is not already closed. This may indicate a bug.
- for k, j in zip(x, y):
- test/integration/test_integration__io.py::test_band_as_variable[open_rasterio1]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/common.py:314: RuntimeWarning: deallocating CachingFileManager(functools.partial(<function _single_band_open at 0xffff5dd15bc0>, bidx=0), '/build/pytest-of-nixbld/pytest-0/test_band_as_variable_open_ras1/test.tif', mode='r', kwargs={'sharing': False}, manager_id='2bcb32c2-3bed-4d7c-a86d-b886b6688b9c'), but file is not already closed. This may indicate a bug.
- object.__setattr__(self, name, value)
- test/integration/test_integration__io.py::test_band_as_variable[open_rasterio1]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/common.py:314: RuntimeWarning: deallocating CachingFileManager(functools.partial(<function _single_band_open at 0xffff5dd15bc0>, bidx=0), '/build/tmphw3ozwnx/temp-4.tif', mode='r', kwargs={'sharing': False}, manager_id='417abbdd-9886-4460-86f6-fca30ac48169'), but file is not already closed. This may indicate a bug.
- object.__setattr__(self, name, value)
- test/integration/test_integration__io.py::test_band_as_variable[open_rasterio1]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/common.py:314: RuntimeWarning: deallocating CachingFileManager(functools.partial(<function _single_band_open at 0xffff5dd15bc0>, bidx=1), '/build/tmphw3ozwnx/temp-4.tif', mode='r', kwargs={'sharing': False}, manager_id='77213104-5806-400d-b530-1e9cbe4b5210'), but file is not already closed. This may indicate a bug.
- object.__setattr__(self, name, value)
- test/integration/test_integration__io.py::test_notransform
- test/integration/test_integration__io.py::test_rasterio_vrt_gcps
- test/integration/test_integration__io.py::test_rasterio_vrt_warp_extras
- test/integration/test_integration__io.py::test_notgeoreferenced_warning[open_rasterio]
- test/integration/test_integration__io.py::test_notgeoreferenced_warning[open_rasterio1]
- test/integration/test_integration__io.py::test_reading_gcps
- test/integration/test_integration__io.py::test_writing_gcps
- test/integration/test_integration_rioxarray.py::test_reproject__gcps_kwargs
- test/integration/test_integration_rioxarray.py::test_reproject__gcps_file
- /nix/store/hnpllsa72vwy7sv31ydwyz0xgkgagyk7-python3.11-rasterio-1.3.10/lib/python3.11/site-packages/rasterio/__init__.py:314: NotGeoreferencedWarning: Dataset has no geotransform, gcps, or rpcs. The identity matrix will be returned.
- dataset = writer(
- test/integration/test_integration__io.py::test_notransform
- test/integration/test_integration__io.py::test_mask_and_scale__unicode[open_rasterio]
- test/integration/test_integration__io.py::test_mask_and_scale__unicode[open_rasterio1]
- test/integration/test_integration__io.py::test_mask_and_scale__unicode__to_raster[open_rasterio]
- test/integration/test_integration__io.py::test_mask_and_scale__unicode__to_raster[open_rasterio1]
- /build/source/rioxarray/_io.py:1132: NotGeoreferencedWarning: Dataset has no geotransform, gcps, or rpcs. The identity matrix will be returned.
- warnings.warn(str(rio_warning.message), type(rio_warning.message)) # type: ignore
- test/integration/test_integration__io.py::test_indexing
- /nix/store/pvkp36zy0xb8h30211z4b43md6gpckzi-python3.11-numpy-1.26.4/lib/python3.11/site-packages/numpy/core/_ufunc_config.py:462: RuntimeWarning: deallocating CachingFileManager(functools.partial(<function _single_band_open at 0xffff5dd15bc0>, bidx=2), '/build/pytest-of-nixbld/pytest-0/test_band_as_variable_open_ras1/test.tif', mode='r', kwargs={'sharing': False}, manager_id='a98e4fa8-04f3-4f1e-b690-ca983d3796c8'), but file is not already closed. This may indicate a bug.
- token = NO_NEP50_WARNING.set(True)
- test/integration/test_integration__io.py::test_chunks_with_mask_and_scale
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/layers.py:87: RuntimeWarning: deallocating CachingFileManager(functools.partial(<function _single_band_open at 0xffff5dd15bc0>, bidx=1), '/build/pytest-of-nixbld/pytest-0/test_band_as_variable_open_ras1/test.tif', mode='r', kwargs={'sharing': False}, manager_id='37b18fd3-3ea3-4cff-a953-220f514760b7'), but file is not already closed. This may indicate a bug.
- return tuple(slice(*s, None) for s in loc)
- test/integration/test_integration__io.py::test_rasterio_vrt[True]
- /build/source/test/integration/test_integration__io.py:877: RuntimeWarning: deallocating CachingFileManager(functools.partial(<function _single_band_open at 0xffff5dd15bc0>, bidx=1), '/build/tmpl0y5jtlq/temp-15.tif', mode='r', kwargs={'sharing': False}, manager_id='3e8f9db5-0156-415b-964a-ca644f18267c'), but file is not already closed. This may indicate a bug.
- with rioxarray.open_rasterio(
- test/integration/test_integration__io.py::test_mask_and_scale__unicode__to_raster[open_rasterio]
- test/integration/test_integration__io.py::test_mask_and_scale__unicode__to_raster[open_rasterio1]
- test/integration/test_integration__io.py::test_writing_gcps
- /nix/store/hnpllsa72vwy7sv31ydwyz0xgkgagyk7-python3.11-rasterio-1.3.10/lib/python3.11/site-packages/rasterio/__init__.py:314: NotGeoreferencedWarning: The given matrix is equal to Affine.identity or its flipped counterpart. GDAL may ignore this matrix and save no geotransform without raising an error. This behavior is somewhat driver-specific.
- dataset = writer(
- test/integration/test_integration__io.py::test_nc_attr_loading[open_rasterio1]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/indexes.py:1485: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/tmp534a2hbo/temp-19.tif', mode='r', kwargs={'sharing': False}, manager_id='182c6d3d-27a5-4321-91cc-e44780f89b4f'), but file is not already closed. This may indicate a bug.
- id_coord_names[v].append(k)
- test/integration/test_integration__io.py::test_nc_attr_loading[open_rasterio1]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/indexes.py:1485: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/tmpiaid_gqs/temp-20.tif', mode='r', kwargs={'sharing': False}, manager_id='7e2a950b-06b8-402f-90c2-2e3286c43362'), but file is not already closed. This may indicate a bug.
- id_coord_names[v].append(k)
- test/integration/test_integration__io.py::test_cint16_dtype[None]
- test/integration/test_integration__io.py::test_cint16_dtype[complex_int16]
- test/integration/test_integration__io.py::test_cint16_dtype_nodata
- test/integration/test_integration__io.py::test_cint16_dtype_masked[None]
- test/integration/test_integration__io.py::test_cint16_dtype_masked[complex_int16]
- test/integration/test_integration__io.py::test_cint16_promote_dtype
- test/integration/test_integration__io.py::test_cint16_promote_dtype
- /nix/store/hnpllsa72vwy7sv31ydwyz0xgkgagyk7-python3.11-rasterio-1.3.10/lib/python3.11/site-packages/rasterio/__init__.py:224: ComplexWarning: Casting complex values to real discards the imaginary part
- nodata = float(nodata)
- test/integration/test_integration_rioxarray.py::test_reproject_match__rotated
- test/integration/test_integration_rioxarray.py::test_reproject_match__rotated
- /build/source/rioxarray/rioxarray.py:655: UserWarning: Transform that is non-rectilinear or with rotation found. Unable to recalculate.
- warnings.warn(
- test/integration/test_integration_rioxarray.py::test_interpolate_na__nodata_filled[interpolate_na_filled2]
- /nix/store/q0qv763d77pzvhdfm2hf1sqy4ywm8lim-python3.11-pytest-8.1.1/lib/python3.11/site-packages/_pytest/outcomes.py:219: RuntimeWarning: deallocating CachingFileManager(<class 'netCDF4._netCDF4.Dataset'>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='2a695daf-bd27-4046-a440-742dfc7363ed'), but file is not already closed. This may indicate a bug.
- compile(modname, "", "eval") # to catch syntaxerrors
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method0]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/indexes.py:1447: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='08cd2755-e7a4-493d-8fe0-11bd328b3a98'), but file is not already closed. This may indicate a bug.
- unmatched_keys = set(indexes) ^ set(variables)
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/indexing.py:395: RuntimeWarning: deallocating CachingFileManager(<class 'netCDF4._netCDF4.Dataset'>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='b0f8a474-f6be-4fce-bc9f-95eea337a65f'), but file is not already closed. This may indicate a bug.
- super().__init__(new_key)
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/indexing.py:395: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='21163a11-9503-4475-8d9f-971fedac5678'), but file is not already closed. This may indicate a bug.
- super().__init__(new_key)
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/indexing.py:395: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='618b645c-5c13-4265-8e46-98ae25e00881'), but file is not already closed. This may indicate a bug.
- super().__init__(new_key)
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/indexing.py:395: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='4e01f5c3-a2bb-4099-9b55-6abbbc874a75'), but file is not already closed. This may indicate a bug.
- super().__init__(new_key)
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/indexing.py:395: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='8984f2ab-bc7f-4769-9649-e53dac8b8e00'), but file is not already closed. This may indicate a bug.
- super().__init__(new_key)
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/indexing.py:395: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='49cd5977-1b9f-4277-b22f-0e77c4ab2e5b'), but file is not already closed. This may indicate a bug.
- super().__init__(new_key)
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/indexing.py:395: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='9be5ee44-c0c9-41fe-94ee-ba9165be5022'), but file is not already closed. This may indicate a bug.
- super().__init__(new_key)
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/indexing.py:395: RuntimeWarning: deallocating CachingFileManager(<class 'netCDF4._netCDF4.Dataset'>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='01e99618-c9e6-4905-9588-1684ee91ef22'), but file is not already closed. This may indicate a bug.
- super().__init__(new_key)
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/indexing.py:395: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='c4f56c5f-14e5-48b4-b836-f096992cb2a2'), but file is not already closed. This may indicate a bug.
- super().__init__(new_key)
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-False-False-open_method1]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/indexes.py:1447: RuntimeWarning: deallocating CachingFileManager(<class 'netCDF4._netCDF4.Dataset'>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='08a53642-5637-4843-82ec-ca82796f31c6'), but file is not already closed. This may indicate a bug.
- unmatched_keys = set(indexes) ^ set(variables)
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-True-True-open_method0]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/indexes.py:1471: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='4600b426-c6ab-4f3a-8263-6c21352420fc'), but file is not already closed. This may indicate a bug.
- self.__coord_name_id = {k: id(idx) for k, idx in self._indexes.items()}
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method1]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/utils.py:560: RuntimeWarning: deallocating CachingFileManager(<class 'netCDF4._netCDF4.Dataset'>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='94e427af-f613-4769-acd9-a6b103fceefc'), but file is not already closed. This may indicate a bug.
- self._d.update(dict.fromkeys(values))
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/blockwise.py:1270: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='eb6d1ea4-000e-456a-a034-cfc2b7646af9'), but file is not already closed. This may indicate a bug.
- inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/blockwise.py:1270: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='3b1582f7-e1d7-4afc-aa9c-b3a1d606193e'), but file is not already closed. This may indicate a bug.
- inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/blockwise.py:1270: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='39b71ec6-db3d-47ab-bb59-0601828e9b16'), but file is not already closed. This may indicate a bug.
- inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/blockwise.py:1270: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='1a1685c1-d4ee-444e-a16c-a478e86e18db'), but file is not already closed. This may indicate a bug.
- inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/blockwise.py:1270: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='8068e8ef-3103-4dde-a1c7-662fa9cfbf45'), but file is not already closed. This may indicate a bug.
- inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/blockwise.py:1270: RuntimeWarning: deallocating CachingFileManager(<class 'netCDF4._netCDF4.Dataset'>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='c9f5c9da-a60e-46ce-b144-4da0f813b1f7'), but file is not already closed. This may indicate a bug.
- inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/blockwise.py:1270: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='95b451e6-0bd4-468f-9b63-740d0cae1fb2'), but file is not already closed. This may indicate a bug.
- inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/blockwise.py:1270: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='cd9d10a4-7340-4298-a7b7-e54a39637ea6'), but file is not already closed. This may indicate a bug.
- inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/blockwise.py:1270: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='bde49f3f-ccc8-4e3e-9e95-1abdf1dd9750'), but file is not already closed. This may indicate a bug.
- inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/blockwise.py:1270: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='dee6955f-1346-4c3c-8401-3e1664508c20'), but file is not already closed. This may indicate a bug.
- inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
- test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/blockwise.py:1270: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='9611a3de-28a2-4808-9c91-202433cf81c8'), but file is not already closed. This may indicate a bug.
- inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
- test/integration/test_integration_rioxarray.py::test_to_raster_3d[None-False-True-open_method0]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/variable.py:2938: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='d0600457-2ed0-4c26-85c5-bcbb55ad045b'), but file is not already closed. This may indicate a bug.
- for dim, size in zip(var.dims, var.shape):
- test/integration/test_integration_rioxarray.py::test_to_raster_3d[write_lock1-False-True-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/core.py:369: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/MODIS_ARRAY.nc', mode='r', kwargs={'sharing': False}, manager_id='a59ad369-2051-4298-a75f-949ab0ba5335'), but file is not already closed. This may indicate a bug.
- _add(result[val], k)
- test/integration/test_integration_rioxarray.py::test_to_raster_3d[write_lock1-False-True-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/core.py:369: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'netcdf:/build/source/test/test_data/input/PLANET_SCOPE_3D.nc:green', mode='r', kwargs={'sharing': False}, manager_id='25783b9c-7417-4929-bcd0-a7dc9a826674'), but file is not already closed. This may indicate a bug.
- _add(result[val], k)
- test/integration/test_integration_rioxarray.py::test_to_raster_3d[write_lock1-False-True-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/core.py:369: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'netcdf:/build/source/test/test_data/input/PLANET_SCOPE_3D.nc:green', mode='r', kwargs={'sharing': False}, manager_id='5ab8b45d-a553-460a-aea8-bd98a5cb342c'), but file is not already closed. This may indicate a bug.
- _add(result[val], k)
- test/integration/test_integration_rioxarray.py::test_to_raster_3d[write_lock1-False-True-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/core.py:369: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'netcdf:/build/source/test/test_data/input/PLANET_SCOPE_3D.nc:green', mode='r', kwargs={'sharing': False}, manager_id='b9ed63eb-8411-459d-81db-81cc096e5116'), but file is not already closed. This may indicate a bug.
- _add(result[val], k)
- test/integration/test_integration_rioxarray.py::test_to_raster_3d[write_lock1-False-True-open_method2]
- /nix/store/497bzk4dvjwpzr3hx12zys288c4qgbh0-python3.11-dask-2024.5.2/lib/python3.11/site-packages/dask/core.py:369: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'netcdf:/build/source/test/test_data/input/PLANET_SCOPE_3D.nc:green', mode='r', kwargs={'sharing': False}, manager_id='f3e56b27-ff5d-4087-a7ae-6b36bc45e9bc'), but file is not already closed. This may indicate a bug.
- _add(result[val], k)
- test/integration/test_integration_rioxarray.py::test_to_raster_3d[write_lock2-True-True-open_method4]
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/indexes.py:1512: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'netcdf:/build/source/test/test_data/input/PLANET_SCOPE_3D.nc:green', mode='r', kwargs={'sharing': False}, manager_id='cabce4b4-6b9d-4847-bfd1-e89ced7d2be9'), but file is not already closed. This may indicate a bug.
- for index in self._indexes.values():
- test/integration/test_integration_rioxarray.py::test_write_nodata__array__copy
- /nix/store/kzwc2d8sisxn58h7sf5z1y6xc5i8x6ln-python3.11-pandas-2.2.1/lib/python3.11/site-packages/pandas/core/indexes/base.py:1766: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, 'netcdf:/build/source/test/test_data/input/PLANET_SCOPE_3D.nc:green', mode='r', kwargs={'sharing': False}, manager_id='e8030be6-fb52-494f-a67f-3e0de2c62b80'), but file is not already closed. This may indicate a bug.
- return FrozenList((self.name,))
- test/integration/test_integration_rioxarray.py::test_write_nodata__array__copy
- /nix/store/kzwc2d8sisxn58h7sf5z1y6xc5i8x6ln-python3.11-pandas-2.2.1/lib/python3.11/site-packages/pandas/core/indexes/base.py:1766: RuntimeWarning: deallocating CachingFileManager(<class 'netCDF4._netCDF4.Dataset'>, '/build/source/test/test_data/input/test_find_crs.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='0226e8af-4d8b-4513-8ad3-c76abb4d9488'), but file is not already closed. This may indicate a bug.
- return FrozenList((self.name,))
- test/integration/test_integration_xarray_plugin.py::test_xarray_open_dataset__drop_variables
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/utils.py:430: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/cog.tif', mode='r', kwargs={'sharing': False}, manager_id='7cf473cf-78f3-4618-9604-28e11d14b0cb'), but file is not already closed. This may indicate a bug.
- return iter(self.mapping)
- test/integration/test_integration_xarray_plugin.py::test_xarray_open_dataset__drop_variables
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/utils.py:430: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/cog.tif', mode='r', kwargs={'sharing': False}, manager_id='a8e9cde5-e001-4320-9f50-2bec9abcd0dc'), but file is not already closed. This may indicate a bug.
- return iter(self.mapping)
- test/integration/test_integration_xarray_plugin.py::test_xarray_open_dataset__drop_variables
- /nix/store/ld9cyixbrln64khkzlm1x8967s56nkq3-python3.11-xarray-2024.2.0/lib/python3.11/site-packages/xarray/core/utils.py:430: RuntimeWarning: deallocating CachingFileManager(<function open at 0xffff65379e40>, '/build/source/test/test_data/input/cog.tif', mode='r', kwargs={'sharing': False}, manager_id='971d61a0-46cd-461c-b73f-a97fa4766378'), but file is not already closed. This may indicate a bug.
- return iter(self.mapping)
- -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
- =========================== short test summary info ============================
- FAILED test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip - AssertionError:
- FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_rasterio-True] - AssertionError:
- FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_rasterio-False] - AssertionError:
- FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func1-True] - AssertionError:
- FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func1-False] - AssertionError:
- FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func2-True] - AssertionError:
- FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func2-False] - AssertionError:
- FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func3-True] - AssertionError:
- FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func3-False] - AssertionError:
- FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func4-True] - AssertionError:
- FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func4-False] - AssertionError:
- FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func5-True] - AssertionError:
- FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func5-False] - AssertionError:
- = 13 failed, 417 passed, 17 skipped, 8 deselected, 2 xfailed, 2 xpassed, 356 warnings in 21.49s =
- /nix/store/hyaqjk5jdavx2zjk3s79ahz87xxcz0a2-stdenv-linux/setup: line 1579: pop_var_context: head of shell_variables not a function context
Advertisement
Add Comment
Please, Sign In to add comment