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

Fix/add experimental key to collections endpoint result #88

Merged
Merged
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
24 changes: 16 additions & 8 deletions rest/openeo_collections/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@
}


def build_basic_collection(collection_info):
basic_collection = {
"stac_version": collection_info["stac_version"],
"id": collection_info["id"],
"description": collection_info["description"],
"license": collection_info["license"],
"extent": collection_info["extent"],
"links": collection_info["links"],
}
if collection_info.get("experimental") is not None:
basic_collection["experimental"] = collection_info.get("experimental")

return basic_collection


class CollectionsProvider:
def __init__(self, id, url=None, directory=None):
self.id = id
Expand Down Expand Up @@ -99,14 +114,7 @@ def set_collections(self, collections):
def get_collections_basic_info(self):
self.check_if_loaded()
collections_basic_info = map(
lambda collection_info: {
"stac_version": collection_info["stac_version"],
"id": collection_info["id"],
"description": collection_info["description"],
"license": collection_info["license"],
"extent": collection_info["extent"],
"links": collection_info["links"],
},
build_basic_collection,
self.collections_cache.values(),
)

Expand Down
Loading