Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and start a new "In Progress" section above it.
- Support experimental `corsa_compress_v2` and `corsa_decompress_v2` processes ([Open-EO/openeo-geotrellis-extensions#702](https://github.com/Open-EO/openeo-geotrellis-extensions/issues/702))
- Dry run: pass through `align` argument of `resample_spatial` operation ([Open-EO/openeo-geopyspark-driver#1662](https://github.com/Open-EO/openeo-geopyspark-driver/issues/1662))
- `BoundingBox.round_to_resolution()`: add `offset_x` and `offset_y` parameters ([Open-EO/openeo-geopyspark-driver#1662](https://github.com/Open-EO/openeo-geopyspark-driver/issues/1662))
- Bump STAC version from `0.9.0` to `1.0.0` in capabilities endpoint, collection metadata, job results and ML model metadata ([#363](https://github.com/Open-EO/openeo-python-driver/issues/363))


## 0.138.0
Expand Down
9 changes: 4 additions & 5 deletions openeo_driver/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def index():
"version": api_version, # Deprecated pre-0.4.0 API version field
"api_version": api_version, # API version field since 0.4.0
"backend_version": backend_version,
"stac_version": "0.9.0", # TODO #363 bump to 1.x.y?
"stac_version": "1.0.0",
"type": "Catalog",
"conformsTo": backend_implementation.conformance_classes(),
"id": service_id,
Expand Down Expand Up @@ -1326,7 +1326,7 @@ def intersect_dicts(dict1, dict2):
else:
result = {
"type": "Feature",
"stac_version": "0.9.0",
"stac_version": "1.0.0",
"id": job_info.id,
"properties": _properties_from_job_info(job_info),
"assets": assets,
Expand Down Expand Up @@ -1791,7 +1791,7 @@ def _download_ml_model_metadata(job_id: str, file_name: str, user_id) -> flask.R
asset_metadata=asset, asset_name=asset_file_name, job_id=job_id, user_id=user_id
)
stac_item = {
"stac_version": ml_model_metadata.get("stac_version", "0.9.0"),
"stac_version": ml_model_metadata.get("stac_version", "1.0.0"),
"stac_extensions": ml_model_metadata.get("stac_extensions", []),
"type": "Feature",
"id": ml_model_metadata.get("id"),
Expand Down Expand Up @@ -2232,8 +2232,7 @@ def _normalize_collection_metadata(metadata: dict, api_version: ComparableVersio
dim["extent"] = interval

# Make sure some required fields are set.
# TODO #363 bump stac_version default to 1.0.0 or even 1.1.0?
metadata.setdefault("stac_version", "0.9.0")
metadata.setdefault("stac_version", "1.0.0")
metadata.setdefault(
"stac_extensions",
[
Expand Down
26 changes: 13 additions & 13 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def test_versioned_urls(self, client, url, expected_version):
def test_capabilities_100(self, api100):
capabilities = api100.get("/").assert_status_code(200).json
assert capabilities["api_version"] == "1.0.0"
assert capabilities["stac_version"] == "0.9.0"
assert capabilities["stac_version"] == "1.0.0"
assert capabilities["title"] == "Dummy openEO Backend"
assert (
capabilities["description"]
Expand Down Expand Up @@ -1022,7 +1022,7 @@ def test_normalize_collection_metadata_no_id(self, caplog):
def test_normalize_collection_metadata_minimal_100(self, caplog):
assert _normalize_collection_metadata({"id": "foobar"}, api_version=ComparableVersion("1.0.0")) == {
"id": "foobar",
"stac_version": "0.9.0",
"stac_version": "1.0.0",
"stac_extensions": [
"https://stac-extensions.github.io/datacube/v2.2.0/schema.json",
"https://stac-extensions.github.io/eo/v1.1.0/schema.json",
Expand All @@ -1038,7 +1038,7 @@ def test_normalize_collection_metadata_minimal_100(self, caplog):
def test_normalize_collection_metadata_minimal_full_100(self, caplog):
assert _normalize_collection_metadata({"id": "foobar"}, api_version=ComparableVersion("1.0.0"), full=True) == {
"id": "foobar",
"stac_version": "0.9.0",
"stac_version": "1.0.0",
"stac_extensions": [
"https://stac-extensions.github.io/datacube/v2.2.0/schema.json",
"https://stac-extensions.github.io/eo/v1.1.0/schema.json",
Expand Down Expand Up @@ -1069,7 +1069,7 @@ def test_normalize_collection_metadata_cube_dimensions_extent_full_100(self, cap
}
assert _normalize_collection_metadata(metadata, api_version=ComparableVersion("1.0.0"), full=True) == {
"id": "foobar",
"stac_version": "0.9.0",
"stac_version": "1.0.0",
"stac_extensions": [
"https://stac-extensions.github.io/datacube/v2.2.0/schema.json",
"https://stac-extensions.github.io/eo/v1.1.0/schema.json",
Expand Down Expand Up @@ -1115,7 +1115,7 @@ def test_normalize_collection_metadata_bands_stac110(self, caplog):
res = _normalize_collection_metadata(metadata, api_version=ComparableVersion("1.0.0"), full=True)
assert res == dirty_equals.IsPartialDict(
id="foobar",
stac_version="0.9.0", # TODO #363
stac_version="1.0.0",
stac_extensions=dirty_equals.Contains(
"https://stac-extensions.github.io/eo/v1.1.0/schema.json",
),
Expand Down Expand Up @@ -1205,7 +1205,7 @@ def test_collection_full_metadata(self, api, api_version):
{"name": "B08", "common_name": "nir"},
]
if api.api_version_compare.at_least("1.0.0"):
assert collection["stac_version"] == "0.9.0"
assert collection["stac_version"] == "1.0.0"
assert collection["cube:dimensions"] == cube_dimensions
assert collection["summaries"]["eo:bands"] == eo_bands
assert collection["extent"]["spatial"] == {"bbox": [[2.5, 49.5, 6.2, 51.5]]}
Expand Down Expand Up @@ -1942,7 +1942,7 @@ def test_get_job_results_100(self, api100):
"https://stac-extensions.github.io/file/v2.1.0/schema.json",
"https://stac-extensions.github.io/eo/v1.1.0/schema.json",
],
"stac_version": "0.9.0",
"stac_version": "1.0.0",
"type": "Feature",
"openeo:status": "finished",
}
Expand Down Expand Up @@ -2033,7 +2033,7 @@ def test_get_job_results_100(self, api100):
"https://stac-extensions.github.io/eo/v1.1.0/schema.json",
"https://stac-extensions.github.io/projection/v1.2.0/schema.json",
],
"stac_version": "0.9.0",
"stac_version": "1.0.0",
"type": "Feature",
"openeo:status": "finished",
}
Expand Down Expand Up @@ -2388,7 +2388,7 @@ def test_get_job_results_signed_100(self, api100, flask_app, backend_config_over
"https://stac-extensions.github.io/file/v2.1.0/schema.json",
"https://stac-extensions.github.io/eo/v1.1.0/schema.json",
],
"stac_version": "0.9.0",
"stac_version": "1.0.0",
"type": "Feature",
"openeo:status": "finished",
}
Expand Down Expand Up @@ -2672,7 +2672,7 @@ def test_get_job_results_signed_with_expiration_100(self, api100, flask_app, bac
"https://stac-extensions.github.io/file/v2.1.0/schema.json",
"https://stac-extensions.github.io/eo/v1.1.0/schema.json",
],
"stac_version": "0.9.0",
"stac_version": "1.0.0",
"type": "Feature",
"openeo:status": "finished",
}
Expand Down Expand Up @@ -3902,7 +3902,7 @@ def test_get_job_result_item(self, flask_app, api110, backend_config_overrides):
pystac.validation.stac_validator.JsonSchemaSTACValidator().validate(
stac_dict=resp_data,
stac_object_type=pystac.STACObjectType.ITEM,
stac_version=resp_data.get("stac_version", "0.9.0"),
stac_version=resp_data.get("stac_version", "1.0.0"),
extensions=resp_data.get("stac_extensions", []),
)

Expand Down Expand Up @@ -4000,7 +4000,7 @@ def test_get_vector_cube_job_result_item(
pystac.validation.stac_validator.JsonSchemaSTACValidator().validate(
stac_dict=resp_data,
stac_object_type=pystac.STACObjectType.ITEM,
stac_version=resp_data.get("stac_version", "0.9.0"),
stac_version=resp_data.get("stac_version", "1.0.0"),
extensions=resp_data.get("stac_extensions", []),
)

Expand Down Expand Up @@ -4065,7 +4065,7 @@ def test_get_job_result_item_with_temporal_extent_on_asset(self, flask_app, api1
pystac.validation.stac_validator.JsonSchemaSTACValidator().validate(
stac_dict=resp_data,
stac_object_type=pystac.STACObjectType.ITEM,
stac_version=resp_data.get("stac_version", "0.9.0"),
stac_version=resp_data.get("stac_version", "1.0.0"),
extensions=resp_data.get("stac_extensions", []),
)

Expand Down