-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update MLM JSON schema to enforce mlm:input
band checks as intended
#39
Conversation
@rbavery FYI I've realized that by enabling the following: mlm-extension/json-schema/schema.json Lines 53 to 56 in 5212acf
... many of the "band" checks across EO/Raster/STAC-core were actually incorrect, as well as some of the provided examples. For example, mlm-extension/examples/item_raster_bands.json Line 208 in 6338f4d
raster:bands at the Item properties level, when they MUST be under an Asset according to raster extension.
Similarly, https://github.com/crim-ca/mlm-extension/blob/v1.2.0/stac_model/examples.py defined |
7e936c8
to
f64c937
Compare
mlm:input
band checks as intended
@rbavery |
Merging and will pin as v1.3.0 to avoid dealing with the integration before move to https://github.com/stac-extensions/mlm. |
Description
Warning
If an existing MLM definition was succeeding with https://github.com/crim-ca/mlm-extension/tree/v1.2.0, it might fail with this revision due to the stricter validation of bands. Older definitions could be considered "incomplete" from the missing "bands" reference if they were not employing other extensions properly (see https://github.com/crim-ca/mlm-extension/tree/fix-comments#bands-and-statistics for details).
Added
raster:bands
required propertyname
for describingmlm:input
bands(see https://github.com/crim-ca/mlm-extension/tree/fix-comments#bands-and-statistics) for details).
eo
andraster
versions.Changed
ModelBands
andAnyBandsRef
definitions in the JSON schema to allow them to be referenced individually.AnyBandsRef
definition explicitly to STAC Item JSON schema, rather than implicitly inferred viamlm:input
.if
check of thetype
(STAC Item or Collection) prior to validating furtherproperties. This allows some validators (e.g.
pystac
) to better report the real error that causes the schemato fail, rather than reporting the first mismatching
type
case with a poor error description to debug the issue.Deprecated
Removed
$comment
entries from the JSON schema that are considered as invalid by some parsers.mlm:input
objects do NOT define band references (i.e.:bands: []
is used), the JSON schema will notfail if an Asset with the
mlm:model
role contains a band definition. This is to allow MLM model definitions tosimultaneously use some inputs with
bands
reference names while others do not.Fixed
eo
,raster
or STAC Core 1.1bands
when amlm:input
references names inbands
are now properly validated.raster:bands
incorrectly defined in STAC Item properties.The correct use is for them to be defined under the STAC Asset using the
mlm:model
role.bands
in itsmlm:input
definition without providing any definition of those bands. Theeo:bands
properties have been added to the correspondingmodel
Asset using thepystac.extensions.eo
utilities.mlm:model
role instead of the intendedmlm:source_code
.Related Issue
Type of Change
Checklist
CONTRIBUTING.md
guide;make check
;Google
format for all the methods and classes that I used.