Skip to content

Test custom job results#512

Open
EmileSonneveld wants to merge 8 commits into
masterfrom
test_custom_job_results
Open

Test custom job results#512
EmileSonneveld wants to merge 8 commits into
masterfrom
test_custom_job_results

Conversation

@EmileSonneveld

Copy link
Copy Markdown
Member

@copilot review

@EmileSonneveld

Copy link
Copy Markdown
Member Author

@copilot review

Comment thread openeo_driver/views.py Outdated
# Machine learning models.
return result_dict
bands = asset_metadata.get("bands")
bands = asset_metadata.get("bands") or asset_metadata.get("eo:bands")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soxofaan An issue for CWL here was that the results can be stac1.0, while the code assumed the was 1.1.
Would wrapping this or with TREAT_JOB_RESULTS_V100_LIKE_V110 make more sense?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example with

        bands = asset_metadata.get("bands")
        TREAT_JOB_RESULTS_V100_LIKE_V110 = smart_bool(os.environ.get("TREAT_JOB_RESULTS_V100_LIKE_V110", "0"))
        if not bands and stac11 and TREAT_JOB_RESULTS_V100_LIKE_V110:
            bands = asset_metadata.get("eo:bands")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as I understand, TREAT_JOB_RESULTS_V100_LIKE_V110 is a temporary toggle/hack, which I would avoid here

I would just use bands = asset_metadata.get("bands") or asset_metadata.get("eo:bands")

There is a possible problem however that "bands" and "eo:bands" have subtly different sub-structure: e.g. in "bands" you could find "center_wavelength", while in "eo:bands" you would just have "center_wavelength" (without prefix). But I guess the most (only?) important field is just "name", which is the same in both.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the conditional, and now only keeps name property
bands = [{"name": b["name"]} for b in eo_bands]

@EmileSonneveld EmileSonneveld force-pushed the test_custom_job_results branch from 0a7bd1d to b6da14b Compare June 12, 2026 09:47
Comment thread openeo_driver/util/stac_utils.py Outdated
Comment thread openeo_driver/views.py Outdated
# Machine learning models.
return result_dict
bands = asset_metadata.get("bands")
bands = asset_metadata.get("bands") or asset_metadata.get("eo:bands")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as I understand, TREAT_JOB_RESULTS_V100_LIKE_V110 is a temporary toggle/hack, which I would avoid here

I would just use bands = asset_metadata.get("bands") or asset_metadata.get("eo:bands")

There is a possible problem however that "bands" and "eo:bands" have subtly different sub-structure: e.g. in "bands" you could find "center_wavelength", while in "eo:bands" you would just have "center_wavelength" (without prefix). But I guess the most (only?) important field is just "name", which is the same in both.

Comment thread tests/data/example_stac_catalog_11/openEO_2023-06-01Z.tif Outdated
Comment thread tests/data/example_stac_catalog_11/item-2023-06-06.json

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this document exactly? It doens't have an id or type as far as I see

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the batch job metadata that gets stored in the results folder. It is used to create stac content with that is returned to the client.

Comment thread tests/data/job_metadata_from_cwl.json Outdated
"end_datetime": "2023-06-06T00:00:00Z",
"links": [
{
"href": ".../collection.json",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentional to have leading tripple dots here (and in some other places)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this and other examples to .../non/existing/example/path/collection.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants