Skip to content

Commit 72fc12e

Browse files
committed
extent crs should always be string
1 parent 66cc9ff commit 72fc12e

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

tests/test_dry_run.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -591,9 +591,9 @@ def test_aggregate_spatial_only(dry_run_env, dry_run_tracer):
591591
assert src == ("load_collection", ("S2_FOOBAR", ()))
592592

593593
assert constraints == {
594-
"spatial_extent": {'crs': 32631, 'east': 1056748.2872412915, 'north': 552664.2968779367, 'south': 0.0, 'west': 166021.44308054057},
594+
"spatial_extent": {'crs': "EPSG:32631", 'east': 1056748.2872412915, 'north': 552664.2968779367, 'south': 0.0, 'west': 166021.44308054057},
595595
"aggregate_spatial": {"geometries": DriverVectorCube.from_geojson(polygon)},
596-
"weak_spatial_extent": {'crs': 32631, 'east': 1056748.2872412915, 'north': 552664.2968779367, 'south': 0.0, 'west': 166021.44308054057},
596+
"weak_spatial_extent": {'crs': "EPSG:32631", 'east': 1056748.2872412915, 'north': 552664.2968779367, 'south': 0.0, 'west': 166021.44308054057},
597597
}
598598
(geometries,) = dry_run_tracer.get_geometries()
599599
assert isinstance(geometries, DriverVectorCube)
@@ -616,7 +616,7 @@ def test_aggregate_spatial_only(dry_run_env, dry_run_tracer):
616616
(
617617
{"type": "Point", "coordinates": (2, 3)},
618618
approxify(
619-
{'crs': 32631,
619+
{'crs': "EPSG:32631",
620620
'east': 388880.8418,
621621
'north': 331653.859,
622622
'south': 331634.017,
@@ -629,7 +629,7 @@ def test_aggregate_spatial_only(dry_run_env, dry_run_tracer):
629629
shapely.geometry.Point(4, 5),
630630
),
631631
approxify(
632-
{'crs': 32631,
632+
{'crs': "EPSG:32631",
633633
'east': 610869.8770073673,
634634
'north': 552758.5425218772,
635635
'south': 331634.0169357686,
@@ -638,7 +638,7 @@ def test_aggregate_spatial_only(dry_run_env, dry_run_tracer):
638638
),
639639
(
640640
{"type": "Polygon", "coordinates": [[(0, 0), (3, 5), (8, 2), (0, 0)]]},
641-
{'crs': 32631,
641+
{'crs': "EPSG:32631",
642642
'east': 1056748.2872412915,
643643
'north': 552664.2968779367,
644644
'south': 0.0,
@@ -649,7 +649,7 @@ def test_aggregate_spatial_only(dry_run_env, dry_run_tracer):
649649
shapely.geometry.Polygon.from_bounds(2, 3, 5, 8),
650650
shapely.geometry.Polygon.from_bounds(3, 5, 8, 13),
651651
),
652-
{'crs': 32631,
652+
{'crs': "EPSG:32631",
653653
'east': 1054970.5285543476,
654654
'north': 1442473.7600420578,
655655
'south': 331643.9380733739,
@@ -661,7 +661,7 @@ def test_aggregate_spatial_only(dry_run_env, dry_run_tracer):
661661
shapely.geometry.Polygon.from_bounds(3, 5, 8, 13),
662662
),
663663
approxify(
664-
{'crs': 32631,
664+
{'crs': "EPSG:32631",
665665
'east': 1054970.528,
666666
'north': 1442473.760,
667667
'south': 331634.017,
@@ -835,7 +835,7 @@ def test_aggregate_spatial_apply_dimension(dry_run_env, dry_run_tracer):
835835
src, constraints = source_constraints[0]
836836
assert src == ("load_collection", ("S2_FOOBAR", (),('B04', 'B08', 'B11', 'SCL')))
837837
assert constraints == {
838-
"spatial_extent": {'crs': 32631,
838+
"spatial_extent": {'crs': "EPSG:32631",
839839
'east': 1056748.2872412915,
840840
'north': 552664.2968779367,
841841
'south': 0.0,
@@ -845,7 +845,7 @@ def test_aggregate_spatial_apply_dimension(dry_run_env, dry_run_tracer):
845845
"custom_cloud_mask": {"method": "mask_scl_dilation", 'scl_band_name': 'SCL'},
846846
"aggregate_spatial": {"geometries": DriverVectorCube.from_geojson(polygon)},
847847
"temporal_extent": ("2018-11-01", "2020-02-01"),
848-
"weak_spatial_extent": {'crs': 32631,
848+
"weak_spatial_extent": {'crs': "EPSG:32631",
849849
'east': 1056748.2872412915,
850850
'north': 552664.2968779367,
851851
'south': 0.0,
@@ -883,7 +883,7 @@ def test_aggregate_spatial_and_filter_bbox(dry_run_env, dry_run_tracer):
883883
assert constraints == {
884884
"spatial_extent": bbox,
885885
"aggregate_spatial": {"geometries": DriverVectorCube.from_geojson(polygon)},
886-
"weak_spatial_extent": {'crs': 32631,
886+
"weak_spatial_extent": {'crs': "EPSG:32631",
887887
'east': 1056748.2872412915,
888888
'north': 552664.2968779367,
889889
'south': 0.0,
@@ -921,14 +921,14 @@ def test_multiple_filter_spatial(dry_run_env, dry_run_tracer):
921921
assert src == ("load_collection", ("S2_FOOBAR", ()))
922922
geometries = dry_run_tracer.get_last_geometry(operation="filter_spatial")
923923
assert constraints == {
924-
"spatial_extent": {'crs': 32631,
924+
"spatial_extent": {'crs': "EPSG:32631",
925925
'east': 1056748.2872412915,
926926
'north': 552664.2968779367,
927927
'south': 0.0,
928928
'west': 166021.44308054057},
929929
"filter_spatial": {"geometries": DummyVectorCube.from_geometry(shapely.geometry.shape(polygon1))},
930930
"resample": {"method": "near", "resolution": [0.25, 0.25], "target_crs": 4326},
931-
"weak_spatial_extent": {'crs': 32631,
931+
"weak_spatial_extent": {'crs': "EPSG:32631",
932932
'east': 1056748.2872412915,
933933
'north': 552664.2968779367,
934934
'south': 0.0,
@@ -968,12 +968,12 @@ def test_filter_spatial_delayed_vector(dry_run_env, dry_run_tracer, path, expect
968968
(
969969
"parquet/mol.pq",
970970
tuple(pytest.approx(x, abs=1) for x in (645146.7, 5672137.6, 648591.9, 5676210.3)),
971-
32631,
971+
"EPSG:32631",
972972
),
973973
(
974974
"parquet/mol-utm.pq",
975975
tuple(pytest.approx(x, abs=1) for x in (645146, 5672137, 648591, 5676210)),
976-
32631,
976+
"EPSG:32631",
977977
),
978978
],
979979
)

0 commit comments

Comments
 (0)