Skip to content

Model Metadata YAML Validation#95

Merged
rbavery merged 14 commits into
stac-extensions:mainfrom
wherobots:isaac/minimal-metadata-validation
Jul 22, 2025
Merged

Model Metadata YAML Validation#95
rbavery merged 14 commits into
stac-extensions:mainfrom
wherobots:isaac/minimal-metadata-validation

Conversation

@isaaccorley
Copy link
Copy Markdown
Contributor

@isaaccorley isaaccorley commented Jul 9, 2025

Description

Adding an example yaml of only the ML model metadata only minus the STAC required components. This can be validated using the pydantic classes like so:

import yaml
from stac_model.schema import MLModelProperties

with open("examples/mlm-metadata.yaml", "r") as f:
    metadata = yaml.safe_load(f)

MLModelProperties.model_validate(metadata)  # validates that the required metadata fields are filled out and the correct types

Related Issue

N/A

Type of Change

  • 📚 Examples, docs, tutorials or dependencies update;
  • 🔧 Bug fix (non-breaking change which fixes an issue);
  • 🥂 Improvement (non-breaking change which improves an existing feature);
  • 🚀 New feature (non-breaking change which adds functionality);
  • 💥 Breaking change (fix or feature that would cause existing functionality to change);
  • 🔐 Security fix.

Checklist

  • I've read the CONTRIBUTING.md guide;
  • I've updated the code style using make check;
  • I've written tests for all new methods and classes that I created;
  • I've written the docstring in Google format for all the methods and classes that I used.

@isaaccorley isaaccorley changed the title add tests for yaml validation Model Metadata YAML Validation Jul 9, 2025
@isaaccorley isaaccorley marked this pull request as ready for review July 9, 2025 22:55
Comment thread examples/mlm-metadata.yaml Outdated
Comment thread tests/test_schema.py
Comment thread examples/mlm-metadata.yaml Outdated
Comment thread examples/mlm-metadata.yaml Outdated
Copy link
Copy Markdown
Collaborator

@fmigneault fmigneault left a comment

Choose a reason for hiding this comment

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

Please update the CHANGELOG.md with a brief information of added feature.

@fmigneault fmigneault mentioned this pull request Jul 11, 2025
10 tasks
Copy link
Copy Markdown
Collaborator

@fmigneault fmigneault left a comment

Choose a reason for hiding this comment

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

just the pre_processing_function part left to decide

@isaaccorley isaaccorley force-pushed the isaac/minimal-metadata-validation branch from fddffcc to bf9f56f Compare July 14, 2025 19:08
@isaaccorley
Copy link
Copy Markdown
Contributor Author

I think these errors in the README.md markdown linting are unrelated to my PR but I can go ahead and fix them:

> stac-mlm@1.4.0 check-markdown
> remark . -f -r .github/remark.yaml -i .remarkignore

CHANGELOG.md: no issues found
CONTRIBUTING.md: no issues found
README.md
  181:1-181:162  warning  Link to unknown heading in `best-practices.md`: `recommended-extensions-to-compose-with-the-ml-model-extension`. Did you mean `recommended-extensions-to-compose-with-the-mlm-extension`  missing-heading-in-file  remark-validate-links
   188:1-188:96  warning  Link to unknown heading in `best-practices.md`: `using-stac-common-metadata-fields-for-the-ml-model-extension`. Did you mean `using-stac-common-metadata-fields-for-the-mlm-extension`    missing-heading-in-file  remark-validate-links

@isaaccorley isaaccorley requested a review from fmigneault July 15, 2025 19:43
@fmigneault
Copy link
Copy Markdown
Collaborator

@isaaccorley I think you need to update/merge with master. The force-push override them in your branch.

@isaaccorley
Copy link
Copy Markdown
Contributor Author

@fmigneault my branch is up to date with the main branch. Looks like these issues are also present on main
image

Comment thread examples/torch/mlm-metadata.yaml Outdated
Comment thread examples/torch/mlm-metadata.yaml Outdated
Comment thread tests/torch/test_metadata.py Outdated
@fmigneault fmigneault mentioned this pull request Jul 15, 2025
11 tasks
@isaaccorley isaaccorley requested a review from fmigneault July 15, 2025 23:20
Copy link
Copy Markdown
Collaborator

@fmigneault fmigneault left a comment

Choose a reason for hiding this comment

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

Thanks for the changes!

Comment thread README_STAC_MODEL.md Outdated
Comment thread README_STAC_MODEL.md Outdated
@isaaccorley isaaccorley requested a review from fmigneault July 17, 2025 14:36
Copy link
Copy Markdown
Collaborator

@rbavery rbavery left a comment

Choose a reason for hiding this comment

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

Thanks @isaaccorley !

@rbavery rbavery merged commit dbbf216 into stac-extensions:main Jul 22, 2025
5 checks passed
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.

3 participants