Skip to content
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

Classification extension not working with classes #1483

Closed
remicres opened this issue Dec 15, 2024 · 1 comment
Closed

Classification extension not working with classes #1483

remicres opened this issue Dec 15, 2024 · 1 comment

Comments

@remicres
Copy link
Contributor

How to reproduce

from pystac.extensions.classification import ClassificationExtension, Classification

item = pystac.Item(...)
CLASSES = [{"value": 2,  "name": "cloud", "description": "Clouds", "color_hint": "B8D0EC"}, ...]

classif_ext = ClassificationExtension.ext(item.assets["asset_key"], add_if_missing=True)
classes = [Classification.create(**cls) for cls in CLASSES]
classif_ext.apply(classes=classes)
print(classif_ext.classes)

What we see is None.
However we should see {'classification:classes': [{'value': 2, 'name': 'cloud', 'description': 'Clouds', 'color_hint': 'B8D0EC'}, ...]}

remicres added a commit to remicres/pystac that referenced this issue Dec 15, 2024
@remicres remicres mentioned this issue Dec 15, 2024
4 tasks
remicres added a commit to remicres/pystac that referenced this issue Dec 16, 2024
github-merge-queue bot pushed a commit that referenced this issue Dec 17, 2024
* fix #1483

* add a test for #1483

* fix: rewrite cassette

* fix: formatting

---------

Co-authored-by: Pete Gadomski <[email protected]>
@gadomski
Copy link
Member

Closed by #1484

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

No branches or pull requests

2 participants