paleolimbot commented on code in PR #1218:
URL: https://github.com/apache/sedona-db/pull/1218#discussion_r3917883993


##########
integration/spark-parity/test_rs_raster_out.py:
##########
@@ -37,19 +37,40 @@
 
 import pytest
 
+from sedonadb.raster_testing import DecodedRaster, random_raster_data
 from sedonadb.testing import SedonaDB, compare
 from sedonadb.testing_spark import SedonaSpark
 
 # Each value is representable in its dtype, so it packs into the band exactly.
 BAND_NODATA = {"uint8": 200.0, "int32": -99999.0, "float64": -12345.5}
 
+# The grid the anchored tests write and reconstruct. Anchors must state the
+# exact raster they expect, so the placement is passed to
+# create_random_raster_view explicitly rather than relying on its defaults
+# staying in sync — and the anchors state the same BBOX.
+BANDS, HEIGHT, WIDTH = 2, 6, 7
+BBOX = (100.0, 482.0, 114.0, 500.0)
+
+
+def _anchor(dtype, nodata, *, bands=BANDS, plants=None):
+    """The `DecodedRaster` a pixel-preserving setter must return on the
+    standard grid: the seeded pixels unchanged, with `nodata` per band."""
+    return DecodedRaster(
+        random_raster_data(
+            dtype, bands=bands, height=HEIGHT, width=WIDTH, plants=plants
+        ),
+        nodata=nodata,
+        bbox=BBOX,
+    )

Review Comment:
   Is this the best place for this? Are the bands / bbox duplicated from the 
default for `random_raster_data()`? Maybe `DecodedRaster.random()` is better?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to