Guest User

Untitled

a guest
Jun 17th, 2024
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 163.70 KB | None | 0 0
  1. Sourcing python-remove-tests-dir-hook
  2. Sourcing python-catch-conflicts-hook.sh
  3. Sourcing python-remove-bin-bytecode-hook.sh
  4. Sourcing pypa-build-hook
  5. Using pypaBuildPhase
  6. Sourcing python-runtime-deps-check-hook
  7. Using pythonRuntimeDepsCheckHook
  8. Sourcing pypa-install-hook
  9. Using pypaInstallPhase
  10. Sourcing python-imports-check-hook.sh
  11. Using pythonImportsCheckPhase
  12. Sourcing python-namespaces-hook
  13. Sourcing python-catch-conflicts-hook.sh
  14. Sourcing pytest-check-hook
  15. Using pytestCheckPhase
  16. Running phase: unpackPhase
  17. unpacking source archive /nix/store/hwvdjqfaczah10wcjxsyvvqnj8as8brl-source
  18. source root is source
  19. setting SOURCE_DATE_EPOCH to timestamp 315619200 of file source/test/unit/test_unit_reproject_match.py
  20. Running phase: patchPhase
  21. Running phase: updateAutotoolsGnuConfigScriptsPhase
  22. Running phase: configurePhase
  23. no configure script, doing nothing
  24. Running phase: buildPhase
  25. Executing pypaBuildPhase
  26. Creating a wheel...
  27. * Getting build dependencies for wheel...
  28. running egg_info
  29. creating rioxarray.egg-info
  30. writing rioxarray.egg-info/PKG-INFO
  31. writing dependency_links to rioxarray.egg-info/dependency_links.txt
  32. writing entry points to rioxarray.egg-info/entry_points.txt
  33. writing requirements to rioxarray.egg-info/requires.txt
  34. writing top-level names to rioxarray.egg-info/top_level.txt
  35. writing manifest file 'rioxarray.egg-info/SOURCES.txt'
  36. reading manifest file 'rioxarray.egg-info/SOURCES.txt'
  37. reading manifest template 'MANIFEST.in'
  38. warning: no previously-included files matching '*' found under directory 'test'
  39. warning: no previously-included files matching '__pycache__' found under directory '*'
  40. warning: no previously-included files matching '*.py[co]' found under directory '*'
  41. no previously-included directories found matching 'docs/'
  42. adding license file 'LICENSE'
  43. adding license file 'LICENSE_datacube'
  44. adding license file 'LICENSE_xarray'
  45. adding license file 'AUTHORS.rst'
  46. writing manifest file 'rioxarray.egg-info/SOURCES.txt'
  47. * Building wheel...
  48. running bdist_wheel
  49. running build
  50. running build_py
  51. creating build
  52. creating build/lib
  53. creating build/lib/rioxarray
  54. copying rioxarray/__init__.py -> build/lib/rioxarray
  55. copying rioxarray/_io.py -> build/lib/rioxarray
  56. copying rioxarray/_options.py -> build/lib/rioxarray
  57. copying rioxarray/_show_versions.py -> build/lib/rioxarray
  58. copying rioxarray/crs.py -> build/lib/rioxarray
  59. copying rioxarray/exceptions.py -> build/lib/rioxarray
  60. copying rioxarray/merge.py -> build/lib/rioxarray
  61. copying rioxarray/raster_array.py -> build/lib/rioxarray
  62. copying rioxarray/raster_dataset.py -> build/lib/rioxarray
  63. copying rioxarray/raster_writer.py -> build/lib/rioxarray
  64. copying rioxarray/rioxarray.py -> build/lib/rioxarray
  65. copying rioxarray/xarray_plugin.py -> build/lib/rioxarray
  66. running egg_info
  67. writing rioxarray.egg-info/PKG-INFO
  68. writing dependency_links to rioxarray.egg-info/dependency_links.txt
  69. writing entry points to rioxarray.egg-info/entry_points.txt
  70. writing requirements to rioxarray.egg-info/requires.txt
  71. writing top-level names to rioxarray.egg-info/top_level.txt
  72. reading manifest file 'rioxarray.egg-info/SOURCES.txt'
  73. reading manifest template 'MANIFEST.in'
  74. warning: no previously-included files matching '*' found under directory 'test'
  75. warning: no previously-included files matching '__pycache__' found under directory '*'
  76. warning: no previously-included files matching '*.py[co]' found under directory '*'
  77. no previously-included directories found matching 'docs/'
  78. adding license file 'LICENSE'
  79. adding license file 'LICENSE_datacube'
  80. adding license file 'LICENSE_xarray'
  81. adding license file 'AUTHORS.rst'
  82. writing manifest file 'rioxarray.egg-info/SOURCES.txt'
  83. copying rioxarray/py.typed -> build/lib/rioxarray
  84. installing to build/bdist.linux-aarch64/wheel
  85. running install
  86. running install_lib
  87. creating build/bdist.linux-aarch64
  88. creating build/bdist.linux-aarch64/wheel
  89. creating build/bdist.linux-aarch64/wheel/rioxarray
  90. copying build/lib/rioxarray/__init__.py -> build/bdist.linux-aarch64/wheel/rioxarray
  91. copying build/lib/rioxarray/_io.py -> build/bdist.linux-aarch64/wheel/rioxarray
  92. copying build/lib/rioxarray/_options.py -> build/bdist.linux-aarch64/wheel/rioxarray
  93. copying build/lib/rioxarray/_show_versions.py -> build/bdist.linux-aarch64/wheel/rioxarray
  94. copying build/lib/rioxarray/crs.py -> build/bdist.linux-aarch64/wheel/rioxarray
  95. copying build/lib/rioxarray/exceptions.py -> build/bdist.linux-aarch64/wheel/rioxarray
  96. copying build/lib/rioxarray/merge.py -> build/bdist.linux-aarch64/wheel/rioxarray
  97. copying build/lib/rioxarray/raster_array.py -> build/bdist.linux-aarch64/wheel/rioxarray
  98. copying build/lib/rioxarray/raster_dataset.py -> build/bdist.linux-aarch64/wheel/rioxarray
  99. copying build/lib/rioxarray/raster_writer.py -> build/bdist.linux-aarch64/wheel/rioxarray
  100. copying build/lib/rioxarray/rioxarray.py -> build/bdist.linux-aarch64/wheel/rioxarray
  101. copying build/lib/rioxarray/xarray_plugin.py -> build/bdist.linux-aarch64/wheel/rioxarray
  102. copying build/lib/rioxarray/py.typed -> build/bdist.linux-aarch64/wheel/rioxarray
  103. running install_egg_info
  104. Copying rioxarray.egg-info to build/bdist.linux-aarch64/wheel/rioxarray-0.15.5-py3.11.egg-info
  105. running install_scripts
  106. creating build/bdist.linux-aarch64/wheel/rioxarray-0.15.5.dist-info/WHEEL
  107. creating '/build/source/dist/.tmp-jlz2ku01/rioxarray-0.15.5-py3-none-any.whl' and adding 'build/bdist.linux-aarch64/wheel' to it
  108. adding 'rioxarray/__init__.py'
  109. adding 'rioxarray/_io.py'
  110. adding 'rioxarray/_options.py'
  111. adding 'rioxarray/_show_versions.py'
  112. adding 'rioxarray/crs.py'
  113. adding 'rioxarray/exceptions.py'
  114. adding 'rioxarray/merge.py'
  115. adding 'rioxarray/py.typed'
  116. adding 'rioxarray/raster_array.py'
  117. adding 'rioxarray/raster_dataset.py'
  118. adding 'rioxarray/raster_writer.py'
  119. adding 'rioxarray/rioxarray.py'
  120. adding 'rioxarray/xarray_plugin.py'
  121. adding 'rioxarray-0.15.5.dist-info/AUTHORS.rst'
  122. adding 'rioxarray-0.15.5.dist-info/LICENSE'
  123. adding 'rioxarray-0.15.5.dist-info/LICENSE_datacube'
  124. adding 'rioxarray-0.15.5.dist-info/LICENSE_xarray'
  125. adding 'rioxarray-0.15.5.dist-info/METADATA'
  126. adding 'rioxarray-0.15.5.dist-info/WHEEL'
  127. adding 'rioxarray-0.15.5.dist-info/entry_points.txt'
  128. adding 'rioxarray-0.15.5.dist-info/top_level.txt'
  129. adding 'rioxarray-0.15.5.dist-info/RECORD'
  130. removing build/bdist.linux-aarch64/wheel
  131. Successfully built rioxarray-0.15.5-py3-none-any.whl
  132. Finished creating a wheel...
  133. Finished executing pypaBuildPhase
  134. Running phase: pythonRuntimeDepsCheckHook
  135. Executing pythonRuntimeDepsCheck
  136. Checking runtime dependencies for rioxarray-0.15.5-py3-none-any.whl
  137. Finished executing pythonRuntimeDepsCheck
  138. Running phase: installPhase
  139. Executing pypaInstallPhase
  140. Successfully installed rioxarray-0.15.5-py3-none-any.whl
  141. Finished executing pypaInstallPhase
  142. Running phase: pythonOutputDistPhase
  143. Executing pythonOutputDistPhase
  144. Finished executing pythonOutputDistPhase
  145. Running phase: fixupPhase
  146. shrinking RPATHs of ELF executables and libraries in /nix/store/k52kyfman0i2lljapwc8yjxm1v9d9dpz-python3.11-rioxarray-0.15.5
  147. checking for references to /build/ in /nix/store/k52kyfman0i2lljapwc8yjxm1v9d9dpz-python3.11-rioxarray-0.15.5...
  148. patching script interpreter paths in /nix/store/k52kyfman0i2lljapwc8yjxm1v9d9dpz-python3.11-rioxarray-0.15.5
  149. stripping (with command strip and flags -S -p) in /nix/store/k52kyfman0i2lljapwc8yjxm1v9d9dpz-python3.11-rioxarray-0.15.5/lib
  150. shrinking RPATHs of ELF executables and libraries in /nix/store/6m28s7jdgqwzay2k7795f6snzzlzkmsd-python3.11-rioxarray-0.15.5-dist
  151. checking for references to /build/ in /nix/store/6m28s7jdgqwzay2k7795f6snzzlzkmsd-python3.11-rioxarray-0.15.5-dist...
  152. patching script interpreter paths in /nix/store/6m28s7jdgqwzay2k7795f6snzzlzkmsd-python3.11-rioxarray-0.15.5-dist
  153. Executing pythonRemoveTestsDir
  154. Finished executing pythonRemoveTestsDir
  155. Running phase: installCheckPhase
  156. no Makefile or custom installCheckPhase, doing nothing
  157. Running phase: pythonCatchConflictsPhase
  158. Running phase: pythonRemoveBinBytecodePhase
  159. Running phase: pythonImportsCheckPhase
  160. Executing pythonImportsCheckPhase
  161. Check whether the following modules can be imported: rioxarray
  162. Running phase: pytestCheckPhase
  163. Executing pytestCheckPhase
  164. ============================= test session starts ==============================
  165. platform linux -- Python 3.11.9, pytest-8.1.1, pluggy-1.4.0
  166. rootdir: /build/source
  167. configfile: pyproject.toml
  168. collected 459 items / 8 deselected / 451 selected
  169.  
  170. test/integration/test_integration__io.py .............................F. [ 6%]
  171. ............x....x........................................... [ 20%]
  172. test/integration/test_integration__io_uri_manager.py ........ [ 22%]
  173. test/integration/test_integration_merge.py ....... [ 23%]
  174. test/integration/test_integration_rioxarray.py ......................... [ 29%]
  175. .............FFFFFFFFFFFF......s........................................ [ 45%]
  176. ......................................................sss.sssssssss...s. [ 61%]
  177. .................................................................XX..... [ 77%]
  178. .................................................ss..................... [ 93%]
  179. ........s....... [ 96%]
  180. test/integration/test_integration_xarray_plugin.py ...... [ 98%]
  181. test/unit/test_options.py .... [ 98%]
  182. test/unit/test_show_versions.py .... [ 99%]
  183. test/unit/test_unit_reproject_match.py . [100%]
  184.  
  185. =================================== FAILURES ===================================
  186. ______________________ test_open_rasterio_mask_chunk_clip ______________________
  187.  
  188. def test_open_rasterio_mask_chunk_clip():
  189. with rioxarray.open_rasterio(
  190. os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
  191. masked=True,
  192. chunks=True,
  193. default_name="dem",
  194. ) as xdi:
  195. if isinstance(xdi, xarray.Dataset):
  196. xdi = xdi.dem
  197. assert xdi.name == "dem"
  198. assert str(xdi.dtype) == "float32"
  199. assert str(xdi.data.dtype) == "float32"
  200. assert str(type(xdi.data)) == "<class 'dask.array.core.Array'>"
  201. assert xdi.chunks == ((1,), (245,), (574,))
  202. assert numpy.isnan(xdi.values).sum() == 52119
  203. test_encoding = dict(xdi.encoding)
  204. assert test_encoding.pop("source").endswith("small_dem_3m_merged.tif")
  205. assert test_encoding == {
  206. "_FillValue": 0.0,
  207. "grid_mapping": "spatial_ref",
  208. "dtype": "uint16",
  209. "rasterio_dtype": "uint16",
  210. }
  211. attrs = dict(xdi.attrs)
  212. assert_almost_equal(
  213. tuple(xdi.rio._cached_transform())[:6],
  214. (3.0, 0.0, 425047.68381405267, 0.0, -3.0, 4615780.040546387),
  215. )
  216. assert attrs == {
  217. "AREA_OR_POINT": "Area",
  218. "add_offset": 0.0,
  219. "scale_factor": 1.0,
  220. }
  221.  
  222. # get subset for testing
  223. subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
  224. comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
  225. # add transform for test
  226. comp_subset.rio.write_transform()
  227.  
  228. geometries = [
  229. {
  230. "type": "Polygon",
  231. "coordinates": [
  232. [
  233. [subset.x.values[0], subset.y.values[-1]],
  234. [subset.x.values[0], subset.y.values[0]],
  235. [subset.x.values[-1], subset.y.values[0]],
  236. [subset.x.values[-1], subset.y.values[-1]],
  237. [subset.x.values[0], subset.y.values[-1]],
  238. ]
  239. ],
  240. }
  241. ]
  242.  
  243. # test data array
  244. clipped = xdi.rio.clip(geometries, comp_subset.rio.crs)
  245. > _assert_xarrays_equal(clipped, comp_subset)
  246.  
  247. test/integration/test_integration__io.py:338:
  248. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  249. test/conftest.py:84: in _assert_xarrays_equal
  250. assert_almost_equal(
  251. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  252. return func(*args, **kwds)
  253. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  254. return func(*args, **kwds)
  255. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  256.  
  257. args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d628d60>, array([[[30692., 30696., 30699., 30702., 307... 30621.],
  258. [30611., 30610., 30610., 30610., 30610., 30611., 30612., 30614.,
  259. 30616.]]], dtype=float32))
  260. kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
  261.  
  262. @wraps(func)
  263. def inner(*args, **kwds):
  264. with self._recreate_cm():
  265. > return func(*args, **kwds)
  266. E AssertionError:
  267. E Arrays are not almost equal to 7 decimals
  268. E
  269. E Mismatched elements: 375 / 441 (85%)
  270. E Max absolute difference: 7.
  271. E Max relative difference: 0.00022836
  272. E x: array([[[30692., 30696., 30699., 30702., 30704., 30705., 30705., 30704.,
  273. E 30703.],
  274. E [30690., 30694., 30697., 30700., 30703., 30705., 30704., 30704.,...
  275. E y: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
  276. E 30701.],
  277. E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
  278.  
  279. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
  280. ----------------------------- Captured stdout call -----------------------------
  281. [30692. 30696. 30699. 30702. 30704. 30705. 30704. 30703. 30690. 30694.
  282. 30697. 30700. 30703. 30705. 30704. 30703. 30687. 30692. 30695. 30699.
  283. 30703. 30704. 30703. 30702. 30701. 30682. 30688. 30692. 30696. 30699.
  284. 30702. 30701. 30700. 30678. 30684. 30689. 30691. 30695. 30698. 30674.
  285. 30680. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30670. 30675.
  286. 30678. 30683. 30687. 30690. 30691. 30693. 30692. 30668. 30671. 30675.
  287. 30679. 30683. 30686. 30688. 30666. 30668. 30672. 30675. 30679. 30684.
  288. 30685. 30686. 30663. 30666. 30668. 30672. 30676. 30680. 30681. 30682.
  289. 30683. 30661. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30660.
  290. 30663. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30659. 30662.
  291. 30664. 30667. 30672. 30675. 30676. 30677. 30676. 30658. 30660. 30663.
  292. 30665. 30668. 30671. 30673. 30674. 30673. 30659. 30661. 30663. 30665.
  293. 30666. 30669. 30672. 30673. 30672. 30659. 30661. 30664. 30665. 30667.
  294. 30669. 30672. 30673. 30672. 30662. 30663. 30665. 30666. 30668. 30670.
  295. 30671. 30672. 30665. 30666. 30667. 30669. 30671. 30673. 30672. 30671.
  296. 30668. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30670. 30671.
  297. 30672. 30673. 30674. 30673. 30672. 30671. 30673. 30675. 30673. 30672.
  298. 30672. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30673. 30675.
  299. 30677. 30675. 30673. 30672. 30670. 30672. 30675. 30676. 30675. 30674.
  300. 30673. 30672. 30671. 30675. 30676. 30675. 30674. 30673. 30668. 30672.
  301. 30675. 30676. 30677. 30676. 30675. 30673. 30665. 30670. 30674. 30675.
  302. 30677. 30676. 30674. 30673. 30662. 30668. 30672. 30675. 30676. 30674.
  303. 30673. 30658. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30654.
  304. 30661. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30650. 30657.
  305. 30662. 30668. 30671. 30672. 30671. 30670. 30647. 30654. 30659. 30665.
  306. 30668. 30669. 30668. 30645. 30651. 30656. 30662. 30665. 30666. 30667.
  307. 30643. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30641.
  308. 30646. 30651. 30655. 30659. 30661. 30662. 30639. 30644. 30648. 30652.
  309. 30655. 30658. 30636. 30642. 30645. 30648. 30651. 30654. 30655. 30657.
  310. 30635. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30634. 30638.
  311. 30640. 30643. 30646. 30648. 30650. 30632. 30635. 30637. 30640. 30643.
  312. 30645. 30647. 30630. 30632. 30635. 30636. 30639. 30641. 30643. 30644.
  313. 30628. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30626. 30628.
  314. 30630. 30632. 30634. 30636. 30638. 30624. 30625. 30627. 30629. 30631.
  315. 30633. 30634. 30635. 30622. 30623. 30624. 30625. 30627. 30629. 30630.
  316. 30631. 30620. 30621. 30622. 30623. 30625. 30626. 30627. 30617. 30616.
  317. 30617. 30618. 30619. 30621. 30623. 30614. 30615. 30617. 30619. 30612.
  318. 30611. 30610. 30611. 30612. 30614.]
  319. [30696. 30699. 30702. 30704. 30705. 30704. 30703. 30701. 30694. 30697.
  320. 30700. 30703. 30705. 30704. 30703. 30700. 30692. 30695. 30699. 30703.
  321. 30704. 30703. 30702. 30701. 30698. 30688. 30692. 30696. 30699. 30702.
  322. 30701. 30700. 30697. 30684. 30689. 30691. 30695. 30698. 30694. 30680.
  323. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30691. 30675. 30678.
  324. 30683. 30687. 30690. 30691. 30693. 30692. 30689. 30671. 30675. 30679.
  325. 30683. 30686. 30688. 30686. 30668. 30672. 30675. 30679. 30684. 30685.
  326. 30686. 30684. 30666. 30668. 30672. 30676. 30680. 30681. 30682. 30683.
  327. 30680. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30676. 30663.
  328. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30675. 30662. 30664.
  329. 30667. 30672. 30675. 30676. 30677. 30676. 30674. 30660. 30663. 30665.
  330. 30668. 30671. 30673. 30674. 30673. 30671. 30661. 30663. 30665. 30666.
  331. 30669. 30672. 30673. 30672. 30669. 30661. 30664. 30665. 30667. 30669.
  332. 30672. 30673. 30672. 30670. 30663. 30665. 30666. 30668. 30670. 30671.
  333. 30672. 30669. 30666. 30667. 30669. 30671. 30673. 30672. 30671. 30668.
  334. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30667. 30671. 30672.
  335. 30673. 30674. 30673. 30672. 30668. 30673. 30675. 30673. 30672. 30668.
  336. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30668. 30675. 30677.
  337. 30675. 30673. 30672. 30670. 30668. 30675. 30676. 30675. 30674. 30673.
  338. 30672. 30669. 30675. 30676. 30675. 30674. 30673. 30670. 30672. 30675.
  339. 30676. 30677. 30676. 30675. 30673. 30671. 30670. 30674. 30675. 30677.
  340. 30676. 30674. 30673. 30671. 30668. 30672. 30675. 30676. 30674. 30673.
  341. 30671. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30671. 30661.
  342. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30671. 30657. 30662.
  343. 30668. 30671. 30672. 30671. 30670. 30669. 30654. 30659. 30665. 30668.
  344. 30669. 30668. 30667. 30651. 30656. 30662. 30665. 30666. 30667. 30666.
  345. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30663. 30646.
  346. 30651. 30655. 30659. 30661. 30662. 30661. 30644. 30648. 30652. 30655.
  347. 30658. 30659. 30642. 30645. 30648. 30651. 30654. 30655. 30657. 30656.
  348. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30653. 30638. 30640.
  349. 30643. 30646. 30648. 30650. 30651. 30635. 30637. 30640. 30643. 30645.
  350. 30647. 30648. 30632. 30635. 30636. 30639. 30641. 30643. 30644. 30645.
  351. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30642. 30628. 30630.
  352. 30632. 30634. 30636. 30638. 30639. 30625. 30627. 30629. 30631. 30633.
  353. 30634. 30635. 30636. 30623. 30624. 30625. 30627. 30629. 30630. 30631.
  354. 30632. 30621. 30622. 30623. 30625. 30626. 30627. 30628. 30616. 30617.
  355. 30618. 30619. 30621. 30623. 30625. 30615. 30617. 30619. 30621. 30611.
  356. 30610. 30611. 30612. 30614. 30616.]
  357. ____________________ test_clip_geojson[open_rasterio-True] _____________________
  358.  
  359. open_func = <function open_rasterio at 0xffff5dd15c60>, from_disk = True
  360.  
  361. @pytest.mark.parametrize("from_disk", [True, False])
  362. @pytest.mark.parametrize(
  363. "open_func",
  364. [
  365. rioxarray.open_rasterio,
  366. partial(rioxarray.open_rasterio, parse_coordinates=False),
  367. partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
  368. open_rasterio_engine,
  369. partial(open_rasterio_engine, parse_coordinates=False),
  370. partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
  371. ],
  372. )
  373. def test_clip_geojson(open_func, from_disk):
  374. with open_func(
  375. os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
  376. ) as xdi:
  377. # get subset for testing
  378. subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
  379. comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
  380. if isinstance(comp_subset, xarray.Dataset):
  381. comp_subset = comp_subset.band_data
  382. # add transform for test
  383. comp_subset.rio.write_transform(inplace=True)
  384. # add grid mapping for test
  385. comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
  386. if comp_subset.rio.encoded_nodata is None:
  387. comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
  388.  
  389. geometries = [
  390. {
  391. "type": "Polygon",
  392. "coordinates": [
  393. [
  394. [425499.18381405267, 4615331.540546387],
  395. [425499.18381405267, 4615478.540546387],
  396. [425526.18381405267, 4615478.540546387],
  397. [425526.18381405267, 4615331.540546387],
  398. [425499.18381405267, 4615331.540546387],
  399. ]
  400. ],
  401. }
  402. ]
  403. # test data array
  404. clipped = xdi.rio.clip(geometries, from_disk=from_disk)
  405. if from_disk and not isinstance(clipped, xarray.Dataset):
  406. > _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
  407.  
  408. test/integration/test_integration_rioxarray.py:570:
  409. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  410. test/conftest.py:84: in _assert_xarrays_equal
  411. assert_almost_equal(
  412. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  413. return func(*args, **kwds)
  414. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  415. return func(*args, **kwds)
  416. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  417.  
  418. args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d693ce0>, array([[[30696, 30699, 30702, 30704, 30705, ..., 30617, 30619, 30621],
  419. [30611, 30610, 30610, 30610, 30610, 30611, 30612, 30614, 30616]]],
  420. dtype=uint16))
  421. kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
  422.  
  423. @wraps(func)
  424. def inner(*args, **kwds):
  425. with self._recreate_cm():
  426. > return func(*args, **kwds)
  427. E AssertionError:
  428. E Arrays are not almost equal to 7 decimals
  429. E
  430. E Mismatched elements: 49 / 441 (11.1%)
  431. E Max absolute difference: 30701
  432. E Max relative difference: 1.
  433. E x: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 0],
  434. E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 0],
  435. E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 0],...
  436. E y: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 30701],
  437. E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 30700],
  438. E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 30698],...
  439.  
  440. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
  441. ----------------------------- Captured stdout call -----------------------------
  442. [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
  443. 0 0 0 0 0 0 0 0 0 0 0 0]
  444. [30701 30700 30698 30697 30694 30691 30689 30686 30684 30680 30676 30675
  445. 30674 30671 30669 30670 30669 30668 30667 30668 30668 30668 30668 30669
  446. 30670 30671 30671 30671 30671 30671 30669 30667 30666 30663 30661 30659
  447. 30656 30653 30651 30648 30645 30642 30639 30636 30632 30628 30625 30621
  448. 30616]
  449. ____________________ test_clip_geojson[open_rasterio-False] ____________________
  450.  
  451. open_func = <function open_rasterio at 0xffff5dd15c60>, from_disk = False
  452.  
  453. @pytest.mark.parametrize("from_disk", [True, False])
  454. @pytest.mark.parametrize(
  455. "open_func",
  456. [
  457. rioxarray.open_rasterio,
  458. partial(rioxarray.open_rasterio, parse_coordinates=False),
  459. partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
  460. open_rasterio_engine,
  461. partial(open_rasterio_engine, parse_coordinates=False),
  462. partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
  463. ],
  464. )
  465. def test_clip_geojson(open_func, from_disk):
  466. with open_func(
  467. os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
  468. ) as xdi:
  469. # get subset for testing
  470. subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
  471. comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
  472. if isinstance(comp_subset, xarray.Dataset):
  473. comp_subset = comp_subset.band_data
  474. # add transform for test
  475. comp_subset.rio.write_transform(inplace=True)
  476. # add grid mapping for test
  477. comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
  478. if comp_subset.rio.encoded_nodata is None:
  479. comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
  480.  
  481. geometries = [
  482. {
  483. "type": "Polygon",
  484. "coordinates": [
  485. [
  486. [425499.18381405267, 4615331.540546387],
  487. [425499.18381405267, 4615478.540546387],
  488. [425526.18381405267, 4615478.540546387],
  489. [425526.18381405267, 4615331.540546387],
  490. [425499.18381405267, 4615331.540546387],
  491. ]
  492. ],
  493. }
  494. ]
  495. # test data array
  496. clipped = xdi.rio.clip(geometries, from_disk=from_disk)
  497. if from_disk and not isinstance(clipped, xarray.Dataset):
  498. _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
  499. if comp_subset.rio.encoded_nodata is not None:
  500. assert numpy.isnan(clipped.values[:, 0, :]).all()
  501. assert numpy.isnan(clipped.values[:, :, 0]).all()
  502. else:
  503. assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
  504. assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
  505. else:
  506. if isinstance(clipped, xarray.Dataset):
  507. clipped = clipped.band_data
  508. > _assert_xarrays_equal(clipped, comp_subset)
  509.  
  510. test/integration/test_integration_rioxarray.py:580:
  511. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  512. test/conftest.py:84: in _assert_xarrays_equal
  513. assert_almost_equal(
  514. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  515. return func(*args, **kwds)
  516. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  517. return func(*args, **kwds)
  518. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  519.  
  520. args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d691260>, array([[[30692, 30696, 30699, 30702, 30704, ..., 30617, 30619, 30621],
  521. [30611, 30610, 30610, 30610, 30610, 30611, 30612, 30614, 30616]]],
  522. dtype=uint16))
  523. kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
  524.  
  525. @wraps(func)
  526. def inner(*args, **kwds):
  527. with self._recreate_cm():
  528. > return func(*args, **kwds)
  529. E AssertionError:
  530. E Arrays are not almost equal to 7 decimals
  531. E
  532. E Mismatched elements: 375 / 441 (85%)
  533. E Max absolute difference: 7
  534. E Max relative difference: 0.00022836
  535. E x: array([[[30692, 30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703],
  536. E [30690, 30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703],
  537. E [30687, 30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701],...
  538. E y: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 30701],
  539. E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 30700],
  540. E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 30698],...
  541.  
  542. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
  543. ----------------------------- Captured stdout call -----------------------------
  544. [30692 30696 30699 30702 30704 30705 30704 30703 30690 30694 30697 30700
  545. 30703 30705 30704 30703 30687 30692 30695 30699 30703 30704 30703 30702
  546. 30701 30682 30688 30692 30696 30699 30702 30701 30700 30678 30684 30689
  547. 30691 30695 30698 30674 30680 30683 30686 30691 30694 30695 30696 30695
  548. 30670 30675 30678 30683 30687 30690 30691 30693 30692 30668 30671 30675
  549. 30679 30683 30686 30688 30666 30668 30672 30675 30679 30684 30685 30686
  550. 30663 30666 30668 30672 30676 30680 30681 30682 30683 30661 30663 30666
  551. 30670 30674 30676 30678 30680 30660 30663 30665 30670 30674 30675 30677
  552. 30679 30678 30659 30662 30664 30667 30672 30675 30676 30677 30676 30658
  553. 30660 30663 30665 30668 30671 30673 30674 30673 30659 30661 30663 30665
  554. 30666 30669 30672 30673 30672 30659 30661 30664 30665 30667 30669 30672
  555. 30673 30672 30662 30663 30665 30666 30668 30670 30671 30672 30665 30666
  556. 30667 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674
  557. 30673 30671 30670 30671 30672 30673 30674 30673 30672 30671 30673 30675
  558. 30673 30672 30672 30674 30676 30677 30674 30673 30672 30671 30673 30675
  559. 30677 30675 30673 30672 30670 30672 30675 30676 30675 30674 30673 30672
  560. 30671 30675 30676 30675 30674 30673 30668 30672 30675 30676 30677 30676
  561. 30675 30673 30665 30670 30674 30675 30677 30676 30674 30673 30662 30668
  562. 30672 30675 30676 30674 30673 30658 30665 30669 30673 30674 30675 30674
  563. 30672 30654 30661 30666 30671 30672 30673 30674 30673 30672 30650 30657
  564. 30662 30668 30671 30672 30671 30670 30647 30654 30659 30665 30668 30669
  565. 30668 30645 30651 30656 30662 30665 30666 30667 30643 30649 30654 30659
  566. 30662 30663 30664 30666 30665 30641 30646 30651 30655 30659 30661 30662
  567. 30639 30644 30648 30652 30655 30658 30636 30642 30645 30648 30651 30654
  568. 30655 30657 30635 30640 30642 30646 30649 30650 30652 30654 30634 30638
  569. 30640 30643 30646 30648 30650 30632 30635 30637 30640 30643 30645 30647
  570. 30630 30632 30635 30636 30639 30641 30643 30644 30628 30630 30633 30634
  571. 30635 30637 30639 30641 30626 30628 30630 30632 30634 30636 30638 30624
  572. 30625 30627 30629 30631 30633 30634 30635 30622 30623 30624 30625 30627
  573. 30629 30630 30631 30620 30621 30622 30623 30625 30626 30627 30617 30616
  574. 30617 30618 30619 30621 30623 30614 30615 30617 30619 30612 30611 30610
  575. 30611 30612 30614]
  576. [30696 30699 30702 30704 30705 30704 30703 30701 30694 30697 30700 30703
  577. 30705 30704 30703 30700 30692 30695 30699 30703 30704 30703 30702 30701
  578. 30698 30688 30692 30696 30699 30702 30701 30700 30697 30684 30689 30691
  579. 30695 30698 30694 30680 30683 30686 30691 30694 30695 30696 30695 30691
  580. 30675 30678 30683 30687 30690 30691 30693 30692 30689 30671 30675 30679
  581. 30683 30686 30688 30686 30668 30672 30675 30679 30684 30685 30686 30684
  582. 30666 30668 30672 30676 30680 30681 30682 30683 30680 30663 30666 30670
  583. 30674 30676 30678 30680 30676 30663 30665 30670 30674 30675 30677 30679
  584. 30678 30675 30662 30664 30667 30672 30675 30676 30677 30676 30674 30660
  585. 30663 30665 30668 30671 30673 30674 30673 30671 30661 30663 30665 30666
  586. 30669 30672 30673 30672 30669 30661 30664 30665 30667 30669 30672 30673
  587. 30672 30670 30663 30665 30666 30668 30670 30671 30672 30669 30666 30667
  588. 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674 30673
  589. 30671 30667 30671 30672 30673 30674 30673 30672 30668 30673 30675 30673
  590. 30672 30668 30674 30676 30677 30674 30673 30672 30671 30668 30675 30677
  591. 30675 30673 30672 30670 30668 30675 30676 30675 30674 30673 30672 30669
  592. 30675 30676 30675 30674 30673 30670 30672 30675 30676 30677 30676 30675
  593. 30673 30671 30670 30674 30675 30677 30676 30674 30673 30671 30668 30672
  594. 30675 30676 30674 30673 30671 30665 30669 30673 30674 30675 30674 30672
  595. 30671 30661 30666 30671 30672 30673 30674 30673 30672 30671 30657 30662
  596. 30668 30671 30672 30671 30670 30669 30654 30659 30665 30668 30669 30668
  597. 30667 30651 30656 30662 30665 30666 30667 30666 30649 30654 30659 30662
  598. 30663 30664 30666 30665 30663 30646 30651 30655 30659 30661 30662 30661
  599. 30644 30648 30652 30655 30658 30659 30642 30645 30648 30651 30654 30655
  600. 30657 30656 30640 30642 30646 30649 30650 30652 30654 30653 30638 30640
  601. 30643 30646 30648 30650 30651 30635 30637 30640 30643 30645 30647 30648
  602. 30632 30635 30636 30639 30641 30643 30644 30645 30630 30633 30634 30635
  603. 30637 30639 30641 30642 30628 30630 30632 30634 30636 30638 30639 30625
  604. 30627 30629 30631 30633 30634 30635 30636 30623 30624 30625 30627 30629
  605. 30630 30631 30632 30621 30622 30623 30625 30626 30627 30628 30616 30617
  606. 30618 30619 30621 30623 30625 30615 30617 30619 30621 30611 30610 30611
  607. 30612 30614 30616]
  608. ______________________ test_clip_geojson[open_func1-True] ______________________
  609.  
  610. open_func = functools.partial(<function open_rasterio at 0xffff5dd15c60>, parse_coordinates=False)
  611. from_disk = True
  612.  
  613. @pytest.mark.parametrize("from_disk", [True, False])
  614. @pytest.mark.parametrize(
  615. "open_func",
  616. [
  617. rioxarray.open_rasterio,
  618. partial(rioxarray.open_rasterio, parse_coordinates=False),
  619. partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
  620. open_rasterio_engine,
  621. partial(open_rasterio_engine, parse_coordinates=False),
  622. partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
  623. ],
  624. )
  625. def test_clip_geojson(open_func, from_disk):
  626. with open_func(
  627. os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
  628. ) as xdi:
  629. # get subset for testing
  630. subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
  631. comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
  632. if isinstance(comp_subset, xarray.Dataset):
  633. comp_subset = comp_subset.band_data
  634. # add transform for test
  635. comp_subset.rio.write_transform(inplace=True)
  636. # add grid mapping for test
  637. comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
  638. if comp_subset.rio.encoded_nodata is None:
  639. comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
  640.  
  641. geometries = [
  642. {
  643. "type": "Polygon",
  644. "coordinates": [
  645. [
  646. [425499.18381405267, 4615331.540546387],
  647. [425499.18381405267, 4615478.540546387],
  648. [425526.18381405267, 4615478.540546387],
  649. [425526.18381405267, 4615331.540546387],
  650. [425499.18381405267, 4615331.540546387],
  651. ]
  652. ],
  653. }
  654. ]
  655. # test data array
  656. clipped = xdi.rio.clip(geometries, from_disk=from_disk)
  657. if from_disk and not isinstance(clipped, xarray.Dataset):
  658. > _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
  659.  
  660. test/integration/test_integration_rioxarray.py:570:
  661. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  662. test/conftest.py:84: in _assert_xarrays_equal
  663. assert_almost_equal(
  664. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  665. return func(*args, **kwds)
  666. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  667. return func(*args, **kwds)
  668. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  669.  
  670. args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d6b7880>, array([[[30696, 30699, 30702, 30704, 30705, ..., 30617, 30619, 30621],
  671. [30611, 30610, 30610, 30610, 30610, 30611, 30612, 30614, 30616]]],
  672. dtype=uint16))
  673. kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
  674.  
  675. @wraps(func)
  676. def inner(*args, **kwds):
  677. with self._recreate_cm():
  678. > return func(*args, **kwds)
  679. E AssertionError:
  680. E Arrays are not almost equal to 7 decimals
  681. E
  682. E Mismatched elements: 49 / 441 (11.1%)
  683. E Max absolute difference: 30701
  684. E Max relative difference: 1.
  685. E x: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 0],
  686. E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 0],
  687. E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 0],...
  688. E y: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 30701],
  689. E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 30700],
  690. E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 30698],...
  691.  
  692. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
  693. ----------------------------- Captured stdout call -----------------------------
  694. [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
  695. 0 0 0 0 0 0 0 0 0 0 0 0]
  696. [30701 30700 30698 30697 30694 30691 30689 30686 30684 30680 30676 30675
  697. 30674 30671 30669 30670 30669 30668 30667 30668 30668 30668 30668 30669
  698. 30670 30671 30671 30671 30671 30671 30669 30667 30666 30663 30661 30659
  699. 30656 30653 30651 30648 30645 30642 30639 30636 30632 30628 30625 30621
  700. 30616]
  701. _____________________ test_clip_geojson[open_func1-False] ______________________
  702.  
  703. open_func = functools.partial(<function open_rasterio at 0xffff5dd15c60>, parse_coordinates=False)
  704. from_disk = False
  705.  
  706. @pytest.mark.parametrize("from_disk", [True, False])
  707. @pytest.mark.parametrize(
  708. "open_func",
  709. [
  710. rioxarray.open_rasterio,
  711. partial(rioxarray.open_rasterio, parse_coordinates=False),
  712. partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
  713. open_rasterio_engine,
  714. partial(open_rasterio_engine, parse_coordinates=False),
  715. partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
  716. ],
  717. )
  718. def test_clip_geojson(open_func, from_disk):
  719. with open_func(
  720. os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
  721. ) as xdi:
  722. # get subset for testing
  723. subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
  724. comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
  725. if isinstance(comp_subset, xarray.Dataset):
  726. comp_subset = comp_subset.band_data
  727. # add transform for test
  728. comp_subset.rio.write_transform(inplace=True)
  729. # add grid mapping for test
  730. comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
  731. if comp_subset.rio.encoded_nodata is None:
  732. comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
  733.  
  734. geometries = [
  735. {
  736. "type": "Polygon",
  737. "coordinates": [
  738. [
  739. [425499.18381405267, 4615331.540546387],
  740. [425499.18381405267, 4615478.540546387],
  741. [425526.18381405267, 4615478.540546387],
  742. [425526.18381405267, 4615331.540546387],
  743. [425499.18381405267, 4615331.540546387],
  744. ]
  745. ],
  746. }
  747. ]
  748. # test data array
  749. clipped = xdi.rio.clip(geometries, from_disk=from_disk)
  750. if from_disk and not isinstance(clipped, xarray.Dataset):
  751. _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
  752. if comp_subset.rio.encoded_nodata is not None:
  753. assert numpy.isnan(clipped.values[:, 0, :]).all()
  754. assert numpy.isnan(clipped.values[:, :, 0]).all()
  755. else:
  756. assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
  757. assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
  758. else:
  759. if isinstance(clipped, xarray.Dataset):
  760. clipped = clipped.band_data
  761. > _assert_xarrays_equal(clipped, comp_subset)
  762.  
  763. test/integration/test_integration_rioxarray.py:580:
  764. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  765. test/conftest.py:84: in _assert_xarrays_equal
  766. assert_almost_equal(
  767. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  768. return func(*args, **kwds)
  769. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  770. return func(*args, **kwds)
  771. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  772.  
  773. args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d6b7f60>, array([[[30692, 30696, 30699, 30702, 30704, ..., 30617, 30619, 30621],
  774. [30611, 30610, 30610, 30610, 30610, 30611, 30612, 30614, 30616]]],
  775. dtype=uint16))
  776. kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
  777.  
  778. @wraps(func)
  779. def inner(*args, **kwds):
  780. with self._recreate_cm():
  781. > return func(*args, **kwds)
  782. E AssertionError:
  783. E Arrays are not almost equal to 7 decimals
  784. E
  785. E Mismatched elements: 375 / 441 (85%)
  786. E Max absolute difference: 7
  787. E Max relative difference: 0.00022836
  788. E x: array([[[30692, 30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703],
  789. E [30690, 30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703],
  790. E [30687, 30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701],...
  791. E y: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 30701],
  792. E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 30700],
  793. E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 30698],...
  794.  
  795. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
  796. ----------------------------- Captured stdout call -----------------------------
  797. [30692 30696 30699 30702 30704 30705 30704 30703 30690 30694 30697 30700
  798. 30703 30705 30704 30703 30687 30692 30695 30699 30703 30704 30703 30702
  799. 30701 30682 30688 30692 30696 30699 30702 30701 30700 30678 30684 30689
  800. 30691 30695 30698 30674 30680 30683 30686 30691 30694 30695 30696 30695
  801. 30670 30675 30678 30683 30687 30690 30691 30693 30692 30668 30671 30675
  802. 30679 30683 30686 30688 30666 30668 30672 30675 30679 30684 30685 30686
  803. 30663 30666 30668 30672 30676 30680 30681 30682 30683 30661 30663 30666
  804. 30670 30674 30676 30678 30680 30660 30663 30665 30670 30674 30675 30677
  805. 30679 30678 30659 30662 30664 30667 30672 30675 30676 30677 30676 30658
  806. 30660 30663 30665 30668 30671 30673 30674 30673 30659 30661 30663 30665
  807. 30666 30669 30672 30673 30672 30659 30661 30664 30665 30667 30669 30672
  808. 30673 30672 30662 30663 30665 30666 30668 30670 30671 30672 30665 30666
  809. 30667 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674
  810. 30673 30671 30670 30671 30672 30673 30674 30673 30672 30671 30673 30675
  811. 30673 30672 30672 30674 30676 30677 30674 30673 30672 30671 30673 30675
  812. 30677 30675 30673 30672 30670 30672 30675 30676 30675 30674 30673 30672
  813. 30671 30675 30676 30675 30674 30673 30668 30672 30675 30676 30677 30676
  814. 30675 30673 30665 30670 30674 30675 30677 30676 30674 30673 30662 30668
  815. 30672 30675 30676 30674 30673 30658 30665 30669 30673 30674 30675 30674
  816. 30672 30654 30661 30666 30671 30672 30673 30674 30673 30672 30650 30657
  817. 30662 30668 30671 30672 30671 30670 30647 30654 30659 30665 30668 30669
  818. 30668 30645 30651 30656 30662 30665 30666 30667 30643 30649 30654 30659
  819. 30662 30663 30664 30666 30665 30641 30646 30651 30655 30659 30661 30662
  820. 30639 30644 30648 30652 30655 30658 30636 30642 30645 30648 30651 30654
  821. 30655 30657 30635 30640 30642 30646 30649 30650 30652 30654 30634 30638
  822. 30640 30643 30646 30648 30650 30632 30635 30637 30640 30643 30645 30647
  823. 30630 30632 30635 30636 30639 30641 30643 30644 30628 30630 30633 30634
  824. 30635 30637 30639 30641 30626 30628 30630 30632 30634 30636 30638 30624
  825. 30625 30627 30629 30631 30633 30634 30635 30622 30623 30624 30625 30627
  826. 30629 30630 30631 30620 30621 30622 30623 30625 30626 30627 30617 30616
  827. 30617 30618 30619 30621 30623 30614 30615 30617 30619 30612 30611 30610
  828. 30611 30612 30614]
  829. [30696 30699 30702 30704 30705 30704 30703 30701 30694 30697 30700 30703
  830. 30705 30704 30703 30700 30692 30695 30699 30703 30704 30703 30702 30701
  831. 30698 30688 30692 30696 30699 30702 30701 30700 30697 30684 30689 30691
  832. 30695 30698 30694 30680 30683 30686 30691 30694 30695 30696 30695 30691
  833. 30675 30678 30683 30687 30690 30691 30693 30692 30689 30671 30675 30679
  834. 30683 30686 30688 30686 30668 30672 30675 30679 30684 30685 30686 30684
  835. 30666 30668 30672 30676 30680 30681 30682 30683 30680 30663 30666 30670
  836. 30674 30676 30678 30680 30676 30663 30665 30670 30674 30675 30677 30679
  837. 30678 30675 30662 30664 30667 30672 30675 30676 30677 30676 30674 30660
  838. 30663 30665 30668 30671 30673 30674 30673 30671 30661 30663 30665 30666
  839. 30669 30672 30673 30672 30669 30661 30664 30665 30667 30669 30672 30673
  840. 30672 30670 30663 30665 30666 30668 30670 30671 30672 30669 30666 30667
  841. 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674 30673
  842. 30671 30667 30671 30672 30673 30674 30673 30672 30668 30673 30675 30673
  843. 30672 30668 30674 30676 30677 30674 30673 30672 30671 30668 30675 30677
  844. 30675 30673 30672 30670 30668 30675 30676 30675 30674 30673 30672 30669
  845. 30675 30676 30675 30674 30673 30670 30672 30675 30676 30677 30676 30675
  846. 30673 30671 30670 30674 30675 30677 30676 30674 30673 30671 30668 30672
  847. 30675 30676 30674 30673 30671 30665 30669 30673 30674 30675 30674 30672
  848. 30671 30661 30666 30671 30672 30673 30674 30673 30672 30671 30657 30662
  849. 30668 30671 30672 30671 30670 30669 30654 30659 30665 30668 30669 30668
  850. 30667 30651 30656 30662 30665 30666 30667 30666 30649 30654 30659 30662
  851. 30663 30664 30666 30665 30663 30646 30651 30655 30659 30661 30662 30661
  852. 30644 30648 30652 30655 30658 30659 30642 30645 30648 30651 30654 30655
  853. 30657 30656 30640 30642 30646 30649 30650 30652 30654 30653 30638 30640
  854. 30643 30646 30648 30650 30651 30635 30637 30640 30643 30645 30647 30648
  855. 30632 30635 30636 30639 30641 30643 30644 30645 30630 30633 30634 30635
  856. 30637 30639 30641 30642 30628 30630 30632 30634 30636 30638 30639 30625
  857. 30627 30629 30631 30633 30634 30635 30636 30623 30624 30625 30627 30629
  858. 30630 30631 30632 30621 30622 30623 30625 30626 30627 30628 30616 30617
  859. 30618 30619 30621 30623 30625 30615 30617 30619 30621 30611 30610 30611
  860. 30612 30614 30616]
  861. ______________________ test_clip_geojson[open_func2-True] ______________________
  862.  
  863. open_func = functools.partial(<function open_rasterio at 0xffff5dd15c60>, parse_coordinates=False, masked=True)
  864. from_disk = True
  865.  
  866. @pytest.mark.parametrize("from_disk", [True, False])
  867. @pytest.mark.parametrize(
  868. "open_func",
  869. [
  870. rioxarray.open_rasterio,
  871. partial(rioxarray.open_rasterio, parse_coordinates=False),
  872. partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
  873. open_rasterio_engine,
  874. partial(open_rasterio_engine, parse_coordinates=False),
  875. partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
  876. ],
  877. )
  878. def test_clip_geojson(open_func, from_disk):
  879. with open_func(
  880. os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
  881. ) as xdi:
  882. # get subset for testing
  883. subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
  884. comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
  885. if isinstance(comp_subset, xarray.Dataset):
  886. comp_subset = comp_subset.band_data
  887. # add transform for test
  888. comp_subset.rio.write_transform(inplace=True)
  889. # add grid mapping for test
  890. comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
  891. if comp_subset.rio.encoded_nodata is None:
  892. comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
  893.  
  894. geometries = [
  895. {
  896. "type": "Polygon",
  897. "coordinates": [
  898. [
  899. [425499.18381405267, 4615331.540546387],
  900. [425499.18381405267, 4615478.540546387],
  901. [425526.18381405267, 4615478.540546387],
  902. [425526.18381405267, 4615331.540546387],
  903. [425499.18381405267, 4615331.540546387],
  904. ]
  905. ],
  906. }
  907. ]
  908. # test data array
  909. clipped = xdi.rio.clip(geometries, from_disk=from_disk)
  910. if from_disk and not isinstance(clipped, xarray.Dataset):
  911. > _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
  912.  
  913. test/integration/test_integration_rioxarray.py:570:
  914. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  915. test/conftest.py:84: in _assert_xarrays_equal
  916. assert_almost_equal(
  917. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  918. return func(*args, **kwds)
  919. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  920. return func(*args, **kwds)
  921. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  922.  
  923. args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d619940>, array([[[30696., 30699., 30702., 30704., 307... 30621.],
  924. [30611., 30610., 30610., 30610., 30610., 30611., 30612., 30614.,
  925. 30616.]]], dtype=float32))
  926. kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
  927.  
  928. @wraps(func)
  929. def inner(*args, **kwds):
  930. with self._recreate_cm():
  931. > return func(*args, **kwds)
  932. E AssertionError:
  933. E Arrays are not almost equal to 7 decimals
  934. E
  935. E x and y nan location mismatch:
  936. E x: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
  937. E nan],
  938. E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
  939. E y: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
  940. E 30701.],
  941. E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
  942.  
  943. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
  944. ----------------------------- Captured stdout call -----------------------------
  945. [nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
  946. nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
  947. nan nan nan nan nan nan nan nan nan nan nan nan nan]
  948. [30701. 30700. 30698. 30697. 30694. 30691. 30689. 30686. 30684. 30680.
  949. 30676. 30675. 30674. 30671. 30669. 30670. 30669. 30668. 30667. 30668.
  950. 30668. 30668. 30668. 30669. 30670. 30671. 30671. 30671. 30671. 30671.
  951. 30669. 30667. 30666. 30663. 30661. 30659. 30656. 30653. 30651. 30648.
  952. 30645. 30642. 30639. 30636. 30632. 30628. 30625. 30621. 30616.]
  953. _____________________ test_clip_geojson[open_func2-False] ______________________
  954.  
  955. open_func = functools.partial(<function open_rasterio at 0xffff5dd15c60>, parse_coordinates=False, masked=True)
  956. from_disk = False
  957.  
  958. @pytest.mark.parametrize("from_disk", [True, False])
  959. @pytest.mark.parametrize(
  960. "open_func",
  961. [
  962. rioxarray.open_rasterio,
  963. partial(rioxarray.open_rasterio, parse_coordinates=False),
  964. partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
  965. open_rasterio_engine,
  966. partial(open_rasterio_engine, parse_coordinates=False),
  967. partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
  968. ],
  969. )
  970. def test_clip_geojson(open_func, from_disk):
  971. with open_func(
  972. os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
  973. ) as xdi:
  974. # get subset for testing
  975. subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
  976. comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
  977. if isinstance(comp_subset, xarray.Dataset):
  978. comp_subset = comp_subset.band_data
  979. # add transform for test
  980. comp_subset.rio.write_transform(inplace=True)
  981. # add grid mapping for test
  982. comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
  983. if comp_subset.rio.encoded_nodata is None:
  984. comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
  985.  
  986. geometries = [
  987. {
  988. "type": "Polygon",
  989. "coordinates": [
  990. [
  991. [425499.18381405267, 4615331.540546387],
  992. [425499.18381405267, 4615478.540546387],
  993. [425526.18381405267, 4615478.540546387],
  994. [425526.18381405267, 4615331.540546387],
  995. [425499.18381405267, 4615331.540546387],
  996. ]
  997. ],
  998. }
  999. ]
  1000. # test data array
  1001. clipped = xdi.rio.clip(geometries, from_disk=from_disk)
  1002. if from_disk and not isinstance(clipped, xarray.Dataset):
  1003. _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
  1004. if comp_subset.rio.encoded_nodata is not None:
  1005. assert numpy.isnan(clipped.values[:, 0, :]).all()
  1006. assert numpy.isnan(clipped.values[:, :, 0]).all()
  1007. else:
  1008. assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
  1009. assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
  1010. else:
  1011. if isinstance(clipped, xarray.Dataset):
  1012. clipped = clipped.band_data
  1013. > _assert_xarrays_equal(clipped, comp_subset)
  1014.  
  1015. test/integration/test_integration_rioxarray.py:580:
  1016. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1017. test/conftest.py:84: in _assert_xarrays_equal
  1018. assert_almost_equal(
  1019. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  1020. return func(*args, **kwds)
  1021. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  1022. return func(*args, **kwds)
  1023. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1024.  
  1025. args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d6b7b00>, array([[[30692., 30696., 30699., 30702., 307... 30621.],
  1026. [30611., 30610., 30610., 30610., 30610., 30611., 30612., 30614.,
  1027. 30616.]]], dtype=float32))
  1028. kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
  1029.  
  1030. @wraps(func)
  1031. def inner(*args, **kwds):
  1032. with self._recreate_cm():
  1033. > return func(*args, **kwds)
  1034. E AssertionError:
  1035. E Arrays are not almost equal to 7 decimals
  1036. E
  1037. E Mismatched elements: 375 / 441 (85%)
  1038. E Max absolute difference: 7.
  1039. E Max relative difference: 0.00022836
  1040. E x: array([[[30692., 30696., 30699., 30702., 30704., 30705., 30705., 30704.,
  1041. E 30703.],
  1042. E [30690., 30694., 30697., 30700., 30703., 30705., 30704., 30704.,...
  1043. E y: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
  1044. E 30701.],
  1045. E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
  1046.  
  1047. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
  1048. ----------------------------- Captured stdout call -----------------------------
  1049. [30692. 30696. 30699. 30702. 30704. 30705. 30704. 30703. 30690. 30694.
  1050. 30697. 30700. 30703. 30705. 30704. 30703. 30687. 30692. 30695. 30699.
  1051. 30703. 30704. 30703. 30702. 30701. 30682. 30688. 30692. 30696. 30699.
  1052. 30702. 30701. 30700. 30678. 30684. 30689. 30691. 30695. 30698. 30674.
  1053. 30680. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30670. 30675.
  1054. 30678. 30683. 30687. 30690. 30691. 30693. 30692. 30668. 30671. 30675.
  1055. 30679. 30683. 30686. 30688. 30666. 30668. 30672. 30675. 30679. 30684.
  1056. 30685. 30686. 30663. 30666. 30668. 30672. 30676. 30680. 30681. 30682.
  1057. 30683. 30661. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30660.
  1058. 30663. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30659. 30662.
  1059. 30664. 30667. 30672. 30675. 30676. 30677. 30676. 30658. 30660. 30663.
  1060. 30665. 30668. 30671. 30673. 30674. 30673. 30659. 30661. 30663. 30665.
  1061. 30666. 30669. 30672. 30673. 30672. 30659. 30661. 30664. 30665. 30667.
  1062. 30669. 30672. 30673. 30672. 30662. 30663. 30665. 30666. 30668. 30670.
  1063. 30671. 30672. 30665. 30666. 30667. 30669. 30671. 30673. 30672. 30671.
  1064. 30668. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30670. 30671.
  1065. 30672. 30673. 30674. 30673. 30672. 30671. 30673. 30675. 30673. 30672.
  1066. 30672. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30673. 30675.
  1067. 30677. 30675. 30673. 30672. 30670. 30672. 30675. 30676. 30675. 30674.
  1068. 30673. 30672. 30671. 30675. 30676. 30675. 30674. 30673. 30668. 30672.
  1069. 30675. 30676. 30677. 30676. 30675. 30673. 30665. 30670. 30674. 30675.
  1070. 30677. 30676. 30674. 30673. 30662. 30668. 30672. 30675. 30676. 30674.
  1071. 30673. 30658. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30654.
  1072. 30661. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30650. 30657.
  1073. 30662. 30668. 30671. 30672. 30671. 30670. 30647. 30654. 30659. 30665.
  1074. 30668. 30669. 30668. 30645. 30651. 30656. 30662. 30665. 30666. 30667.
  1075. 30643. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30641.
  1076. 30646. 30651. 30655. 30659. 30661. 30662. 30639. 30644. 30648. 30652.
  1077. 30655. 30658. 30636. 30642. 30645. 30648. 30651. 30654. 30655. 30657.
  1078. 30635. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30634. 30638.
  1079. 30640. 30643. 30646. 30648. 30650. 30632. 30635. 30637. 30640. 30643.
  1080. 30645. 30647. 30630. 30632. 30635. 30636. 30639. 30641. 30643. 30644.
  1081. 30628. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30626. 30628.
  1082. 30630. 30632. 30634. 30636. 30638. 30624. 30625. 30627. 30629. 30631.
  1083. 30633. 30634. 30635. 30622. 30623. 30624. 30625. 30627. 30629. 30630.
  1084. 30631. 30620. 30621. 30622. 30623. 30625. 30626. 30627. 30617. 30616.
  1085. 30617. 30618. 30619. 30621. 30623. 30614. 30615. 30617. 30619. 30612.
  1086. 30611. 30610. 30611. 30612. 30614.]
  1087. [30696. 30699. 30702. 30704. 30705. 30704. 30703. 30701. 30694. 30697.
  1088. 30700. 30703. 30705. 30704. 30703. 30700. 30692. 30695. 30699. 30703.
  1089. 30704. 30703. 30702. 30701. 30698. 30688. 30692. 30696. 30699. 30702.
  1090. 30701. 30700. 30697. 30684. 30689. 30691. 30695. 30698. 30694. 30680.
  1091. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30691. 30675. 30678.
  1092. 30683. 30687. 30690. 30691. 30693. 30692. 30689. 30671. 30675. 30679.
  1093. 30683. 30686. 30688. 30686. 30668. 30672. 30675. 30679. 30684. 30685.
  1094. 30686. 30684. 30666. 30668. 30672. 30676. 30680. 30681. 30682. 30683.
  1095. 30680. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30676. 30663.
  1096. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30675. 30662. 30664.
  1097. 30667. 30672. 30675. 30676. 30677. 30676. 30674. 30660. 30663. 30665.
  1098. 30668. 30671. 30673. 30674. 30673. 30671. 30661. 30663. 30665. 30666.
  1099. 30669. 30672. 30673. 30672. 30669. 30661. 30664. 30665. 30667. 30669.
  1100. 30672. 30673. 30672. 30670. 30663. 30665. 30666. 30668. 30670. 30671.
  1101. 30672. 30669. 30666. 30667. 30669. 30671. 30673. 30672. 30671. 30668.
  1102. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30667. 30671. 30672.
  1103. 30673. 30674. 30673. 30672. 30668. 30673. 30675. 30673. 30672. 30668.
  1104. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30668. 30675. 30677.
  1105. 30675. 30673. 30672. 30670. 30668. 30675. 30676. 30675. 30674. 30673.
  1106. 30672. 30669. 30675. 30676. 30675. 30674. 30673. 30670. 30672. 30675.
  1107. 30676. 30677. 30676. 30675. 30673. 30671. 30670. 30674. 30675. 30677.
  1108. 30676. 30674. 30673. 30671. 30668. 30672. 30675. 30676. 30674. 30673.
  1109. 30671. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30671. 30661.
  1110. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30671. 30657. 30662.
  1111. 30668. 30671. 30672. 30671. 30670. 30669. 30654. 30659. 30665. 30668.
  1112. 30669. 30668. 30667. 30651. 30656. 30662. 30665. 30666. 30667. 30666.
  1113. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30663. 30646.
  1114. 30651. 30655. 30659. 30661. 30662. 30661. 30644. 30648. 30652. 30655.
  1115. 30658. 30659. 30642. 30645. 30648. 30651. 30654. 30655. 30657. 30656.
  1116. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30653. 30638. 30640.
  1117. 30643. 30646. 30648. 30650. 30651. 30635. 30637. 30640. 30643. 30645.
  1118. 30647. 30648. 30632. 30635. 30636. 30639. 30641. 30643. 30644. 30645.
  1119. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30642. 30628. 30630.
  1120. 30632. 30634. 30636. 30638. 30639. 30625. 30627. 30629. 30631. 30633.
  1121. 30634. 30635. 30636. 30623. 30624. 30625. 30627. 30629. 30630. 30631.
  1122. 30632. 30621. 30622. 30623. 30625. 30626. 30627. 30628. 30616. 30617.
  1123. 30618. 30619. 30621. 30623. 30625. 30615. 30617. 30619. 30621. 30611.
  1124. 30610. 30611. 30612. 30614. 30616.]
  1125. ______________________ test_clip_geojson[open_func3-True] ______________________
  1126.  
  1127. open_func = functools.partial(<function open_dataset at 0xffff5e34bc40>, engine='rasterio')
  1128. from_disk = True
  1129.  
  1130. @pytest.mark.parametrize("from_disk", [True, False])
  1131. @pytest.mark.parametrize(
  1132. "open_func",
  1133. [
  1134. rioxarray.open_rasterio,
  1135. partial(rioxarray.open_rasterio, parse_coordinates=False),
  1136. partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
  1137. open_rasterio_engine,
  1138. partial(open_rasterio_engine, parse_coordinates=False),
  1139. partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
  1140. ],
  1141. )
  1142. def test_clip_geojson(open_func, from_disk):
  1143. with open_func(
  1144. os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
  1145. ) as xdi:
  1146. # get subset for testing
  1147. subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
  1148. comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
  1149. if isinstance(comp_subset, xarray.Dataset):
  1150. comp_subset = comp_subset.band_data
  1151. # add transform for test
  1152. comp_subset.rio.write_transform(inplace=True)
  1153. # add grid mapping for test
  1154. comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
  1155. if comp_subset.rio.encoded_nodata is None:
  1156. comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
  1157.  
  1158. geometries = [
  1159. {
  1160. "type": "Polygon",
  1161. "coordinates": [
  1162. [
  1163. [425499.18381405267, 4615331.540546387],
  1164. [425499.18381405267, 4615478.540546387],
  1165. [425526.18381405267, 4615478.540546387],
  1166. [425526.18381405267, 4615331.540546387],
  1167. [425499.18381405267, 4615331.540546387],
  1168. ]
  1169. ],
  1170. }
  1171. ]
  1172. # test data array
  1173. clipped = xdi.rio.clip(geometries, from_disk=from_disk)
  1174. if from_disk and not isinstance(clipped, xarray.Dataset):
  1175. _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
  1176. if comp_subset.rio.encoded_nodata is not None:
  1177. assert numpy.isnan(clipped.values[:, 0, :]).all()
  1178. assert numpy.isnan(clipped.values[:, :, 0]).all()
  1179. else:
  1180. assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
  1181. assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
  1182. else:
  1183. if isinstance(clipped, xarray.Dataset):
  1184. clipped = clipped.band_data
  1185. > _assert_xarrays_equal(clipped, comp_subset)
  1186.  
  1187. test/integration/test_integration_rioxarray.py:580:
  1188. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1189. test/conftest.py:84: in _assert_xarrays_equal
  1190. assert_almost_equal(
  1191. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  1192. return func(*args, **kwds)
  1193. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  1194. return func(*args, **kwds)
  1195. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1196.  
  1197. args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d6b58a0>, array([[[30692., 30696., 30699., 30702., 307... 30621.],
  1198. [30611., 30610., 30610., 30610., 30610., 30611., 30612., 30614.,
  1199. 30616.]]], dtype=float32))
  1200. kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
  1201.  
  1202. @wraps(func)
  1203. def inner(*args, **kwds):
  1204. with self._recreate_cm():
  1205. > return func(*args, **kwds)
  1206. E AssertionError:
  1207. E Arrays are not almost equal to 7 decimals
  1208. E
  1209. E Mismatched elements: 375 / 441 (85%)
  1210. E Max absolute difference: 7.
  1211. E Max relative difference: 0.00022836
  1212. E x: array([[[30692., 30696., 30699., 30702., 30704., 30705., 30705., 30704.,
  1213. E 30703.],
  1214. E [30690., 30694., 30697., 30700., 30703., 30705., 30704., 30704.,...
  1215. E y: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
  1216. E 30701.],
  1217. E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
  1218.  
  1219. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
  1220. ----------------------------- Captured stdout call -----------------------------
  1221. [30692. 30696. 30699. 30702. 30704. 30705. 30704. 30703. 30690. 30694.
  1222. 30697. 30700. 30703. 30705. 30704. 30703. 30687. 30692. 30695. 30699.
  1223. 30703. 30704. 30703. 30702. 30701. 30682. 30688. 30692. 30696. 30699.
  1224. 30702. 30701. 30700. 30678. 30684. 30689. 30691. 30695. 30698. 30674.
  1225. 30680. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30670. 30675.
  1226. 30678. 30683. 30687. 30690. 30691. 30693. 30692. 30668. 30671. 30675.
  1227. 30679. 30683. 30686. 30688. 30666. 30668. 30672. 30675. 30679. 30684.
  1228. 30685. 30686. 30663. 30666. 30668. 30672. 30676. 30680. 30681. 30682.
  1229. 30683. 30661. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30660.
  1230. 30663. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30659. 30662.
  1231. 30664. 30667. 30672. 30675. 30676. 30677. 30676. 30658. 30660. 30663.
  1232. 30665. 30668. 30671. 30673. 30674. 30673. 30659. 30661. 30663. 30665.
  1233. 30666. 30669. 30672. 30673. 30672. 30659. 30661. 30664. 30665. 30667.
  1234. 30669. 30672. 30673. 30672. 30662. 30663. 30665. 30666. 30668. 30670.
  1235. 30671. 30672. 30665. 30666. 30667. 30669. 30671. 30673. 30672. 30671.
  1236. 30668. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30670. 30671.
  1237. 30672. 30673. 30674. 30673. 30672. 30671. 30673. 30675. 30673. 30672.
  1238. 30672. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30673. 30675.
  1239. 30677. 30675. 30673. 30672. 30670. 30672. 30675. 30676. 30675. 30674.
  1240. 30673. 30672. 30671. 30675. 30676. 30675. 30674. 30673. 30668. 30672.
  1241. 30675. 30676. 30677. 30676. 30675. 30673. 30665. 30670. 30674. 30675.
  1242. 30677. 30676. 30674. 30673. 30662. 30668. 30672. 30675. 30676. 30674.
  1243. 30673. 30658. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30654.
  1244. 30661. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30650. 30657.
  1245. 30662. 30668. 30671. 30672. 30671. 30670. 30647. 30654. 30659. 30665.
  1246. 30668. 30669. 30668. 30645. 30651. 30656. 30662. 30665. 30666. 30667.
  1247. 30643. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30641.
  1248. 30646. 30651. 30655. 30659. 30661. 30662. 30639. 30644. 30648. 30652.
  1249. 30655. 30658. 30636. 30642. 30645. 30648. 30651. 30654. 30655. 30657.
  1250. 30635. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30634. 30638.
  1251. 30640. 30643. 30646. 30648. 30650. 30632. 30635. 30637. 30640. 30643.
  1252. 30645. 30647. 30630. 30632. 30635. 30636. 30639. 30641. 30643. 30644.
  1253. 30628. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30626. 30628.
  1254. 30630. 30632. 30634. 30636. 30638. 30624. 30625. 30627. 30629. 30631.
  1255. 30633. 30634. 30635. 30622. 30623. 30624. 30625. 30627. 30629. 30630.
  1256. 30631. 30620. 30621. 30622. 30623. 30625. 30626. 30627. 30617. 30616.
  1257. 30617. 30618. 30619. 30621. 30623. 30614. 30615. 30617. 30619. 30612.
  1258. 30611. 30610. 30611. 30612. 30614.]
  1259. [30696. 30699. 30702. 30704. 30705. 30704. 30703. 30701. 30694. 30697.
  1260. 30700. 30703. 30705. 30704. 30703. 30700. 30692. 30695. 30699. 30703.
  1261. 30704. 30703. 30702. 30701. 30698. 30688. 30692. 30696. 30699. 30702.
  1262. 30701. 30700. 30697. 30684. 30689. 30691. 30695. 30698. 30694. 30680.
  1263. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30691. 30675. 30678.
  1264. 30683. 30687. 30690. 30691. 30693. 30692. 30689. 30671. 30675. 30679.
  1265. 30683. 30686. 30688. 30686. 30668. 30672. 30675. 30679. 30684. 30685.
  1266. 30686. 30684. 30666. 30668. 30672. 30676. 30680. 30681. 30682. 30683.
  1267. 30680. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30676. 30663.
  1268. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30675. 30662. 30664.
  1269. 30667. 30672. 30675. 30676. 30677. 30676. 30674. 30660. 30663. 30665.
  1270. 30668. 30671. 30673. 30674. 30673. 30671. 30661. 30663. 30665. 30666.
  1271. 30669. 30672. 30673. 30672. 30669. 30661. 30664. 30665. 30667. 30669.
  1272. 30672. 30673. 30672. 30670. 30663. 30665. 30666. 30668. 30670. 30671.
  1273. 30672. 30669. 30666. 30667. 30669. 30671. 30673. 30672. 30671. 30668.
  1274. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30667. 30671. 30672.
  1275. 30673. 30674. 30673. 30672. 30668. 30673. 30675. 30673. 30672. 30668.
  1276. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30668. 30675. 30677.
  1277. 30675. 30673. 30672. 30670. 30668. 30675. 30676. 30675. 30674. 30673.
  1278. 30672. 30669. 30675. 30676. 30675. 30674. 30673. 30670. 30672. 30675.
  1279. 30676. 30677. 30676. 30675. 30673. 30671. 30670. 30674. 30675. 30677.
  1280. 30676. 30674. 30673. 30671. 30668. 30672. 30675. 30676. 30674. 30673.
  1281. 30671. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30671. 30661.
  1282. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30671. 30657. 30662.
  1283. 30668. 30671. 30672. 30671. 30670. 30669. 30654. 30659. 30665. 30668.
  1284. 30669. 30668. 30667. 30651. 30656. 30662. 30665. 30666. 30667. 30666.
  1285. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30663. 30646.
  1286. 30651. 30655. 30659. 30661. 30662. 30661. 30644. 30648. 30652. 30655.
  1287. 30658. 30659. 30642. 30645. 30648. 30651. 30654. 30655. 30657. 30656.
  1288. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30653. 30638. 30640.
  1289. 30643. 30646. 30648. 30650. 30651. 30635. 30637. 30640. 30643. 30645.
  1290. 30647. 30648. 30632. 30635. 30636. 30639. 30641. 30643. 30644. 30645.
  1291. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30642. 30628. 30630.
  1292. 30632. 30634. 30636. 30638. 30639. 30625. 30627. 30629. 30631. 30633.
  1293. 30634. 30635. 30636. 30623. 30624. 30625. 30627. 30629. 30630. 30631.
  1294. 30632. 30621. 30622. 30623. 30625. 30626. 30627. 30628. 30616. 30617.
  1295. 30618. 30619. 30621. 30623. 30625. 30615. 30617. 30619. 30621. 30611.
  1296. 30610. 30611. 30612. 30614. 30616.]
  1297. _____________________ test_clip_geojson[open_func3-False] ______________________
  1298.  
  1299. open_func = functools.partial(<function open_dataset at 0xffff5e34bc40>, engine='rasterio')
  1300. from_disk = False
  1301.  
  1302. @pytest.mark.parametrize("from_disk", [True, False])
  1303. @pytest.mark.parametrize(
  1304. "open_func",
  1305. [
  1306. rioxarray.open_rasterio,
  1307. partial(rioxarray.open_rasterio, parse_coordinates=False),
  1308. partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
  1309. open_rasterio_engine,
  1310. partial(open_rasterio_engine, parse_coordinates=False),
  1311. partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
  1312. ],
  1313. )
  1314. def test_clip_geojson(open_func, from_disk):
  1315. with open_func(
  1316. os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
  1317. ) as xdi:
  1318. # get subset for testing
  1319. subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
  1320. comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
  1321. if isinstance(comp_subset, xarray.Dataset):
  1322. comp_subset = comp_subset.band_data
  1323. # add transform for test
  1324. comp_subset.rio.write_transform(inplace=True)
  1325. # add grid mapping for test
  1326. comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
  1327. if comp_subset.rio.encoded_nodata is None:
  1328. comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
  1329.  
  1330. geometries = [
  1331. {
  1332. "type": "Polygon",
  1333. "coordinates": [
  1334. [
  1335. [425499.18381405267, 4615331.540546387],
  1336. [425499.18381405267, 4615478.540546387],
  1337. [425526.18381405267, 4615478.540546387],
  1338. [425526.18381405267, 4615331.540546387],
  1339. [425499.18381405267, 4615331.540546387],
  1340. ]
  1341. ],
  1342. }
  1343. ]
  1344. # test data array
  1345. clipped = xdi.rio.clip(geometries, from_disk=from_disk)
  1346. if from_disk and not isinstance(clipped, xarray.Dataset):
  1347. _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
  1348. if comp_subset.rio.encoded_nodata is not None:
  1349. assert numpy.isnan(clipped.values[:, 0, :]).all()
  1350. assert numpy.isnan(clipped.values[:, :, 0]).all()
  1351. else:
  1352. assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
  1353. assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
  1354. else:
  1355. if isinstance(clipped, xarray.Dataset):
  1356. clipped = clipped.band_data
  1357. > _assert_xarrays_equal(clipped, comp_subset)
  1358.  
  1359. test/integration/test_integration_rioxarray.py:580:
  1360. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1361. test/conftest.py:84: in _assert_xarrays_equal
  1362. assert_almost_equal(
  1363. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  1364. return func(*args, **kwds)
  1365. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  1366. return func(*args, **kwds)
  1367. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1368.  
  1369. args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d6b7560>, array([[[30692., 30696., 30699., 30702., 307... 30621.],
  1370. [30611., 30610., 30610., 30610., 30610., 30611., 30612., 30614.,
  1371. 30616.]]], dtype=float32))
  1372. kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
  1373.  
  1374. @wraps(func)
  1375. def inner(*args, **kwds):
  1376. with self._recreate_cm():
  1377. > return func(*args, **kwds)
  1378. E AssertionError:
  1379. E Arrays are not almost equal to 7 decimals
  1380. E
  1381. E Mismatched elements: 375 / 441 (85%)
  1382. E Max absolute difference: 7.
  1383. E Max relative difference: 0.00022836
  1384. E x: array([[[30692., 30696., 30699., 30702., 30704., 30705., 30705., 30704.,
  1385. E 30703.],
  1386. E [30690., 30694., 30697., 30700., 30703., 30705., 30704., 30704.,...
  1387. E y: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
  1388. E 30701.],
  1389. E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
  1390.  
  1391. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
  1392. ----------------------------- Captured stdout call -----------------------------
  1393. [30692. 30696. 30699. 30702. 30704. 30705. 30704. 30703. 30690. 30694.
  1394. 30697. 30700. 30703. 30705. 30704. 30703. 30687. 30692. 30695. 30699.
  1395. 30703. 30704. 30703. 30702. 30701. 30682. 30688. 30692. 30696. 30699.
  1396. 30702. 30701. 30700. 30678. 30684. 30689. 30691. 30695. 30698. 30674.
  1397. 30680. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30670. 30675.
  1398. 30678. 30683. 30687. 30690. 30691. 30693. 30692. 30668. 30671. 30675.
  1399. 30679. 30683. 30686. 30688. 30666. 30668. 30672. 30675. 30679. 30684.
  1400. 30685. 30686. 30663. 30666. 30668. 30672. 30676. 30680. 30681. 30682.
  1401. 30683. 30661. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30660.
  1402. 30663. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30659. 30662.
  1403. 30664. 30667. 30672. 30675. 30676. 30677. 30676. 30658. 30660. 30663.
  1404. 30665. 30668. 30671. 30673. 30674. 30673. 30659. 30661. 30663. 30665.
  1405. 30666. 30669. 30672. 30673. 30672. 30659. 30661. 30664. 30665. 30667.
  1406. 30669. 30672. 30673. 30672. 30662. 30663. 30665. 30666. 30668. 30670.
  1407. 30671. 30672. 30665. 30666. 30667. 30669. 30671. 30673. 30672. 30671.
  1408. 30668. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30670. 30671.
  1409. 30672. 30673. 30674. 30673. 30672. 30671. 30673. 30675. 30673. 30672.
  1410. 30672. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30673. 30675.
  1411. 30677. 30675. 30673. 30672. 30670. 30672. 30675. 30676. 30675. 30674.
  1412. 30673. 30672. 30671. 30675. 30676. 30675. 30674. 30673. 30668. 30672.
  1413. 30675. 30676. 30677. 30676. 30675. 30673. 30665. 30670. 30674. 30675.
  1414. 30677. 30676. 30674. 30673. 30662. 30668. 30672. 30675. 30676. 30674.
  1415. 30673. 30658. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30654.
  1416. 30661. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30650. 30657.
  1417. 30662. 30668. 30671. 30672. 30671. 30670. 30647. 30654. 30659. 30665.
  1418. 30668. 30669. 30668. 30645. 30651. 30656. 30662. 30665. 30666. 30667.
  1419. 30643. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30641.
  1420. 30646. 30651. 30655. 30659. 30661. 30662. 30639. 30644. 30648. 30652.
  1421. 30655. 30658. 30636. 30642. 30645. 30648. 30651. 30654. 30655. 30657.
  1422. 30635. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30634. 30638.
  1423. 30640. 30643. 30646. 30648. 30650. 30632. 30635. 30637. 30640. 30643.
  1424. 30645. 30647. 30630. 30632. 30635. 30636. 30639. 30641. 30643. 30644.
  1425. 30628. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30626. 30628.
  1426. 30630. 30632. 30634. 30636. 30638. 30624. 30625. 30627. 30629. 30631.
  1427. 30633. 30634. 30635. 30622. 30623. 30624. 30625. 30627. 30629. 30630.
  1428. 30631. 30620. 30621. 30622. 30623. 30625. 30626. 30627. 30617. 30616.
  1429. 30617. 30618. 30619. 30621. 30623. 30614. 30615. 30617. 30619. 30612.
  1430. 30611. 30610. 30611. 30612. 30614.]
  1431. [30696. 30699. 30702. 30704. 30705. 30704. 30703. 30701. 30694. 30697.
  1432. 30700. 30703. 30705. 30704. 30703. 30700. 30692. 30695. 30699. 30703.
  1433. 30704. 30703. 30702. 30701. 30698. 30688. 30692. 30696. 30699. 30702.
  1434. 30701. 30700. 30697. 30684. 30689. 30691. 30695. 30698. 30694. 30680.
  1435. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30691. 30675. 30678.
  1436. 30683. 30687. 30690. 30691. 30693. 30692. 30689. 30671. 30675. 30679.
  1437. 30683. 30686. 30688. 30686. 30668. 30672. 30675. 30679. 30684. 30685.
  1438. 30686. 30684. 30666. 30668. 30672. 30676. 30680. 30681. 30682. 30683.
  1439. 30680. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30676. 30663.
  1440. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30675. 30662. 30664.
  1441. 30667. 30672. 30675. 30676. 30677. 30676. 30674. 30660. 30663. 30665.
  1442. 30668. 30671. 30673. 30674. 30673. 30671. 30661. 30663. 30665. 30666.
  1443. 30669. 30672. 30673. 30672. 30669. 30661. 30664. 30665. 30667. 30669.
  1444. 30672. 30673. 30672. 30670. 30663. 30665. 30666. 30668. 30670. 30671.
  1445. 30672. 30669. 30666. 30667. 30669. 30671. 30673. 30672. 30671. 30668.
  1446. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30667. 30671. 30672.
  1447. 30673. 30674. 30673. 30672. 30668. 30673. 30675. 30673. 30672. 30668.
  1448. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30668. 30675. 30677.
  1449. 30675. 30673. 30672. 30670. 30668. 30675. 30676. 30675. 30674. 30673.
  1450. 30672. 30669. 30675. 30676. 30675. 30674. 30673. 30670. 30672. 30675.
  1451. 30676. 30677. 30676. 30675. 30673. 30671. 30670. 30674. 30675. 30677.
  1452. 30676. 30674. 30673. 30671. 30668. 30672. 30675. 30676. 30674. 30673.
  1453. 30671. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30671. 30661.
  1454. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30671. 30657. 30662.
  1455. 30668. 30671. 30672. 30671. 30670. 30669. 30654. 30659. 30665. 30668.
  1456. 30669. 30668. 30667. 30651. 30656. 30662. 30665. 30666. 30667. 30666.
  1457. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30663. 30646.
  1458. 30651. 30655. 30659. 30661. 30662. 30661. 30644. 30648. 30652. 30655.
  1459. 30658. 30659. 30642. 30645. 30648. 30651. 30654. 30655. 30657. 30656.
  1460. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30653. 30638. 30640.
  1461. 30643. 30646. 30648. 30650. 30651. 30635. 30637. 30640. 30643. 30645.
  1462. 30647. 30648. 30632. 30635. 30636. 30639. 30641. 30643. 30644. 30645.
  1463. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30642. 30628. 30630.
  1464. 30632. 30634. 30636. 30638. 30639. 30625. 30627. 30629. 30631. 30633.
  1465. 30634. 30635. 30636. 30623. 30624. 30625. 30627. 30629. 30630. 30631.
  1466. 30632. 30621. 30622. 30623. 30625. 30626. 30627. 30628. 30616. 30617.
  1467. 30618. 30619. 30621. 30623. 30625. 30615. 30617. 30619. 30621. 30611.
  1468. 30610. 30611. 30612. 30614. 30616.]
  1469. ______________________ test_clip_geojson[open_func4-True] ______________________
  1470.  
  1471. open_func = functools.partial(<function open_dataset at 0xffff5e34bc40>, engine='rasterio', parse_coordinates=False)
  1472. from_disk = True
  1473.  
  1474. @pytest.mark.parametrize("from_disk", [True, False])
  1475. @pytest.mark.parametrize(
  1476. "open_func",
  1477. [
  1478. rioxarray.open_rasterio,
  1479. partial(rioxarray.open_rasterio, parse_coordinates=False),
  1480. partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
  1481. open_rasterio_engine,
  1482. partial(open_rasterio_engine, parse_coordinates=False),
  1483. partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
  1484. ],
  1485. )
  1486. def test_clip_geojson(open_func, from_disk):
  1487. with open_func(
  1488. os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
  1489. ) as xdi:
  1490. # get subset for testing
  1491. subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
  1492. comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
  1493. if isinstance(comp_subset, xarray.Dataset):
  1494. comp_subset = comp_subset.band_data
  1495. # add transform for test
  1496. comp_subset.rio.write_transform(inplace=True)
  1497. # add grid mapping for test
  1498. comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
  1499. if comp_subset.rio.encoded_nodata is None:
  1500. comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
  1501.  
  1502. geometries = [
  1503. {
  1504. "type": "Polygon",
  1505. "coordinates": [
  1506. [
  1507. [425499.18381405267, 4615331.540546387],
  1508. [425499.18381405267, 4615478.540546387],
  1509. [425526.18381405267, 4615478.540546387],
  1510. [425526.18381405267, 4615331.540546387],
  1511. [425499.18381405267, 4615331.540546387],
  1512. ]
  1513. ],
  1514. }
  1515. ]
  1516. # test data array
  1517. clipped = xdi.rio.clip(geometries, from_disk=from_disk)
  1518. if from_disk and not isinstance(clipped, xarray.Dataset):
  1519. _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
  1520. if comp_subset.rio.encoded_nodata is not None:
  1521. assert numpy.isnan(clipped.values[:, 0, :]).all()
  1522. assert numpy.isnan(clipped.values[:, :, 0]).all()
  1523. else:
  1524. assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
  1525. assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
  1526. else:
  1527. if isinstance(clipped, xarray.Dataset):
  1528. clipped = clipped.band_data
  1529. > _assert_xarrays_equal(clipped, comp_subset)
  1530.  
  1531. test/integration/test_integration_rioxarray.py:580:
  1532. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1533. test/conftest.py:84: in _assert_xarrays_equal
  1534. assert_almost_equal(
  1535. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  1536. return func(*args, **kwds)
  1537. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  1538. return func(*args, **kwds)
  1539. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1540.  
  1541. args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d691120>, array([[[30692., 30696., 30699., 30702., 307... 30621.],
  1542. [30611., 30610., 30610., 30610., 30610., 30611., 30612., 30614.,
  1543. 30616.]]], dtype=float32))
  1544. kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
  1545.  
  1546. @wraps(func)
  1547. def inner(*args, **kwds):
  1548. with self._recreate_cm():
  1549. > return func(*args, **kwds)
  1550. E AssertionError:
  1551. E Arrays are not almost equal to 7 decimals
  1552. E
  1553. E Mismatched elements: 375 / 441 (85%)
  1554. E Max absolute difference: 7.
  1555. E Max relative difference: 0.00022836
  1556. E x: array([[[30692., 30696., 30699., 30702., 30704., 30705., 30705., 30704.,
  1557. E 30703.],
  1558. E [30690., 30694., 30697., 30700., 30703., 30705., 30704., 30704.,...
  1559. E y: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
  1560. E 30701.],
  1561. E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
  1562.  
  1563. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
  1564. ----------------------------- Captured stdout call -----------------------------
  1565. [30692. 30696. 30699. 30702. 30704. 30705. 30704. 30703. 30690. 30694.
  1566. 30697. 30700. 30703. 30705. 30704. 30703. 30687. 30692. 30695. 30699.
  1567. 30703. 30704. 30703. 30702. 30701. 30682. 30688. 30692. 30696. 30699.
  1568. 30702. 30701. 30700. 30678. 30684. 30689. 30691. 30695. 30698. 30674.
  1569. 30680. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30670. 30675.
  1570. 30678. 30683. 30687. 30690. 30691. 30693. 30692. 30668. 30671. 30675.
  1571. 30679. 30683. 30686. 30688. 30666. 30668. 30672. 30675. 30679. 30684.
  1572. 30685. 30686. 30663. 30666. 30668. 30672. 30676. 30680. 30681. 30682.
  1573. 30683. 30661. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30660.
  1574. 30663. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30659. 30662.
  1575. 30664. 30667. 30672. 30675. 30676. 30677. 30676. 30658. 30660. 30663.
  1576. 30665. 30668. 30671. 30673. 30674. 30673. 30659. 30661. 30663. 30665.
  1577. 30666. 30669. 30672. 30673. 30672. 30659. 30661. 30664. 30665. 30667.
  1578. 30669. 30672. 30673. 30672. 30662. 30663. 30665. 30666. 30668. 30670.
  1579. 30671. 30672. 30665. 30666. 30667. 30669. 30671. 30673. 30672. 30671.
  1580. 30668. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30670. 30671.
  1581. 30672. 30673. 30674. 30673. 30672. 30671. 30673. 30675. 30673. 30672.
  1582. 30672. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30673. 30675.
  1583. 30677. 30675. 30673. 30672. 30670. 30672. 30675. 30676. 30675. 30674.
  1584. 30673. 30672. 30671. 30675. 30676. 30675. 30674. 30673. 30668. 30672.
  1585. 30675. 30676. 30677. 30676. 30675. 30673. 30665. 30670. 30674. 30675.
  1586. 30677. 30676. 30674. 30673. 30662. 30668. 30672. 30675. 30676. 30674.
  1587. 30673. 30658. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30654.
  1588. 30661. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30650. 30657.
  1589. 30662. 30668. 30671. 30672. 30671. 30670. 30647. 30654. 30659. 30665.
  1590. 30668. 30669. 30668. 30645. 30651. 30656. 30662. 30665. 30666. 30667.
  1591. 30643. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30641.
  1592. 30646. 30651. 30655. 30659. 30661. 30662. 30639. 30644. 30648. 30652.
  1593. 30655. 30658. 30636. 30642. 30645. 30648. 30651. 30654. 30655. 30657.
  1594. 30635. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30634. 30638.
  1595. 30640. 30643. 30646. 30648. 30650. 30632. 30635. 30637. 30640. 30643.
  1596. 30645. 30647. 30630. 30632. 30635. 30636. 30639. 30641. 30643. 30644.
  1597. 30628. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30626. 30628.
  1598. 30630. 30632. 30634. 30636. 30638. 30624. 30625. 30627. 30629. 30631.
  1599. 30633. 30634. 30635. 30622. 30623. 30624. 30625. 30627. 30629. 30630.
  1600. 30631. 30620. 30621. 30622. 30623. 30625. 30626. 30627. 30617. 30616.
  1601. 30617. 30618. 30619. 30621. 30623. 30614. 30615. 30617. 30619. 30612.
  1602. 30611. 30610. 30611. 30612. 30614.]
  1603. [30696. 30699. 30702. 30704. 30705. 30704. 30703. 30701. 30694. 30697.
  1604. 30700. 30703. 30705. 30704. 30703. 30700. 30692. 30695. 30699. 30703.
  1605. 30704. 30703. 30702. 30701. 30698. 30688. 30692. 30696. 30699. 30702.
  1606. 30701. 30700. 30697. 30684. 30689. 30691. 30695. 30698. 30694. 30680.
  1607. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30691. 30675. 30678.
  1608. 30683. 30687. 30690. 30691. 30693. 30692. 30689. 30671. 30675. 30679.
  1609. 30683. 30686. 30688. 30686. 30668. 30672. 30675. 30679. 30684. 30685.
  1610. 30686. 30684. 30666. 30668. 30672. 30676. 30680. 30681. 30682. 30683.
  1611. 30680. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30676. 30663.
  1612. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30675. 30662. 30664.
  1613. 30667. 30672. 30675. 30676. 30677. 30676. 30674. 30660. 30663. 30665.
  1614. 30668. 30671. 30673. 30674. 30673. 30671. 30661. 30663. 30665. 30666.
  1615. 30669. 30672. 30673. 30672. 30669. 30661. 30664. 30665. 30667. 30669.
  1616. 30672. 30673. 30672. 30670. 30663. 30665. 30666. 30668. 30670. 30671.
  1617. 30672. 30669. 30666. 30667. 30669. 30671. 30673. 30672. 30671. 30668.
  1618. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30667. 30671. 30672.
  1619. 30673. 30674. 30673. 30672. 30668. 30673. 30675. 30673. 30672. 30668.
  1620. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30668. 30675. 30677.
  1621. 30675. 30673. 30672. 30670. 30668. 30675. 30676. 30675. 30674. 30673.
  1622. 30672. 30669. 30675. 30676. 30675. 30674. 30673. 30670. 30672. 30675.
  1623. 30676. 30677. 30676. 30675. 30673. 30671. 30670. 30674. 30675. 30677.
  1624. 30676. 30674. 30673. 30671. 30668. 30672. 30675. 30676. 30674. 30673.
  1625. 30671. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30671. 30661.
  1626. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30671. 30657. 30662.
  1627. 30668. 30671. 30672. 30671. 30670. 30669. 30654. 30659. 30665. 30668.
  1628. 30669. 30668. 30667. 30651. 30656. 30662. 30665. 30666. 30667. 30666.
  1629. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30663. 30646.
  1630. 30651. 30655. 30659. 30661. 30662. 30661. 30644. 30648. 30652. 30655.
  1631. 30658. 30659. 30642. 30645. 30648. 30651. 30654. 30655. 30657. 30656.
  1632. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30653. 30638. 30640.
  1633. 30643. 30646. 30648. 30650. 30651. 30635. 30637. 30640. 30643. 30645.
  1634. 30647. 30648. 30632. 30635. 30636. 30639. 30641. 30643. 30644. 30645.
  1635. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30642. 30628. 30630.
  1636. 30632. 30634. 30636. 30638. 30639. 30625. 30627. 30629. 30631. 30633.
  1637. 30634. 30635. 30636. 30623. 30624. 30625. 30627. 30629. 30630. 30631.
  1638. 30632. 30621. 30622. 30623. 30625. 30626. 30627. 30628. 30616. 30617.
  1639. 30618. 30619. 30621. 30623. 30625. 30615. 30617. 30619. 30621. 30611.
  1640. 30610. 30611. 30612. 30614. 30616.]
  1641. _____________________ test_clip_geojson[open_func4-False] ______________________
  1642.  
  1643. open_func = functools.partial(<function open_dataset at 0xffff5e34bc40>, engine='rasterio', parse_coordinates=False)
  1644. from_disk = False
  1645.  
  1646. @pytest.mark.parametrize("from_disk", [True, False])
  1647. @pytest.mark.parametrize(
  1648. "open_func",
  1649. [
  1650. rioxarray.open_rasterio,
  1651. partial(rioxarray.open_rasterio, parse_coordinates=False),
  1652. partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
  1653. open_rasterio_engine,
  1654. partial(open_rasterio_engine, parse_coordinates=False),
  1655. partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
  1656. ],
  1657. )
  1658. def test_clip_geojson(open_func, from_disk):
  1659. with open_func(
  1660. os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
  1661. ) as xdi:
  1662. # get subset for testing
  1663. subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
  1664. comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
  1665. if isinstance(comp_subset, xarray.Dataset):
  1666. comp_subset = comp_subset.band_data
  1667. # add transform for test
  1668. comp_subset.rio.write_transform(inplace=True)
  1669. # add grid mapping for test
  1670. comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
  1671. if comp_subset.rio.encoded_nodata is None:
  1672. comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
  1673.  
  1674. geometries = [
  1675. {
  1676. "type": "Polygon",
  1677. "coordinates": [
  1678. [
  1679. [425499.18381405267, 4615331.540546387],
  1680. [425499.18381405267, 4615478.540546387],
  1681. [425526.18381405267, 4615478.540546387],
  1682. [425526.18381405267, 4615331.540546387],
  1683. [425499.18381405267, 4615331.540546387],
  1684. ]
  1685. ],
  1686. }
  1687. ]
  1688. # test data array
  1689. clipped = xdi.rio.clip(geometries, from_disk=from_disk)
  1690. if from_disk and not isinstance(clipped, xarray.Dataset):
  1691. _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
  1692. if comp_subset.rio.encoded_nodata is not None:
  1693. assert numpy.isnan(clipped.values[:, 0, :]).all()
  1694. assert numpy.isnan(clipped.values[:, :, 0]).all()
  1695. else:
  1696. assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
  1697. assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
  1698. else:
  1699. if isinstance(clipped, xarray.Dataset):
  1700. clipped = clipped.band_data
  1701. > _assert_xarrays_equal(clipped, comp_subset)
  1702.  
  1703. test/integration/test_integration_rioxarray.py:580:
  1704. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1705. test/conftest.py:84: in _assert_xarrays_equal
  1706. assert_almost_equal(
  1707. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  1708. return func(*args, **kwds)
  1709. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  1710. return func(*args, **kwds)
  1711. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1712.  
  1713. args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d692020>, array([[[30692., 30696., 30699., 30702., 307... 30621.],
  1714. [30611., 30610., 30610., 30610., 30610., 30611., 30612., 30614.,
  1715. 30616.]]], dtype=float32))
  1716. kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
  1717.  
  1718. @wraps(func)
  1719. def inner(*args, **kwds):
  1720. with self._recreate_cm():
  1721. > return func(*args, **kwds)
  1722. E AssertionError:
  1723. E Arrays are not almost equal to 7 decimals
  1724. E
  1725. E Mismatched elements: 375 / 441 (85%)
  1726. E Max absolute difference: 7.
  1727. E Max relative difference: 0.00022836
  1728. E x: array([[[30692., 30696., 30699., 30702., 30704., 30705., 30705., 30704.,
  1729. E 30703.],
  1730. E [30690., 30694., 30697., 30700., 30703., 30705., 30704., 30704.,...
  1731. E y: array([[[30696., 30699., 30702., 30704., 30705., 30705., 30704., 30703.,
  1732. E 30701.],
  1733. E [30694., 30697., 30700., 30703., 30705., 30704., 30704., 30703.,...
  1734.  
  1735. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
  1736. ----------------------------- Captured stdout call -----------------------------
  1737. [30692. 30696. 30699. 30702. 30704. 30705. 30704. 30703. 30690. 30694.
  1738. 30697. 30700. 30703. 30705. 30704. 30703. 30687. 30692. 30695. 30699.
  1739. 30703. 30704. 30703. 30702. 30701. 30682. 30688. 30692. 30696. 30699.
  1740. 30702. 30701. 30700. 30678. 30684. 30689. 30691. 30695. 30698. 30674.
  1741. 30680. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30670. 30675.
  1742. 30678. 30683. 30687. 30690. 30691. 30693. 30692. 30668. 30671. 30675.
  1743. 30679. 30683. 30686. 30688. 30666. 30668. 30672. 30675. 30679. 30684.
  1744. 30685. 30686. 30663. 30666. 30668. 30672. 30676. 30680. 30681. 30682.
  1745. 30683. 30661. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30660.
  1746. 30663. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30659. 30662.
  1747. 30664. 30667. 30672. 30675. 30676. 30677. 30676. 30658. 30660. 30663.
  1748. 30665. 30668. 30671. 30673. 30674. 30673. 30659. 30661. 30663. 30665.
  1749. 30666. 30669. 30672. 30673. 30672. 30659. 30661. 30664. 30665. 30667.
  1750. 30669. 30672. 30673. 30672. 30662. 30663. 30665. 30666. 30668. 30670.
  1751. 30671. 30672. 30665. 30666. 30667. 30669. 30671. 30673. 30672. 30671.
  1752. 30668. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30670. 30671.
  1753. 30672. 30673. 30674. 30673. 30672. 30671. 30673. 30675. 30673. 30672.
  1754. 30672. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30673. 30675.
  1755. 30677. 30675. 30673. 30672. 30670. 30672. 30675. 30676. 30675. 30674.
  1756. 30673. 30672. 30671. 30675. 30676. 30675. 30674. 30673. 30668. 30672.
  1757. 30675. 30676. 30677. 30676. 30675. 30673. 30665. 30670. 30674. 30675.
  1758. 30677. 30676. 30674. 30673. 30662. 30668. 30672. 30675. 30676. 30674.
  1759. 30673. 30658. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30654.
  1760. 30661. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30650. 30657.
  1761. 30662. 30668. 30671. 30672. 30671. 30670. 30647. 30654. 30659. 30665.
  1762. 30668. 30669. 30668. 30645. 30651. 30656. 30662. 30665. 30666. 30667.
  1763. 30643. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30641.
  1764. 30646. 30651. 30655. 30659. 30661. 30662. 30639. 30644. 30648. 30652.
  1765. 30655. 30658. 30636. 30642. 30645. 30648. 30651. 30654. 30655. 30657.
  1766. 30635. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30634. 30638.
  1767. 30640. 30643. 30646. 30648. 30650. 30632. 30635. 30637. 30640. 30643.
  1768. 30645. 30647. 30630. 30632. 30635. 30636. 30639. 30641. 30643. 30644.
  1769. 30628. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30626. 30628.
  1770. 30630. 30632. 30634. 30636. 30638. 30624. 30625. 30627. 30629. 30631.
  1771. 30633. 30634. 30635. 30622. 30623. 30624. 30625. 30627. 30629. 30630.
  1772. 30631. 30620. 30621. 30622. 30623. 30625. 30626. 30627. 30617. 30616.
  1773. 30617. 30618. 30619. 30621. 30623. 30614. 30615. 30617. 30619. 30612.
  1774. 30611. 30610. 30611. 30612. 30614.]
  1775. [30696. 30699. 30702. 30704. 30705. 30704. 30703. 30701. 30694. 30697.
  1776. 30700. 30703. 30705. 30704. 30703. 30700. 30692. 30695. 30699. 30703.
  1777. 30704. 30703. 30702. 30701. 30698. 30688. 30692. 30696. 30699. 30702.
  1778. 30701. 30700. 30697. 30684. 30689. 30691. 30695. 30698. 30694. 30680.
  1779. 30683. 30686. 30691. 30694. 30695. 30696. 30695. 30691. 30675. 30678.
  1780. 30683. 30687. 30690. 30691. 30693. 30692. 30689. 30671. 30675. 30679.
  1781. 30683. 30686. 30688. 30686. 30668. 30672. 30675. 30679. 30684. 30685.
  1782. 30686. 30684. 30666. 30668. 30672. 30676. 30680. 30681. 30682. 30683.
  1783. 30680. 30663. 30666. 30670. 30674. 30676. 30678. 30680. 30676. 30663.
  1784. 30665. 30670. 30674. 30675. 30677. 30679. 30678. 30675. 30662. 30664.
  1785. 30667. 30672. 30675. 30676. 30677. 30676. 30674. 30660. 30663. 30665.
  1786. 30668. 30671. 30673. 30674. 30673. 30671. 30661. 30663. 30665. 30666.
  1787. 30669. 30672. 30673. 30672. 30669. 30661. 30664. 30665. 30667. 30669.
  1788. 30672. 30673. 30672. 30670. 30663. 30665. 30666. 30668. 30670. 30671.
  1789. 30672. 30669. 30666. 30667. 30669. 30671. 30673. 30672. 30671. 30668.
  1790. 30669. 30671. 30673. 30675. 30674. 30673. 30671. 30667. 30671. 30672.
  1791. 30673. 30674. 30673. 30672. 30668. 30673. 30675. 30673. 30672. 30668.
  1792. 30674. 30676. 30677. 30674. 30673. 30672. 30671. 30668. 30675. 30677.
  1793. 30675. 30673. 30672. 30670. 30668. 30675. 30676. 30675. 30674. 30673.
  1794. 30672. 30669. 30675. 30676. 30675. 30674. 30673. 30670. 30672. 30675.
  1795. 30676. 30677. 30676. 30675. 30673. 30671. 30670. 30674. 30675. 30677.
  1796. 30676. 30674. 30673. 30671. 30668. 30672. 30675. 30676. 30674. 30673.
  1797. 30671. 30665. 30669. 30673. 30674. 30675. 30674. 30672. 30671. 30661.
  1798. 30666. 30671. 30672. 30673. 30674. 30673. 30672. 30671. 30657. 30662.
  1799. 30668. 30671. 30672. 30671. 30670. 30669. 30654. 30659. 30665. 30668.
  1800. 30669. 30668. 30667. 30651. 30656. 30662. 30665. 30666. 30667. 30666.
  1801. 30649. 30654. 30659. 30662. 30663. 30664. 30666. 30665. 30663. 30646.
  1802. 30651. 30655. 30659. 30661. 30662. 30661. 30644. 30648. 30652. 30655.
  1803. 30658. 30659. 30642. 30645. 30648. 30651. 30654. 30655. 30657. 30656.
  1804. 30640. 30642. 30646. 30649. 30650. 30652. 30654. 30653. 30638. 30640.
  1805. 30643. 30646. 30648. 30650. 30651. 30635. 30637. 30640. 30643. 30645.
  1806. 30647. 30648. 30632. 30635. 30636. 30639. 30641. 30643. 30644. 30645.
  1807. 30630. 30633. 30634. 30635. 30637. 30639. 30641. 30642. 30628. 30630.
  1808. 30632. 30634. 30636. 30638. 30639. 30625. 30627. 30629. 30631. 30633.
  1809. 30634. 30635. 30636. 30623. 30624. 30625. 30627. 30629. 30630. 30631.
  1810. 30632. 30621. 30622. 30623. 30625. 30626. 30627. 30628. 30616. 30617.
  1811. 30618. 30619. 30621. 30623. 30625. 30615. 30617. 30619. 30621. 30611.
  1812. 30610. 30611. 30612. 30614. 30616.]
  1813. ______________________ test_clip_geojson[open_func5-True] ______________________
  1814.  
  1815. open_func = functools.partial(<function open_dataset at 0xffff5e34bc40>, engine='rasterio', parse_coordinates=False, mask_and_scale=False)
  1816. from_disk = True
  1817.  
  1818. @pytest.mark.parametrize("from_disk", [True, False])
  1819. @pytest.mark.parametrize(
  1820. "open_func",
  1821. [
  1822. rioxarray.open_rasterio,
  1823. partial(rioxarray.open_rasterio, parse_coordinates=False),
  1824. partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
  1825. open_rasterio_engine,
  1826. partial(open_rasterio_engine, parse_coordinates=False),
  1827. partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
  1828. ],
  1829. )
  1830. def test_clip_geojson(open_func, from_disk):
  1831. with open_func(
  1832. os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
  1833. ) as xdi:
  1834. # get subset for testing
  1835. subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
  1836. comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
  1837. if isinstance(comp_subset, xarray.Dataset):
  1838. comp_subset = comp_subset.band_data
  1839. # add transform for test
  1840. comp_subset.rio.write_transform(inplace=True)
  1841. # add grid mapping for test
  1842. comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
  1843. if comp_subset.rio.encoded_nodata is None:
  1844. comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
  1845.  
  1846. geometries = [
  1847. {
  1848. "type": "Polygon",
  1849. "coordinates": [
  1850. [
  1851. [425499.18381405267, 4615331.540546387],
  1852. [425499.18381405267, 4615478.540546387],
  1853. [425526.18381405267, 4615478.540546387],
  1854. [425526.18381405267, 4615331.540546387],
  1855. [425499.18381405267, 4615331.540546387],
  1856. ]
  1857. ],
  1858. }
  1859. ]
  1860. # test data array
  1861. clipped = xdi.rio.clip(geometries, from_disk=from_disk)
  1862. if from_disk and not isinstance(clipped, xarray.Dataset):
  1863. _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
  1864. if comp_subset.rio.encoded_nodata is not None:
  1865. assert numpy.isnan(clipped.values[:, 0, :]).all()
  1866. assert numpy.isnan(clipped.values[:, :, 0]).all()
  1867. else:
  1868. assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
  1869. assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
  1870. else:
  1871. if isinstance(clipped, xarray.Dataset):
  1872. clipped = clipped.band_data
  1873. > _assert_xarrays_equal(clipped, comp_subset)
  1874.  
  1875. test/integration/test_integration_rioxarray.py:580:
  1876. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1877. test/conftest.py:84: in _assert_xarrays_equal
  1878. assert_almost_equal(
  1879. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  1880. return func(*args, **kwds)
  1881. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  1882. return func(*args, **kwds)
  1883. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1884.  
  1885. args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d6b4220>, array([[[30692, 30696, 30699, 30702, 30704, ..., 30617, 30619, 30621],
  1886. [30611, 30610, 30610, 30610, 30610, 30611, 30612, 30614, 30616]]],
  1887. dtype=uint16))
  1888. kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
  1889.  
  1890. @wraps(func)
  1891. def inner(*args, **kwds):
  1892. with self._recreate_cm():
  1893. > return func(*args, **kwds)
  1894. E AssertionError:
  1895. E Arrays are not almost equal to 7 decimals
  1896. E
  1897. E Mismatched elements: 375 / 441 (85%)
  1898. E Max absolute difference: 7
  1899. E Max relative difference: 0.00022836
  1900. E x: array([[[30692, 30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703],
  1901. E [30690, 30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703],
  1902. E [30687, 30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701],...
  1903. E y: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 30701],
  1904. E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 30700],
  1905. E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 30698],...
  1906.  
  1907. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
  1908. ----------------------------- Captured stdout call -----------------------------
  1909. [30692 30696 30699 30702 30704 30705 30704 30703 30690 30694 30697 30700
  1910. 30703 30705 30704 30703 30687 30692 30695 30699 30703 30704 30703 30702
  1911. 30701 30682 30688 30692 30696 30699 30702 30701 30700 30678 30684 30689
  1912. 30691 30695 30698 30674 30680 30683 30686 30691 30694 30695 30696 30695
  1913. 30670 30675 30678 30683 30687 30690 30691 30693 30692 30668 30671 30675
  1914. 30679 30683 30686 30688 30666 30668 30672 30675 30679 30684 30685 30686
  1915. 30663 30666 30668 30672 30676 30680 30681 30682 30683 30661 30663 30666
  1916. 30670 30674 30676 30678 30680 30660 30663 30665 30670 30674 30675 30677
  1917. 30679 30678 30659 30662 30664 30667 30672 30675 30676 30677 30676 30658
  1918. 30660 30663 30665 30668 30671 30673 30674 30673 30659 30661 30663 30665
  1919. 30666 30669 30672 30673 30672 30659 30661 30664 30665 30667 30669 30672
  1920. 30673 30672 30662 30663 30665 30666 30668 30670 30671 30672 30665 30666
  1921. 30667 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674
  1922. 30673 30671 30670 30671 30672 30673 30674 30673 30672 30671 30673 30675
  1923. 30673 30672 30672 30674 30676 30677 30674 30673 30672 30671 30673 30675
  1924. 30677 30675 30673 30672 30670 30672 30675 30676 30675 30674 30673 30672
  1925. 30671 30675 30676 30675 30674 30673 30668 30672 30675 30676 30677 30676
  1926. 30675 30673 30665 30670 30674 30675 30677 30676 30674 30673 30662 30668
  1927. 30672 30675 30676 30674 30673 30658 30665 30669 30673 30674 30675 30674
  1928. 30672 30654 30661 30666 30671 30672 30673 30674 30673 30672 30650 30657
  1929. 30662 30668 30671 30672 30671 30670 30647 30654 30659 30665 30668 30669
  1930. 30668 30645 30651 30656 30662 30665 30666 30667 30643 30649 30654 30659
  1931. 30662 30663 30664 30666 30665 30641 30646 30651 30655 30659 30661 30662
  1932. 30639 30644 30648 30652 30655 30658 30636 30642 30645 30648 30651 30654
  1933. 30655 30657 30635 30640 30642 30646 30649 30650 30652 30654 30634 30638
  1934. 30640 30643 30646 30648 30650 30632 30635 30637 30640 30643 30645 30647
  1935. 30630 30632 30635 30636 30639 30641 30643 30644 30628 30630 30633 30634
  1936. 30635 30637 30639 30641 30626 30628 30630 30632 30634 30636 30638 30624
  1937. 30625 30627 30629 30631 30633 30634 30635 30622 30623 30624 30625 30627
  1938. 30629 30630 30631 30620 30621 30622 30623 30625 30626 30627 30617 30616
  1939. 30617 30618 30619 30621 30623 30614 30615 30617 30619 30612 30611 30610
  1940. 30611 30612 30614]
  1941. [30696 30699 30702 30704 30705 30704 30703 30701 30694 30697 30700 30703
  1942. 30705 30704 30703 30700 30692 30695 30699 30703 30704 30703 30702 30701
  1943. 30698 30688 30692 30696 30699 30702 30701 30700 30697 30684 30689 30691
  1944. 30695 30698 30694 30680 30683 30686 30691 30694 30695 30696 30695 30691
  1945. 30675 30678 30683 30687 30690 30691 30693 30692 30689 30671 30675 30679
  1946. 30683 30686 30688 30686 30668 30672 30675 30679 30684 30685 30686 30684
  1947. 30666 30668 30672 30676 30680 30681 30682 30683 30680 30663 30666 30670
  1948. 30674 30676 30678 30680 30676 30663 30665 30670 30674 30675 30677 30679
  1949. 30678 30675 30662 30664 30667 30672 30675 30676 30677 30676 30674 30660
  1950. 30663 30665 30668 30671 30673 30674 30673 30671 30661 30663 30665 30666
  1951. 30669 30672 30673 30672 30669 30661 30664 30665 30667 30669 30672 30673
  1952. 30672 30670 30663 30665 30666 30668 30670 30671 30672 30669 30666 30667
  1953. 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674 30673
  1954. 30671 30667 30671 30672 30673 30674 30673 30672 30668 30673 30675 30673
  1955. 30672 30668 30674 30676 30677 30674 30673 30672 30671 30668 30675 30677
  1956. 30675 30673 30672 30670 30668 30675 30676 30675 30674 30673 30672 30669
  1957. 30675 30676 30675 30674 30673 30670 30672 30675 30676 30677 30676 30675
  1958. 30673 30671 30670 30674 30675 30677 30676 30674 30673 30671 30668 30672
  1959. 30675 30676 30674 30673 30671 30665 30669 30673 30674 30675 30674 30672
  1960. 30671 30661 30666 30671 30672 30673 30674 30673 30672 30671 30657 30662
  1961. 30668 30671 30672 30671 30670 30669 30654 30659 30665 30668 30669 30668
  1962. 30667 30651 30656 30662 30665 30666 30667 30666 30649 30654 30659 30662
  1963. 30663 30664 30666 30665 30663 30646 30651 30655 30659 30661 30662 30661
  1964. 30644 30648 30652 30655 30658 30659 30642 30645 30648 30651 30654 30655
  1965. 30657 30656 30640 30642 30646 30649 30650 30652 30654 30653 30638 30640
  1966. 30643 30646 30648 30650 30651 30635 30637 30640 30643 30645 30647 30648
  1967. 30632 30635 30636 30639 30641 30643 30644 30645 30630 30633 30634 30635
  1968. 30637 30639 30641 30642 30628 30630 30632 30634 30636 30638 30639 30625
  1969. 30627 30629 30631 30633 30634 30635 30636 30623 30624 30625 30627 30629
  1970. 30630 30631 30632 30621 30622 30623 30625 30626 30627 30628 30616 30617
  1971. 30618 30619 30621 30623 30625 30615 30617 30619 30621 30611 30610 30611
  1972. 30612 30614 30616]
  1973. _____________________ test_clip_geojson[open_func5-False] ______________________
  1974.  
  1975. open_func = functools.partial(<function open_dataset at 0xffff5e34bc40>, engine='rasterio', parse_coordinates=False, mask_and_scale=False)
  1976. from_disk = False
  1977.  
  1978. @pytest.mark.parametrize("from_disk", [True, False])
  1979. @pytest.mark.parametrize(
  1980. "open_func",
  1981. [
  1982. rioxarray.open_rasterio,
  1983. partial(rioxarray.open_rasterio, parse_coordinates=False),
  1984. partial(rioxarray.open_rasterio, parse_coordinates=False, masked=True),
  1985. open_rasterio_engine,
  1986. partial(open_rasterio_engine, parse_coordinates=False),
  1987. partial(open_rasterio_engine, parse_coordinates=False, mask_and_scale=False),
  1988. ],
  1989. )
  1990. def test_clip_geojson(open_func, from_disk):
  1991. with open_func(
  1992. os.path.join(TEST_COMPARE_DATA_DIR, "small_dem_3m_merged.tif"),
  1993. ) as xdi:
  1994. # get subset for testing
  1995. subset = xdi.isel(x=slice(150, 160), y=slice(100, 150))
  1996. comp_subset = subset.isel(x=slice(1, None), y=slice(1, None))
  1997. if isinstance(comp_subset, xarray.Dataset):
  1998. comp_subset = comp_subset.band_data
  1999. # add transform for test
  2000. comp_subset.rio.write_transform(inplace=True)
  2001. # add grid mapping for test
  2002. comp_subset.rio.write_crs(subset.rio.crs, inplace=True)
  2003. if comp_subset.rio.encoded_nodata is None:
  2004. comp_subset.rio.write_nodata(comp_subset.rio.nodata, inplace=True)
  2005.  
  2006. geometries = [
  2007. {
  2008. "type": "Polygon",
  2009. "coordinates": [
  2010. [
  2011. [425499.18381405267, 4615331.540546387],
  2012. [425499.18381405267, 4615478.540546387],
  2013. [425526.18381405267, 4615478.540546387],
  2014. [425526.18381405267, 4615331.540546387],
  2015. [425499.18381405267, 4615331.540546387],
  2016. ]
  2017. ],
  2018. }
  2019. ]
  2020. # test data array
  2021. clipped = xdi.rio.clip(geometries, from_disk=from_disk)
  2022. if from_disk and not isinstance(clipped, xarray.Dataset):
  2023. _assert_xarrays_equal(clipped[:, 1:, 1:], comp_subset)
  2024. if comp_subset.rio.encoded_nodata is not None:
  2025. assert numpy.isnan(clipped.values[:, 0, :]).all()
  2026. assert numpy.isnan(clipped.values[:, :, 0]).all()
  2027. else:
  2028. assert (clipped.values[:, 0, :] == comp_subset.rio.nodata).all()
  2029. assert (clipped.values[:, :, 0] == comp_subset.rio.nodata).all()
  2030. else:
  2031. if isinstance(clipped, xarray.Dataset):
  2032. clipped = clipped.band_data
  2033. > _assert_xarrays_equal(clipped, comp_subset)
  2034.  
  2035. test/integration/test_integration_rioxarray.py:580:
  2036. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2037. test/conftest.py:84: in _assert_xarrays_equal
  2038. assert_almost_equal(
  2039. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  2040. return func(*args, **kwds)
  2041. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: in inner
  2042. return func(*args, **kwds)
  2043. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  2044.  
  2045. args = (<function assert_array_almost_equal.<locals>.compare at 0xffff5d691300>, array([[[30692, 30696, 30699, 30702, 30704, ..., 30617, 30619, 30621],
  2046. [30611, 30610, 30610, 30610, 30610, 30611, 30612, 30614, 30616]]],
  2047. dtype=uint16))
  2048. kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}
  2049.  
  2050. @wraps(func)
  2051. def inner(*args, **kwds):
  2052. with self._recreate_cm():
  2053. > return func(*args, **kwds)
  2054. E AssertionError:
  2055. E Arrays are not almost equal to 7 decimals
  2056. E
  2057. E Mismatched elements: 375 / 441 (85%)
  2058. E Max absolute difference: 7
  2059. E Max relative difference: 0.00022836
  2060. E x: array([[[30692, 30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703],
  2061. E [30690, 30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703],
  2062. E [30687, 30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701],...
  2063. E y: array([[[30696, 30699, 30702, 30704, 30705, 30705, 30704, 30703, 30701],
  2064. E [30694, 30697, 30700, 30703, 30705, 30704, 30704, 30703, 30700],
  2065. E [30692, 30695, 30699, 30703, 30704, 30703, 30702, 30701, 30698],...
  2066.  
  2067. /nix/store/q3x28mimkawkdjlvd78jxv3s0fk25vz8-python3-3.11.9/lib/python3.11/contextlib.py:81: AssertionError
  2068. ----------------------------- Captured stdout call -----------------------------
  2069. [30692 30696 30699 30702 30704 30705 30704 30703 30690 30694 30697 30700
  2070. 30703 30705 30704 30703 30687 30692 30695 30699 30703 30704 30703 30702
  2071. 30701 30682 30688 30692 30696 30699 30702 30701 30700 30678 30684 30689
  2072. 30691 30695 30698 30674 30680 30683 30686 30691 30694 30695 30696 30695
  2073. 30670 30675 30678 30683 30687 30690 30691 30693 30692 30668 30671 30675
  2074. 30679 30683 30686 30688 30666 30668 30672 30675 30679 30684 30685 30686
  2075. 30663 30666 30668 30672 30676 30680 30681 30682 30683 30661 30663 30666
  2076. 30670 30674 30676 30678 30680 30660 30663 30665 30670 30674 30675 30677
  2077. 30679 30678 30659 30662 30664 30667 30672 30675 30676 30677 30676 30658
  2078. 30660 30663 30665 30668 30671 30673 30674 30673 30659 30661 30663 30665
  2079. 30666 30669 30672 30673 30672 30659 30661 30664 30665 30667 30669 30672
  2080. 30673 30672 30662 30663 30665 30666 30668 30670 30671 30672 30665 30666
  2081. 30667 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674
  2082. 30673 30671 30670 30671 30672 30673 30674 30673 30672 30671 30673 30675
  2083. 30673 30672 30672 30674 30676 30677 30674 30673 30672 30671 30673 30675
  2084. 30677 30675 30673 30672 30670 30672 30675 30676 30675 30674 30673 30672
  2085. 30671 30675 30676 30675 30674 30673 30668 30672 30675 30676 30677 30676
  2086. 30675 30673 30665 30670 30674 30675 30677 30676 30674 30673 30662 30668
  2087. 30672 30675 30676 30674 30673 30658 30665 30669 30673 30674 30675 30674
  2088. 30672 30654 30661 30666 30671 30672 30673 30674 30673 30672 30650 30657
  2089. 30662 30668 30671 30672 30671 30670 30647 30654 30659 30665 30668 30669
  2090. 30668 30645 30651 30656 30662 30665 30666 30667 30643 30649 30654 30659
  2091. 30662 30663 30664 30666 30665 30641 30646 30651 30655 30659 30661 30662
  2092. 30639 30644 30648 30652 30655 30658 30636 30642 30645 30648 30651 30654
  2093. 30655 30657 30635 30640 30642 30646 30649 30650 30652 30654 30634 30638
  2094. 30640 30643 30646 30648 30650 30632 30635 30637 30640 30643 30645 30647
  2095. 30630 30632 30635 30636 30639 30641 30643 30644 30628 30630 30633 30634
  2096. 30635 30637 30639 30641 30626 30628 30630 30632 30634 30636 30638 30624
  2097. 30625 30627 30629 30631 30633 30634 30635 30622 30623 30624 30625 30627
  2098. 30629 30630 30631 30620 30621 30622 30623 30625 30626 30627 30617 30616
  2099. 30617 30618 30619 30621 30623 30614 30615 30617 30619 30612 30611 30610
  2100. 30611 30612 30614]
  2101. [30696 30699 30702 30704 30705 30704 30703 30701 30694 30697 30700 30703
  2102. 30705 30704 30703 30700 30692 30695 30699 30703 30704 30703 30702 30701
  2103. 30698 30688 30692 30696 30699 30702 30701 30700 30697 30684 30689 30691
  2104. 30695 30698 30694 30680 30683 30686 30691 30694 30695 30696 30695 30691
  2105. 30675 30678 30683 30687 30690 30691 30693 30692 30689 30671 30675 30679
  2106. 30683 30686 30688 30686 30668 30672 30675 30679 30684 30685 30686 30684
  2107. 30666 30668 30672 30676 30680 30681 30682 30683 30680 30663 30666 30670
  2108. 30674 30676 30678 30680 30676 30663 30665 30670 30674 30675 30677 30679
  2109. 30678 30675 30662 30664 30667 30672 30675 30676 30677 30676 30674 30660
  2110. 30663 30665 30668 30671 30673 30674 30673 30671 30661 30663 30665 30666
  2111. 30669 30672 30673 30672 30669 30661 30664 30665 30667 30669 30672 30673
  2112. 30672 30670 30663 30665 30666 30668 30670 30671 30672 30669 30666 30667
  2113. 30669 30671 30673 30672 30671 30668 30669 30671 30673 30675 30674 30673
  2114. 30671 30667 30671 30672 30673 30674 30673 30672 30668 30673 30675 30673
  2115. 30672 30668 30674 30676 30677 30674 30673 30672 30671 30668 30675 30677
  2116. 30675 30673 30672 30670 30668 30675 30676 30675 30674 30673 30672 30669
  2117. 30675 30676 30675 30674 30673 30670 30672 30675 30676 30677 30676 30675
  2118. 30673 30671 30670 30674 30675 30677 30676 30674 30673 30671 30668 30672
  2119. 30675 30676 30674 30673 30671 30665 30669 30673 30674 30675 30674 30672
  2120. 30671 30661 30666 30671 30672 30673 30674 30673 30672 30671 30657 30662
  2121. 30668 30671 30672 30671 30670 30669 30654 30659 30665 30668 30669 30668
  2122. 30667 30651 30656 30662 30665 30666 30667 30666 30649 30654 30659 30662
  2123. 30663 30664 30666 30665 30663 30646 30651 30655 30659 30661 30662 30661
  2124. 30644 30648 30652 30655 30658 30659 30642 30645 30648 30651 30654 30655
  2125. 30657 30656 30640 30642 30646 30649 30650 30652 30654 30653 30638 30640
  2126. 30643 30646 30648 30650 30651 30635 30637 30640 30643 30645 30647 30648
  2127. 30632 30635 30636 30639 30641 30643 30644 30645 30630 30633 30634 30635
  2128. 30637 30639 30641 30642 30628 30630 30632 30634 30636 30638 30639 30625
  2129. 30627 30629 30631 30633 30634 30635 30636 30623 30624 30625 30627 30629
  2130. 30630 30631 30632 30621 30622 30623 30625 30626 30627 30628 30616 30617
  2131. 30618 30619 30621 30623 30625 30615 30617 30619 30621 30611 30610 30611
  2132. 30612 30614 30616]
  2133. =============================== warnings summary ===============================
  2134. test/integration/test_integration__io.py:841
  2135. /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
  2136. @pytest.mark.timeout(30)
  2137.  
  2138. test/integration/test_integration__io.py:914
  2139. /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
  2140. @pytest.mark.timeout(30)
  2141.  
  2142. test/integration/test_integration__io.py: 20 warnings
  2143. test/integration/test_integration_rioxarray.py: 178 warnings
  2144. /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.
  2145. new_val = numpy.fromstring(value.strip("{}"), dtype="float", sep=",")
  2146.  
  2147. test/integration/test_integration__io.py::test_open_multiple_resolution
  2148. test/integration/test_integration__io.py::test_nc_attr_loading[open_rasterio]
  2149. test/integration/test_integration__io.py::test_nc_attr_loading[open_rasterio1]
  2150. test/integration/test_integration__io.py::test_nc_attr_loading__disable_decode_times[open_rasterio]
  2151. test/integration/test_integration__io.py::test_nc_attr_loading__disable_decode_times[open_rasterio1]
  2152. <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`.
  2153.  
  2154. test/integration/test_integration__io.py::test_open_multiple_resolution
  2155. test/integration/test_integration__io.py::test_nc_attr_loading[open_rasterio]
  2156. test/integration/test_integration__io.py::test_nc_attr_loading[open_rasterio1]
  2157. test/integration/test_integration__io.py::test_nc_attr_loading__disable_decode_times[open_rasterio]
  2158. test/integration/test_integration__io.py::test_nc_attr_loading__disable_decode_times[open_rasterio1]
  2159. <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`.
  2160.  
  2161. test/integration/test_integration__io.py::test_open_group_filter[open_rasterio]
  2162. /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.
  2163. for v in variables.values():
  2164.  
  2165. test/integration/test_integration__io.py::test_open_group_filter[open_rasterio]
  2166. /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.
  2167. for v in variables.values():
  2168.  
  2169. test/integration/test_integration__io.py: 7 warnings
  2170. test/integration/test_integration_rioxarray.py: 39 warnings
  2171. /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.
  2172. return result.chunk(chunks, name_prefix=name_prefix, token=token)
  2173.  
  2174. test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
  2175. /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.
  2176. int_part, frac_part = zip(*(s.split('.') for s in strs))
  2177.  
  2178. test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
  2179. /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.
  2180. int_part, frac_part = zip(*(s.split('.') for s in strs))
  2181.  
  2182. test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
  2183. /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.
  2184. int_part, frac_part = zip(*(s.split('.') for s in strs))
  2185.  
  2186. test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
  2187. /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.
  2188. int_part, frac_part = zip(*(s.split('.') for s in strs))
  2189.  
  2190. test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
  2191. /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.
  2192. int_part, frac_part = zip(*(s.split('.') for s in strs))
  2193.  
  2194. test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
  2195. /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.
  2196. int_part, frac_part = zip(*(s.split('.') for s in strs))
  2197.  
  2198. test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
  2199. /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.
  2200. int_part, frac_part = zip(*(s.split('.') for s in strs))
  2201.  
  2202. test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip
  2203. /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.
  2204. int_part, frac_part = zip(*(s.split('.') for s in strs))
  2205.  
  2206. test/integration/test_integration__io.py::test_serialization
  2207. <frozen importlib._bootstrap>:241: RuntimeWarning: numpy.ndarray size changed, may indicate binary incompatibility. Expected 16 from C header, got 96 from PyObject
  2208.  
  2209. test/integration/test_integration__io.py: 12 warnings
  2210. /build/source/test/integration/test_integration__io.py:498: DeprecationWarning: dropping variables using `drop` is deprecated; use drop_vars.
  2211. raster_ds[band_name], expected.sel(band=band).drop("band")
  2212.  
  2213. test/integration/test_integration__io.py::test_band_as_variable[open_rasterio]
  2214. /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.
  2215. object.__setattr__(self, name, value)
  2216.  
  2217. test/integration/test_integration__io.py::test_band_as_variable[open_rasterio]
  2218. /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.
  2219. object.__setattr__(self, name, value)
  2220.  
  2221. test/integration/test_integration__io.py::test_band_as_variable[open_rasterio1]
  2222. /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.
  2223. for k, j in zip(x, y):
  2224.  
  2225. test/integration/test_integration__io.py::test_band_as_variable[open_rasterio1]
  2226. /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.
  2227. for k, j in zip(x, y):
  2228.  
  2229. test/integration/test_integration__io.py::test_band_as_variable[open_rasterio1]
  2230. /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.
  2231. for k, j in zip(x, y):
  2232.  
  2233. test/integration/test_integration__io.py::test_band_as_variable[open_rasterio1]
  2234. /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.
  2235. for k, j in zip(x, y):
  2236.  
  2237. test/integration/test_integration__io.py::test_band_as_variable[open_rasterio1]
  2238. /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.
  2239. object.__setattr__(self, name, value)
  2240.  
  2241. test/integration/test_integration__io.py::test_band_as_variable[open_rasterio1]
  2242. /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.
  2243. object.__setattr__(self, name, value)
  2244.  
  2245. test/integration/test_integration__io.py::test_band_as_variable[open_rasterio1]
  2246. /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.
  2247. object.__setattr__(self, name, value)
  2248.  
  2249. test/integration/test_integration__io.py::test_notransform
  2250. test/integration/test_integration__io.py::test_rasterio_vrt_gcps
  2251. test/integration/test_integration__io.py::test_rasterio_vrt_warp_extras
  2252. test/integration/test_integration__io.py::test_notgeoreferenced_warning[open_rasterio]
  2253. test/integration/test_integration__io.py::test_notgeoreferenced_warning[open_rasterio1]
  2254. test/integration/test_integration__io.py::test_reading_gcps
  2255. test/integration/test_integration__io.py::test_writing_gcps
  2256. test/integration/test_integration_rioxarray.py::test_reproject__gcps_kwargs
  2257. test/integration/test_integration_rioxarray.py::test_reproject__gcps_file
  2258. /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.
  2259. dataset = writer(
  2260.  
  2261. test/integration/test_integration__io.py::test_notransform
  2262. test/integration/test_integration__io.py::test_mask_and_scale__unicode[open_rasterio]
  2263. test/integration/test_integration__io.py::test_mask_and_scale__unicode[open_rasterio1]
  2264. test/integration/test_integration__io.py::test_mask_and_scale__unicode__to_raster[open_rasterio]
  2265. test/integration/test_integration__io.py::test_mask_and_scale__unicode__to_raster[open_rasterio1]
  2266. /build/source/rioxarray/_io.py:1132: NotGeoreferencedWarning: Dataset has no geotransform, gcps, or rpcs. The identity matrix will be returned.
  2267. warnings.warn(str(rio_warning.message), type(rio_warning.message)) # type: ignore
  2268.  
  2269. test/integration/test_integration__io.py::test_indexing
  2270. /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.
  2271. token = NO_NEP50_WARNING.set(True)
  2272.  
  2273. test/integration/test_integration__io.py::test_chunks_with_mask_and_scale
  2274. /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.
  2275. return tuple(slice(*s, None) for s in loc)
  2276.  
  2277. test/integration/test_integration__io.py::test_rasterio_vrt[True]
  2278. /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.
  2279. with rioxarray.open_rasterio(
  2280.  
  2281. test/integration/test_integration__io.py::test_mask_and_scale__unicode__to_raster[open_rasterio]
  2282. test/integration/test_integration__io.py::test_mask_and_scale__unicode__to_raster[open_rasterio1]
  2283. test/integration/test_integration__io.py::test_writing_gcps
  2284. /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.
  2285. dataset = writer(
  2286.  
  2287. test/integration/test_integration__io.py::test_nc_attr_loading[open_rasterio1]
  2288. /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.
  2289. id_coord_names[v].append(k)
  2290.  
  2291. test/integration/test_integration__io.py::test_nc_attr_loading[open_rasterio1]
  2292. /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.
  2293. id_coord_names[v].append(k)
  2294.  
  2295. test/integration/test_integration__io.py::test_cint16_dtype[None]
  2296. test/integration/test_integration__io.py::test_cint16_dtype[complex_int16]
  2297. test/integration/test_integration__io.py::test_cint16_dtype_nodata
  2298. test/integration/test_integration__io.py::test_cint16_dtype_masked[None]
  2299. test/integration/test_integration__io.py::test_cint16_dtype_masked[complex_int16]
  2300. test/integration/test_integration__io.py::test_cint16_promote_dtype
  2301. test/integration/test_integration__io.py::test_cint16_promote_dtype
  2302. /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
  2303. nodata = float(nodata)
  2304.  
  2305. test/integration/test_integration_rioxarray.py::test_reproject_match__rotated
  2306. test/integration/test_integration_rioxarray.py::test_reproject_match__rotated
  2307. /build/source/rioxarray/rioxarray.py:655: UserWarning: Transform that is non-rectilinear or with rotation found. Unable to recalculate.
  2308. warnings.warn(
  2309.  
  2310. test/integration/test_integration_rioxarray.py::test_interpolate_na__nodata_filled[interpolate_na_filled2]
  2311. /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.
  2312. compile(modname, "", "eval") # to catch syntaxerrors
  2313.  
  2314. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method0]
  2315. /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.
  2316. unmatched_keys = set(indexes) ^ set(variables)
  2317.  
  2318. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
  2319. /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.
  2320. super().__init__(new_key)
  2321.  
  2322. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
  2323. /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.
  2324. super().__init__(new_key)
  2325.  
  2326. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
  2327. /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.
  2328. super().__init__(new_key)
  2329.  
  2330. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
  2331. /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.
  2332. super().__init__(new_key)
  2333.  
  2334. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
  2335. /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.
  2336. super().__init__(new_key)
  2337.  
  2338. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
  2339. /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.
  2340. super().__init__(new_key)
  2341.  
  2342. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
  2343. /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.
  2344. super().__init__(new_key)
  2345.  
  2346. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
  2347. /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.
  2348. super().__init__(new_key)
  2349.  
  2350. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-True-True-open_method2]
  2351. /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.
  2352. super().__init__(new_key)
  2353.  
  2354. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock1-False-False-False-open_method1]
  2355. /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.
  2356. unmatched_keys = set(indexes) ^ set(variables)
  2357.  
  2358. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-True-True-open_method0]
  2359. /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.
  2360. self.__coord_name_id = {k: id(idx) for k, idx in self._indexes.items()}
  2361.  
  2362. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method1]
  2363. /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.
  2364. self._d.update(dict.fromkeys(values))
  2365.  
  2366. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
  2367. /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.
  2368. inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
  2369.  
  2370. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
  2371. /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.
  2372. inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
  2373.  
  2374. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
  2375. /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.
  2376. inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
  2377.  
  2378. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
  2379. /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.
  2380. inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
  2381.  
  2382. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
  2383. /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.
  2384. inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
  2385.  
  2386. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
  2387. /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.
  2388. inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
  2389.  
  2390. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
  2391. /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.
  2392. inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
  2393.  
  2394. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
  2395. /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.
  2396. inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
  2397.  
  2398. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
  2399. /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.
  2400. inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
  2401.  
  2402. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
  2403. /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.
  2404. inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
  2405.  
  2406. test/integration/test_integration_rioxarray.py::test_to_raster[write_lock2-True-False-False-open_method2]
  2407. /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.
  2408. inp.output: {d for d, v in inp.indices if v is not None and d in inputs}
  2409.  
  2410. test/integration/test_integration_rioxarray.py::test_to_raster_3d[None-False-True-open_method0]
  2411. /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.
  2412. for dim, size in zip(var.dims, var.shape):
  2413.  
  2414. test/integration/test_integration_rioxarray.py::test_to_raster_3d[write_lock1-False-True-open_method2]
  2415. /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.
  2416. _add(result[val], k)
  2417.  
  2418. test/integration/test_integration_rioxarray.py::test_to_raster_3d[write_lock1-False-True-open_method2]
  2419. /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.
  2420. _add(result[val], k)
  2421.  
  2422. test/integration/test_integration_rioxarray.py::test_to_raster_3d[write_lock1-False-True-open_method2]
  2423. /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.
  2424. _add(result[val], k)
  2425.  
  2426. test/integration/test_integration_rioxarray.py::test_to_raster_3d[write_lock1-False-True-open_method2]
  2427. /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.
  2428. _add(result[val], k)
  2429.  
  2430. test/integration/test_integration_rioxarray.py::test_to_raster_3d[write_lock1-False-True-open_method2]
  2431. /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.
  2432. _add(result[val], k)
  2433.  
  2434. test/integration/test_integration_rioxarray.py::test_to_raster_3d[write_lock2-True-True-open_method4]
  2435. /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.
  2436. for index in self._indexes.values():
  2437.  
  2438. test/integration/test_integration_rioxarray.py::test_write_nodata__array__copy
  2439. /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.
  2440. return FrozenList((self.name,))
  2441.  
  2442. test/integration/test_integration_rioxarray.py::test_write_nodata__array__copy
  2443. /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.
  2444. return FrozenList((self.name,))
  2445.  
  2446. test/integration/test_integration_xarray_plugin.py::test_xarray_open_dataset__drop_variables
  2447. /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.
  2448. return iter(self.mapping)
  2449.  
  2450. test/integration/test_integration_xarray_plugin.py::test_xarray_open_dataset__drop_variables
  2451. /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.
  2452. return iter(self.mapping)
  2453.  
  2454. test/integration/test_integration_xarray_plugin.py::test_xarray_open_dataset__drop_variables
  2455. /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.
  2456. return iter(self.mapping)
  2457.  
  2458. -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
  2459. =========================== short test summary info ============================
  2460. FAILED test/integration/test_integration__io.py::test_open_rasterio_mask_chunk_clip - AssertionError:
  2461. FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_rasterio-True] - AssertionError:
  2462. FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_rasterio-False] - AssertionError:
  2463. FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func1-True] - AssertionError:
  2464. FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func1-False] - AssertionError:
  2465. FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func2-True] - AssertionError:
  2466. FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func2-False] - AssertionError:
  2467. FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func3-True] - AssertionError:
  2468. FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func3-False] - AssertionError:
  2469. FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func4-True] - AssertionError:
  2470. FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func4-False] - AssertionError:
  2471. FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func5-True] - AssertionError:
  2472. FAILED test/integration/test_integration_rioxarray.py::test_clip_geojson[open_func5-False] - AssertionError:
  2473. = 13 failed, 417 passed, 17 skipped, 8 deselected, 2 xfailed, 2 xpassed, 356 warnings in 21.49s =
  2474. /nix/store/hyaqjk5jdavx2zjk3s79ahz87xxcz0a2-stdenv-linux/setup: line 1579: pop_var_context: head of shell_variables not a function context
  2475.  
Advertisement
Add Comment
Please, Sign In to add comment